ARoad0.gDMak
Class ActionClose

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by ARoad0.gDMak.ActionClose
All Implemented Interfaces:
TabClosingHandler, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public class ActionClose
extends javax.swing.AbstractAction
implements TabClosingHandler

An action that closes an ACS or a view in the base, closes its main frame if open, all its open frames and its graphical objects in other open frames, and removes its node in the explorer. When an ACS is closed, all the views which contain an element from this ACS are closed, and all the ACS which are direct or indirect children of this ACS are closed.

Manages closing commands from 5 sources:

- direct closing of the main frame of an acs or a view, from the frame listener

- direct closing of the tab of a view in a views tabbed pane, from the closing button

- from 'Close' in the main menu when the main frame is activated

- from 'Close' in the main menu when in the explorer, the ACS or view node is selected

- from ActionRemove, ActionOpenAllFullViews, ActionOpenAllNoThanViews and ViewTreeBaseListenerImpl, which call directly the close methods.

For views in the 'All views' or 'NoThan views' tabbed pane, there is 3 types of closing:

- close the ViewInBase in the program and then in the explorer

- close the ViewInBase tab in the tabbed pane without ViewInBase closing

- close the GraphicView in the tab to constuct a new one, without tab closing.

See Also:
ActionUtilities, Serialized Form

Field Summary
private static ActionClose instance__
           
private static ViewInBase_Facade ViewBase__
           
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
private ActionClose()
          with this private constructor, the compiler won't generate a default public constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent _ev)
          Manages closing commands from three sources: - direct closing of the main frame of an ACS or a view, from the 'All views' tab, at the frame listener - from 'Close' in the main menu when the main frame of an ACS or a view is activated - from 'Close' in the main menu when, in the explorer, an ACS or a view node is selected
 void close(ImmutableName _name, boolean _withSaving)
          Closes an open ACS or an open view, and saves it if necessary.
 void closeAllFullViewsFrame()
          Manages the closing of all the tabs in the 'All Full views' tabbed pane, then the closing of the JInternalFrame if it has not been done.
 void closeAllNoThanViewsFrame()
          Manages the closing of all the tabs in the 'All NoThan views' tabbed pane, then the closing of the JInternalFrame.
static void closeGraphicView(ImmutableName _name)
          Finalize the ViewRightsNetworkObserverImpl and the GraphicViewBaseListener for a ViewInBase, even if it is unknown by the base.
 void closeInGUI(ImmutableName _name, javax.swing.JComponent _compo)
          Closes in the GUI an open or closed ACS or an open view, but no closing in the base.
static void closeMainFrameInGUI(ImmutableName _name, javax.swing.JInternalFrame _frame, boolean _closeGraphicView)
          Close in the GUI the main frame of an open ACS, an open view, the 'All full views' or 'All NoThan views' frames.
private  void closeOneAllViewsTab(ImmutableName _name, javax.swing.JPanel _panel)
          Closes the tab pane of an open EPRView or NoThanView in the relevant TabbedPane of the GUI, with the graphic view and all the associated objects.
static boolean closeSeeWhyFrameInGUI(ImmutableName _name)
          Close the 'See why' main frame of an open view in the GUI, but not in a JTabbedPane.
 void closeStructureFrame()
          Manages the closing of the 'IS structure' pane, then the closing of the JInternalFrame.
static ActionClose getInstance()
          constructor()
 void tabClosingPerformed(ImmutableName _tab)
          Manages a tab closing in the 'All Views' frame.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance__

private static ActionClose instance__

ViewBase__

private static ViewInBase_Facade ViewBase__
Constructor Detail

ActionClose

private ActionClose()
with this private constructor, the compiler won't generate a default public constructor

Method Detail

getInstance

public static ActionClose getInstance()
constructor()

Returns:
ActionClose

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent _ev)
Manages closing commands from three sources: - direct closing of the main frame of an ACS or a view, from the 'All views' tab, at the frame listener - from 'Close' in the main menu when the main frame of an ACS or a view is activated - from 'Close' in the main menu when, in the explorer, an ACS or a view node is selected

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
_ev - ActionEvent

tabClosingPerformed

public void tabClosingPerformed(ImmutableName _tab)
Manages a tab closing in the 'All Views' frame. Called by the BeamerManager.initializeViewTabComponent() and closeAllViewsFrame().

Specified by:
tabClosingPerformed in interface TabClosingHandler
Parameters:
_tab - is the name of the BaseObject displayed in the tab

close

public void close(ImmutableName _name,
                  boolean _withSaving)
Closes an open ACS or an open view, and saves it if necessary. Called by actionPerformed(), ActionRemove, ActionExit and ViewTreeBaseListenerImpl.propertyChange(). Calls ACS_Facade.saveAndCloseOpenACS/View(), ACS_Facade.closeOpenACS/View() and closeInGUI(). If the 'Architecture' view is opened during an ACS closing, updates this view.

Parameters:
_name - of the entity to close
_withSaving - boolean true if the user requests a saving with the closing

