be.ugent.caagt.swirl.undoredo
Class UndoRedoAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by be.ugent.caagt.swirl.actions.SimpleAction
          extended by be.ugent.caagt.swirl.undoredo.UndoRedoAction
All Implemented Interfaces:
UndoListener, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
RedoAction, UndoAction

public abstract class UndoRedoAction
extends SimpleAction
implements UndoListener

Common super class for UndoAction and RedoAction

See Also:
Serialized Form

Field Summary
protected  UndoManager manager
           
 
Fields inherited from class be.ugent.caagt.swirl.actions.SimpleAction
MEDIUM_DISABLED_ICON, MEDIUM_ICON, SMALL_DISABLED_ICON, TOGGLE_BUTTON_MODEL
 
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
protected UndoRedoAction(UndoManager manager, java.util.ResourceBundle bundle, java.lang.String key, javax.swing.Icon icon, javax.swing.Icon mediumIcon, javax.swing.Icon mediumDisabledIcon)
          Create an action of this type with the given parameters
 
Method Summary
protected abstract  java.lang.String getCaption()
          Obtain the correct caption from the manager.
 void putValue(java.lang.String key, java.lang.Object newValue)
          Overridden to set the disabled caption from the first caption set.
 void setEnabled(boolean newValue)
          Enables/disables the action and changes the caption accordingly.
 
Methods inherited from class be.ugent.caagt.swirl.actions.SimpleAction
actionPerformed, setMediumDisabledIcon, setMediumIcon, setSharedToggleButtonModel, setSmallDisabledIcon
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface be.ugent.caagt.swirl.undoredo.UndoListener
undoStateChanged
 

Field Detail

manager

protected final UndoManager manager
Constructor Detail

UndoRedoAction

protected UndoRedoAction(UndoManager manager,
                         java.util.ResourceBundle bundle,
                         java.lang.String key,
                         javax.swing.Icon icon,
                         javax.swing.Icon mediumIcon,
                         javax.swing.Icon mediumDisabledIcon)
Create an action of this type with the given parameters

Method Detail

setEnabled

public void setEnabled(boolean newValue)
Enables/disables the action and changes the caption accordingly.

Specified by:
setEnabled in interface javax.swing.Action
Overrides:
setEnabled in class javax.swing.AbstractAction

putValue

public void putValue(java.lang.String key,
                     java.lang.Object newValue)
Overridden to set the disabled caption from the first caption set.

Specified by:
putValue in interface javax.swing.Action
Overrides:
putValue in class javax.swing.AbstractAction
Parameters:
key -
newValue -

getCaption

protected abstract java.lang.String getCaption()
Obtain the correct caption from the manager.