com.rolemodelsoft.drawlet.jfc
Class CanvasAction

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--com.rolemodelsoft.drawlet.jfc.CanvasAction

public class CanvasAction
extends javax.swing.AbstractAction

Basically this class is used to invoke actions on the canvas (ex. copy, paste etc...).

See Also:
Serialized Form

Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Constructor Summary
CanvasAction()
          Creates a new, default CanvasToolAction.
CanvasAction(java.lang.String name)
          Creates a new CanvasToolAction and initializes it with the given name.
CanvasAction(java.lang.String name, DrawingCanvas canvas, java.lang.String action)
          Create a CanvasToolAction which will set the canvases tool when performed.
CanvasAction(java.lang.String name, javax.swing.Icon icon)
          Creates a new CanvasToolAction and initializes it with the given name and icon.
CanvasAction(java.lang.String name, javax.swing.Icon icon)
          Creates a new CanvasToolAction and initializes it with the given name and icon.
CanvasAction(java.lang.String name, javax.swing.Icon icon, DrawingCanvas canvas, java.lang.String action)
          Create a CanvasToolAction which will set the canvases tool when performed.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Set the tool of the canvas.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CanvasAction

public CanvasAction()
Creates a new, default CanvasToolAction.

CanvasAction

public CanvasAction(java.lang.String name)
Creates a new CanvasToolAction and initializes it with the given name.
Parameters:
name - a String representing the name.

CanvasAction

public CanvasAction(java.lang.String name,
                    DrawingCanvas canvas,
                    java.lang.String action)
Create a CanvasToolAction which will set the canvases tool when performed.
Parameters:
name - the name for the action
canvas - the canvas to set the tool for
tool - the tool to have the canvas use

CanvasAction

public CanvasAction(java.lang.String name,
                    javax.swing.Icon icon)
Creates a new CanvasToolAction and initializes it with the given name and icon.
Parameters:
name - the name for this action
icon - the icon

CanvasAction

public CanvasAction(java.lang.String name,
                    javax.swing.Icon icon)
Creates a new CanvasToolAction and initializes it with the given name and icon.
Parameters:
name - the name for this action
icon - the icon

CanvasAction

public CanvasAction(java.lang.String name,
                    javax.swing.Icon icon,
                    DrawingCanvas canvas,
                    java.lang.String action)
Create a CanvasToolAction which will set the canvases tool when performed.
Parameters:
name - the name for this action
icon - the icon
canvas - the canvas to set the tool for
tool - the tool to have the canvas use
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Set the tool of the canvas.
Overrides:
actionPerformed in class javax.swing.AbstractAction
Parameters:
e - the event