ARoad0.gDMak
Class ActionSaveAll

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

public class ActionSaveAll
extends javax.swing.AbstractAction
implements Singleton

An action that saves all the ACS and the views. This is a typical sequence of calls, in the inverse order, when the ACS of an external linked privilege is saved:

ARoad0.Gui1.CollectionPropertyEditor.propertyChange()

at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)

at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:347)

at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)

at ARoad0.gBase.ACSImpl.firePropertyChange(ACSImpl.java:5454)

at ARoad0.gBase.ACSImpl.removeAcsController(ACSImpl.java:7981)

at ARoad0.gBase.ACSImpl.removeEorResource(ACSImpl.java:4014)

at ARoad0.gBase.PrivilegeForLinksImpl.removeEorPrivilegeTargetLink(PrivilegeForLinksImpl.java:1447)

at ARoad0.gBase.CPrivilegeUserImpl.removeEorPrivilegeToTarget(CPrivilegeUserImpl.java:481)

at ARoad0.gBase.ResourceImpl.removeEorPrivilegeToTarget(ResourceImpl.java:1999)

at ARoad0.gBase.PrivilegeForLinksImpl.finalizeForBase(PrivilegeForLinksImpl.java:1829)

at ARoad0.gBase.PrivilegeAbst.finalizeForUser(PrivilegeAbst.java:1281)

at ARoad0.gBase.ACSImpl.closeExternalLinkedPrivileges(ACSImpl.java:6327)

at ARoad0.gBase.BaseManagerImpl.cutACSExternalLinks(BaseManagerImpl.java:2915)

at ARoad0.gBase.BaseManagerImpl.saveOpenACS(BaseManagerImpl.java:2393)

at ARoad0.gWork.ACS_Facade.saveACS(ACS_Facade.java:188)

at ARoad0.gDMak.ActionSave.save(ActionSave.java:210)

at ARoad0.gDMak.ActionSaveAll.saveAll(ActionSaveAll.java:302)

at ARoad0.gDMak.ActionSaveAll.actionPerformed(ActionSaveAll.java:87)

Since:
0.5.0
See Also:
Serialized Form

Field Summary
private static ActionSaveAll instance__
           
private static java.lang.String lineSepar__
           
 
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 ActionSaveAll()
          With this private constructor, the compiler won't generate a default public constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ev)
          Manages the SaveAll action fired from the main menu.
static ActionSaveAll getInstance()
          The only mean to get the instance.
 void saveAll(boolean _withGraphicViewListeningRestoration)
          Saves all the open ACS and views in the base, and the positions of the other frames like the explorer if they are open.
 
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 ActionSaveAll instance__

lineSepar__

private static java.lang.String lineSepar__
Constructor Detail

ActionSaveAll

private ActionSaveAll()
With this private constructor, the compiler won't generate a default public constructor.

Method Detail

getInstance

public static ActionSaveAll getInstance()
The only mean to get the instance.

Returns:
ActionSaveAll

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ev)
Manages the SaveAll action fired from the main menu.

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

saveAll

public void saveAll(boolean _withGraphicViewListeningRestoration)
Saves all the open ACS and views in the base, and the positions of the other frames like the explorer if they are open. The structure of the GUI configuration map is:

- the 3 possible keys are the Names '', '' and ''

- the 2 possible values are a Rectangle for '' only, and a Map, used for the last general saving of the GUI configuration for '', and for '', a Map of the GUI configuration for the objects which was not open at the last saving of the GUI, but has been saved before.

The rectangle for '' is the size of the Access Road main window.

The Map for '' contains a description of all the open internal frames and views at the last saving of the GUI.

Its structure is:

- the first possible entry is (String acs_name, null) when the acs is open

- the second possible entry is (Name acs_name, Rectangle) where the value is the position of the acs main frame

- the third possible entry is (Name name, Rectangle) where the name is equals to '' and the rectangle is the position of the Sketcher view

- the fourth possible entry is (String view_name, null) when the full view, the NoThan view or the Architecture view is open

- the fifth possible entry is (Name '', Rectangle) where the value is the position of the frame

- the sixth possible entry is (Name '', Rectangle) where the value is the position of the frame

- the seventh possible entry is (Name view_name, Rectangle) where the rectangle is the position of the view main frame

- the eighth possible entry is (NameImpl("")).extended(view_name), Map nodes_location) where nodes_location is an argument in the constructor of a GraphicView, to set the position of each node in the graphic

- the ninth possible entry is (NameImpl("")).extended(view_name), Rectangle) where the rectangle is the position of the 'See Why' frame for the view - the tenth possible entry is (NameImpl(""), Rectangle) where the rectangle is the position of the global structure frame

The Map for '' contains a description of all the open internal frames and views which was not open at the last saving of the GUI, but has been saved before.

Its structure is:

- the first possible entry is (Name acs_name, Rectangle) where the value is the position of the acs main frame

- the second possible entry is (Name name, Rectangle) where the name is equals to '' and the rectangle is the position of the Sketcher view

- the third possible entry is (Name '', Rectangle) where the value is the position of the frame

- the fourth possible entry is (Name '', Rectangle) where the value is the position of the frame

- the fiveth possible entry is (Name view_name, Rectangle) where the rectangle is the position of the view main frame

- the sixth possible entry is (NameImpl("")).extended(view_name), Map nodes_location) where nodes_location is an argument in the constructor of a GraphicView, to set the position of each node in the graphic

- the seventh possible entry is (NameImpl("")).extended(view_name), Rectangle) where the rectangle is the position of the 'See Why' frame for the view - the eighth possible entry is (NameImpl(""), Rectangle) where the rectangle is the position of the global structure frame

Calls ActionSave.save() for the ACS and the views to save. Called by actionPerformed() and ActionExit.

Parameters:
_withGraphicViewListeningRestoration - true to restore, after the saving of an ACS, the listening of events from the base by the GraphicViewBaseListeners. To set to false only when the acs or the program is closing. No use for the view savings.