org.argouml.uml.ui
Class ActionSaveGraphics
java.lang.Object
javax.swing.AbstractAction
org.argouml.uml.ui.UMLAction
org.argouml.uml.ui.ActionSaveGraphics
- All Implemented Interfaces:
- Action, ActionListener, Cloneable, CommandLineInterface, EventListener, Serializable
- public class ActionSaveGraphics
- extends UMLAction
- implements CommandLineInterface
Wraps a CmdSaveGIF or CmdSave(E)PS to allow selection of an output file.
- See Also:
- Serialized Form
Method Summary |
void |
actionPerformed(ActionEvent ae)
Perform the work the action is supposed to do. |
boolean |
doCommand(String argument)
Execute this action from the command line. |
private boolean |
doSave(File theFile,
String suffix,
boolean overwrite)
Actually do the saving. |
boolean |
trySave(boolean overwrite)
Method that does almost everything in this class. |
LOG
private static final Logger LOG
ActionSaveGraphics
public ActionSaveGraphics()
- Constructor for this action.
actionPerformed
public void actionPerformed(ActionEvent ae)
- Description copied from class:
UMLAction
- Perform the work the action is supposed to do.
This method needs to be overridden by all actions,
since it only shows a fake progressbar...
- Specified by:
actionPerformed
in interface ActionListener
- Overrides:
actionPerformed
in class UMLAction
- See Also:
UMLAction.actionPerformed(ActionEvent)
trySave
public boolean trySave(boolean overwrite)
- Method that does almost everything in this class.
- Parameters:
overwrite
- True if we shouldn't care that we erase an old copy.
- Returns:
- true if all went well.
doSave
private boolean doSave(File theFile,
String suffix,
boolean overwrite)
throws FileNotFoundException,
IOException
- Actually do the saving.
- Parameters:
theFile
- is the file that we are writing tosuffix
- is the suffix. Used for deciding what format the file
shall have.overwrite
- is true if we are not supposed to warn that we are
replacing an old file.
- Returns:
- true if it was successful.
- Throws:
FileNotFoundException
IOException
doCommand
public boolean doCommand(String argument)
- Execute this action from the command line.
TODO: The underlying GEF library relies on Acme that doesn't allow
us to create these files unless there is a window showing. For this
reason I have had to split the performing of commands in
Main.main(String[])
so that we can,
by not supplying the -batch option, run these commands
with the window showing. Hopefully this can eventually be fixed.
- Specified by:
doCommand
in interface CommandLineInterface
- Parameters:
argument
- is the file name that we save to.
- Returns:
- true if it is OK.
- See Also:
CommandLineInterface.doCommand(String)