gistoolkit.application.command
Class SimpleCommand

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended bygistoolkit.application.command.SimpleCommand
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, Command, java.util.EventListener, java.io.Serializable
Direct Known Subclasses:
AboutCommand, CenterOnPointCommand, CopyCommand, CutCommand, DeleteCommand, EditCommand, ExitCommand, ImageChopperCommand, LegendCommand, NewLayerCommand, NewShapeCommand, OpenConfigurationCommand, OpenLayerCommand, PanCommand, PasteCommand, PreviousZoomCommand, PrintCommand, ProjectionCommand, RasterCatalogCreatorCommand, ResetEnvelopeCommand, SaveCommand, SaveConfigurationCommand, SaveImageCommand, SaveSelectionCommand, SaveSVGCommand, ScaleBarCommand, SelectAllCommand, SelectCommand, SelectMultiCommand, ShapeFileProjectorCommand, ShowAttributeCommand, ZoomInCommand, ZoomOutCommand, ZoomToSelectedShapesCommand

public abstract class SimpleCommand
extends javax.swing.AbstractAction
implements Command

A simple command, meant to be subclassed. Creation date: (4/24/2001 1:54:36 PM)

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.AbstractAction
 
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
SimpleCommand()
          Create a new simple command.
SimpleCommand(GISEditor inEditor)
          SimpleCommand constructor comment.
SimpleCommand(java.lang.String inName, javax.swing.Icon inIcon, GISEditor inEditor)
          SimpleCommand constructor comment.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent actionEvent)
          Respond to action events from the action interface
 void execute()
          Execute is called when the button is pressed.
 void executeAlternate(DrawModel inDrawModel)
          Called when the alternate path in the draw model is executed.
 void executeDraw(DrawModel inDrawModel)
          This method is called by the draw model when it has completed it's task.
 GISDisplay getGISDisplay()
          Return the GISDisplay to modify.
 GISEditor getGISEditor()
          Return the GISEditor associated with this command.
protected static javax.swing.Icon getIcon(java.lang.String inName)
          Retrieve an Icon from the Images Directory.
 void removeDraw(DrawModel inDrawModel)
          called when the draw model has been removed
 void setGISDisplay(GISDisplay inGISDisplay)
          Set the GISDisplay to reference for this command.
 void setGISEditor(GISEditor inEditor)
          Set the GISEditor assocated with this command.
 void showError(java.lang.Exception e)
          Show the error to the user
 void showInformation(java.lang.String inTitle, java.lang.String inMessage)
          Show the information message to the user
 
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

SimpleCommand

public SimpleCommand()
Create a new simple command.


SimpleCommand

public SimpleCommand(GISEditor inEditor)
SimpleCommand constructor comment.


SimpleCommand

public SimpleCommand(java.lang.String inName,
                     javax.swing.Icon inIcon,
                     GISEditor inEditor)
SimpleCommand constructor comment.

Method Detail

execute

public void execute()
Execute is called when the button is pressed. When the button is pressed, this method is executed. Typically, it will change the state of the application by setting a draw model, or updating the selected objects or something. If it sets a draw model, it will usually set itself as the target of the drawmodel, so executeDraw will be called when the drawmodel has completed it's task.

Specified by:
execute in interface Command

executeDraw

public void executeDraw(DrawModel inDrawModel)
This method is called by the draw model when it has completed it's task. If the command created a click draw model, then this method is called when the mouse is clicked on the display.

Specified by:
executeDraw in interface Command

executeAlternate

public void executeAlternate(DrawModel inDrawModel)
Called when the alternate path in the draw model is executed. Currently used for sending right click events to the command.


getGISDisplay

public GISDisplay getGISDisplay()
Return the GISDisplay to modify.


setGISDisplay

public void setGISDisplay(GISDisplay inGISDisplay)
Set the GISDisplay to reference for this command.

Specified by:
setGISDisplay in interface Command

getGISEditor

public GISEditor getGISEditor()
Return the GISEditor associated with this command.


removeDraw

public void removeDraw(DrawModel inDrawModel)
called when the draw model has been removed

Specified by:
removeDraw in interface Command

setGISEditor

public void setGISEditor(GISEditor inEditor)
Set the GISEditor assocated with this command.


showInformation

public void showInformation(java.lang.String inTitle,
                            java.lang.String inMessage)
Show the information message to the user


showError

public void showError(java.lang.Exception e)
Show the error to the user


getIcon

protected static javax.swing.Icon getIcon(java.lang.String inName)
Retrieve an Icon from the Images Directory.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent actionEvent)
Respond to action events from the action interface

Specified by:
actionPerformed in interface java.awt.event.ActionListener