edu.neu.ccs.gui
Class ComponentAction
java.lang.Object
javax.swing.AbstractAction
edu.neu.ccs.gui.ComponentAction
- All Implemented Interfaces:
- Action, ActionListener, Cloneable, EventListener, Serializable
- public abstract class ComponentAction
- extends AbstractAction
Encapsulates an action that is performed as a result
of a ComponentEvent.
- Since:
- 2.2
- Version:
- 2.2
- See Also:
- Serialized Form
ComponentAction
public ComponentAction()
- Constructs a component action with no name or icon.
ComponentAction
public ComponentAction(String name)
- Constructs a component action with the given name but no icon.
- Parameters:
name - the name for this action
ComponentAction
public ComponentAction(String name,
Icon icon)
- Constructs a component action with the given name and icon.
- Parameters:
name - the name for this actionicon - the icon for this action
actionPerformed
public final void actionPerformed(ActionEvent evt)
- Performs this action by calling the
componentActionPerformed method of this class
intended to perform tasks requiring information
contained in the ComponentEvent
triggering this action.
If the given event is not a
ComponentActionEvent,
this action is not performed.
- Parameters:
evt - an object encapsulating an event
that triggered this action
componentActionPerformed
public abstract void componentActionPerformed(ComponentEvent cevt)
- Performs the tasks encapsulated by this action.
Subclasses should override this method to provide
tasks this action performs.
- Parameters:
cevt - the component event that triggered this action