org.argouml.uml.ui
Class ActionSaveAllGraphics

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byorg.tigris.gef.undo.UndoableAction
          extended byorg.argouml.uml.ui.ActionSaveAllGraphics
All Implemented Interfaces:
Action, ActionListener, Cloneable, EventListener, Serializable

public class ActionSaveAllGraphics
extends org.tigris.gef.undo.UndoableAction

Wraps a CmdSaveGIF or CmdSave(E)PS to allow selection of an output file. Introduced thanks to issue 2126. Saves diagrams only as GIFs.

TODO: Add a user choice for other formats (PNG, SVG,...)

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
ActionSaveAllGraphics()
          The constructor.
 
Method Summary
 void actionPerformed(ActionEvent ae)
           
protected  File getSaveDir(Project p)
           
 boolean trySave(boolean overwrite)
           
protected  boolean trySaveDiagram(boolean overwrite, Object target, File saveDir)
           
 
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
 

Constructor Detail

ActionSaveAllGraphics

public ActionSaveAllGraphics()
The constructor.

Method Detail

actionPerformed

public void actionPerformed(ActionEvent ae)
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

trySave

public boolean trySave(boolean overwrite)
Parameters:
overwrite - true if we can overwrite without asking
Returns:
success

trySaveDiagram

protected boolean trySaveDiagram(boolean overwrite,
                                 Object target,
                                 File saveDir)
Parameters:
overwrite - true if we can overwrite without asking
target - the diagram
saveDir - the directory to save to
Returns:
success

getSaveDir

protected File getSaveDir(Project p)
Parameters:
p - the current project
Returns:
returns null if the user did not approve his choice


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook