ARoad0.gDMak
Class ActionSave

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

public class ActionSave
extends javax.swing.AbstractAction
implements Singleton

An action that saves the object (ACS, view) associated to the active frame in the GUI.

See Also:
Serialized Form

Field Summary
private static java.lang.String currentDir__
           
private static java.lang.String fileSepar__
           
private static ActionSave instance__
           
private static java.lang.String lineSepar__
           
private static java.lang.String userDir__
           
 
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 ActionSave()
          With this private constructor, the compiler won't generate a default public constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent _ev)
          Save the selected frame object.
static ActionSave getInstance()
          The only mean to get the instance.
 void save(java.lang.String _type, ImmutableName _name, java.util.Map _m_GUIconfig, boolean _withGraphicViewListeningRestoration)
          Save an opened ACS or ViewInBase, which will be restored by Gui1.Desktop at the next opening.
 
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 ActionSave instance__

currentDir__

private static java.lang.String currentDir__

userDir__

private static java.lang.String userDir__

fileSepar__

private static java.lang.String fileSepar__

lineSepar__

private static java.lang.String lineSepar__
Constructor Detail

ActionSave

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

Method Detail

getInstance

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

Returns:
ActionSave

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent _ev)
Save the selected frame object. Manage the actions fired from two sources:

- from 'Save' in the main menu when the main frame is activated in the desktop

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

A control validates the selected frame or node by verifying that it is associated to an ACS.

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

save

public void save(java.lang.String _type,
                 ImmutableName _name,
                 java.util.Map _m_GUIconfig,
                 boolean _withGraphicViewListeningRestoration)
Save an opened ACS or ViewInBase, which will be restored by Gui1.Desktop at the next opening. The Sketcher is the unique view to be never processed in this method, since it is not in the explorer. Add items in the GUI configuration map and save in a file, but never remove an item. In the GUI configuration map, work only on the map which is the value for the key 'new NameImpl("")'. Called by actionPerformed() and ActionSaveAll.

Parameters:
_type - equals to 'acs' or 'view'. Noop otherwise.
_name - of the object to save
_m_GUIconfig - is the GUI configuration map. May be null. If not, it is updated and saved by this method.
_withGraphicViewListeningRestoration - true to restore, after the saving of an ACS, the listening of events from the base by the GraphicViewBaseListeners. Set to false only when the acs or the program is closing. No use if _type is 'view'.
Since:
0.6.5
See Also:
Desktop