closeInGUI

public void closeInGUI(ImmutableName _name,
                       javax.swing.JComponent _compo)
Closes in the GUI an open or closed ACS or an open view, but no closing in the base. The closing is done in the explorer and the main frame for an acs or a view, and for a view only, it is done in the tab and the 'See why' frame. For an ACS closing, the views using some of this-ACS objects listen the ACS closing, and for their proper closing, they fire an event to ViewTreeBaseListenerImpl that calls this method. Removes all the TreeBaseListeners associated to the ACS or view. Called by close(), ACSTreeBaseListernerImpl.changeOpenACS() and ViewTreeBaseListenerImpl.propertyChange(). The sketch view does not call this method. Its closing uses InternalFrame, since it is still registered in ViewModel when the GUI is closed through the ViewTreeBaseListenerImpl. Uses ACSTreeUtilities, TreeManager and ViewModel. Calls closeMainFrameInGUI() if _compo is a JInternalFrame, and closeOneAllViewsTab() if _compo is a Panel.

Parameters:
_name - of the entity to close
_compo - is the main component that displays the entity. Null when only the explorer as to be updated, or it is a JInternalFrame or a JPanel (for view JTabbedPanes).

closeAllFullViewsFrame

public void closeAllFullViewsFrame()
Manages the closing of all the tabs in the 'All Full views' tabbed pane, then the closing of the JInternalFrame if it has not been done. Called by InternalFrameUtilities.addAllFullViewsFrameListener().


closeAllNoThanViewsFrame

public void closeAllNoThanViewsFrame()
Manages the closing of all the tabs in the 'All NoThan views' tabbed pane, then the closing of the JInternalFrame. Called by InternalFrameUtilities.addAllNoThanViewsFrameListener().


closeStructureFrame

public void closeStructureFrame()
Manages the closing of the 'IS structure' pane, then the closing of the JInternalFrame. Called by InternalFrameUtilities.addStructureFrameListener(). Calls ActionOpenGlobalStructure.finalizePropertyEditors() and closeMainFrameInGUI(), TreeManager.removeAllTreeBaseListenerFor().

See Also:
InternalFrameUtilities.addStructureFrameListener(javax.swing.JInternalFrame)

closeOneAllViewsTab

private void closeOneAllViewsTab(ImmutableName _name,
                                 javax.swing.JPanel _panel)
Closes the tab pane of an open EPRView or NoThanView in the relevant TabbedPane of the GUI, with the graphic view and all the associated objects. Uses a call to the TabButton on the view tab to close it. Removes it in the InternalFrameModel, but no removing of the view node in the explorer, and no removing of the view in the base. Called by closeInGUI(), tabClosingPerformed(). Calls InternalFrameModel.getJComponentsOfBaseObjects().

Parameters:
_name - of the entity to close
_panel - that displays the entity objects in a JTabbedPane.

closeMainFrameInGUI

public static void closeMainFrameInGUI(ImmutableName _name,
                                       javax.swing.JInternalFrame _frame,
                                       boolean _closeGraphicView)
Close in the GUI the main frame of an open ACS, an open view, the 'All full views' or 'All NoThan views' frames. Remove it in the InternalFrameModel, but no removing of the view node in the explorer, and no removing of the view in the base, nor, for a view, in its view tab in the 'All views' pane. For a ViewInBase, close the 'See why' frame if it is open, and _closeGraphicView sets if the graphic view is finalized. Called by actionPerformed(), closeInGUI(), closeAllFullViewsFrame(), closeAllNoThanViewsFrame(), ActionOpenAllFullViews, ActionOpenAllNoThanViews and GraphicViewBaseListenerImpl.changeFrameView(). Calls InternalFrameModel.getBaseObjectsInMainFrames() and InternalFrameModel.addOnGoingClosingOnBaseObject().

Parameters:
_name - of the entity to close
_frame - that displays all the entity objects. May be null.
_closeGraphicView - true when the entity is a ViewInBase with a GraphicView to finalize. ActionOpenAll/NoThanViews call with an argument at 'false'.

closeGraphicView

public static void closeGraphicView(ImmutableName _name)
Finalize the ViewRightsNetworkObserverImpl and the GraphicViewBaseListener for a ViewInBase, even if it is unknown by the base. Not for the sketch view. Called by closeMainFrameInGUI() and closeOneAllViewsTab().

Parameters:
_name - of the ViewInBase

closeSeeWhyFrameInGUI

public static boolean closeSeeWhyFrameInGUI(ImmutableName _name)
Close the 'See why' main frame of an open view in the GUI, but not in a JTabbedPane. Remove it in the InternalFrameModel, but no removing of the view main frame, and view node in the explorer, and no removing of the view in the base, nor the 'See why' panel in one of the two 'All views' frames. No action if the name is not a view name or no 'See why' frame. Called by closeInGUI() and GraphicViewBaseListenerImpl.changeFrameView(). Use Desktop.getCurrentFrames().

Parameters:
_name - of the view
Returns:
true if the 'See why' frame has been found