edu.neu.ccs.gui
Class PaintAction
java.lang.Object
javax.swing.AbstractAction
edu.neu.ccs.gui.PaintAction
- All Implemented Interfaces:
- Action, ActionListener, Cloneable, EventListener, Serializable
- public abstract class PaintAction
- extends AbstractAction
Encapsulates an action that is performed
as a result of a call to paint a component.
- Since:
- 2.2
- Version:
- 2.2
- See Also:
- Serialized Form
|
Constructor Summary |
PaintAction()
Constructs a repaint action with no name or icon. |
PaintAction(String name)
Constructs a repaint action with the given name but no icon. |
PaintAction(String name,
Icon icon)
Constructs a repaint action with the given name and icon. |
PaintAction
public PaintAction()
- Constructs a repaint action with no name or icon.
PaintAction
public PaintAction(String name)
- Constructs a repaint action with the given name but no icon.
- Parameters:
name - the name for this action
PaintAction
public PaintAction(String name,
Icon icon)
- Constructs a repaint 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
paint
method of this class.
If the given event is not a
PaintActionEvent,
this action is not performed.
- Parameters:
evt - an object encapsulating an event
that triggered this action
paint
public abstract void paint(Component c,
Graphics g)
- Performs the tasks encapsulated by this action.
Subclasses should override this method to provide
tasks this action performs.
- Parameters:
c - the component to be paintedg - the graphics context of the component