org.foray.render.awt.viewer
Class Command

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.foray.render.awt.viewer.Command
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public class Command
extends AbstractAction

This class represents UI-commands, which can be used as menu or toolbar items
. When the Command object receives action event, that object's doit method is invoked. doit method by default does nothing and the class customer have to override it to implement any action handling logic.

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, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
Command(PreviewDialog dialog, String name)
          Constructor for no icon.
Command(PreviewDialog dialog, String name, ImageIcon anIcon)
          Constructor for a resolved icon.
Command(PreviewDialog dialog, String name, String iconName)
          Constructor for a named icon.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void doit()
          Action handler which can be overriden by subclasses.
 void undoit()
          Action handler which can be overriden by subclasses.
 
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

Command

public Command(PreviewDialog dialog,
               String name)
Constructor for no icon.

Parameters:
dialog - The parent dialog.
name - The command name.

Command

public Command(PreviewDialog dialog,
               String name,
               ImageIcon anIcon)
Constructor for a resolved icon.

Parameters:
dialog - The parent dialog.
name - The command name.
anIcon - The resolved icon.

Command

public Command(PreviewDialog dialog,
               String name,
               String iconName)
        throws org.axsl.output.OutputException
Constructor for a named icon.

Parameters:
dialog - The parent dialog.
name - The command name.
iconName - The name of the icon to use.
Throws:
org.axsl.output.OutputException - If the icon cannot be found.
Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)

doit

public void doit()
Action handler which can be overriden by subclasses.


undoit

public void undoit()
Action handler which can be overriden by subclasses.



Copyright © 2017. All rights reserved.