jcreek.cke.command
Class UndoAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byjcreek.cke.command.UndoAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable

public class UndoAction
extends javax.swing.AbstractAction

Implements the undo action used to backout a recent change made to the graph.

Version:
Author:
See Also:
Serialized Form

Field Summary
protected  javax.swing.undo.UndoManager undo
          The undo manager we belong to.
 
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
UndoAction()
          Creates a new UndoAction object with the default action command string of "undo".
UndoAction(javax.swing.undo.UndoManager undo)
          Creates a new UndoAction object with the default action command string of "undo".
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Performs the undo action.
 void setManager(javax.swing.undo.UndoManager undo)
          Sets the undo manager for this action to the one given.
 void update()
          Checks if we can undo an event or not and sets this action enabled appropriately.
 
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
 

Field Detail

undo

protected javax.swing.undo.UndoManager undo
The undo manager we belong to.

Constructor Detail

UndoAction

public UndoAction()
Creates a new UndoAction object with the default action command string of "undo". Sets the action initially disabled.


UndoAction

public UndoAction(javax.swing.undo.UndoManager undo)
Creates a new UndoAction object with the default action command string of "undo". Sets the action initially disabled.

Parameters:
undo - undo manager that tells us if we can be performed or not
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Performs the undo action.

Parameters:
e - action event

setManager

public void setManager(javax.swing.undo.UndoManager undo)
Sets the undo manager for this action to the one given.

Parameters:
undo - undo manager that tells us if we can be performed or not

update

public void update()
Checks if we can undo an event or not and sets this action enabled appropriately.



Created at IDI, NTNU by the Artificial Intelligence and Learning group