dsto.dfc.swing.undo
Class AbstractMonitoredEdit

java.lang.Object
  extended by javax.swing.undo.AbstractUndoableEdit
      extended by dsto.dfc.swing.undo.AbstractMonitoredEdit
All Implemented Interfaces:
Iconic, MonitoredEdit, Restorable, Copyable, Serializable, Cloneable, UndoableEdit
Direct Known Subclasses:
PropertyEdit

public abstract class AbstractMonitoredEdit
extends AbstractUndoableEdit
implements MonitoredEdit

Abstract implementation of the MonitoredEdit interface.

Version:
$Revision$
Author:
Derek Weber
See Also:
Serialized Form

Field Summary
protected  boolean alive
           
static Icon ICON
           
protected  String[] parameterNames
           
protected  Object[] parameterValues
           
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Fields inherited from interface dsto.dfc.swing.icons.Iconic
NULL_ICON
 
Constructor Summary
AbstractMonitoredEdit()
          For bean serialisation only
AbstractMonitoredEdit(String[] parameterNames, Object[] parameterValues)
           
 
Method Summary
 boolean canRedo()
           
 boolean canUndo()
           
 Object clone()
          Create a completely separate copy of this object and any mutable objects owned by the object.
 void die()
           
abstract  String getDescription()
          Returns a human-readable description of what the edit does.
 Icon getIcon()
          The small (16x16) icon for the object.
 Icon getLargeIcon()
          The large (32x32) icon.
 String getName()
          The human-readable name for the object.
 String[] getParameterNames()
          Get the (human readable) names of the parameters to this command.
 Object[] getParameterValues()
          Get the parameter values of this command.
 String getRedoPresentationName()
           
 String getUndoPresentationName()
           
 void redo()
           
 void restoreContext(HashMap context)
           
 void setParameterNames(String[] parameterNames)
           
 void setParameterValues(Object[] parameterValues)
           
 void undo()
           
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, getPresentationName, isSignificant, replaceEdit, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.undo.UndoableEdit
addEdit, getPresentationName, isSignificant, replaceEdit
 

Field Detail

ICON

public static Icon ICON

alive

protected boolean alive

parameterNames

protected String[] parameterNames

parameterValues

protected Object[] parameterValues
Constructor Detail

AbstractMonitoredEdit

public AbstractMonitoredEdit()
For bean serialisation only


AbstractMonitoredEdit

public AbstractMonitoredEdit(String[] parameterNames,
                             Object[] parameterValues)
Method Detail

getParameterNames

public String[] getParameterNames()
Description copied from interface: MonitoredEdit
Get the (human readable) names of the parameters to this command. May be null or empty to indicate no parameters.

Specified by:
getParameterNames in interface MonitoredEdit
See Also:
MonitoredEdit.getParameterValues()

setParameterNames

public void setParameterNames(String[] parameterNames)

getParameterValues

public Object[] getParameterValues()
Description copied from interface: MonitoredEdit
Get the parameter values of this command. May be null or empty to indicate no parameters.

Specified by:
getParameterValues in interface MonitoredEdit
See Also:
MonitoredEdit.getParameterNames()

setParameterValues

public void setParameterValues(Object[] parameterValues)

getUndoPresentationName

public String getUndoPresentationName()
Specified by:
getUndoPresentationName in interface UndoableEdit
Overrides:
getUndoPresentationName in class AbstractUndoableEdit

getRedoPresentationName

public String getRedoPresentationName()
Specified by:
getRedoPresentationName in interface UndoableEdit
Overrides:
getRedoPresentationName in class AbstractUndoableEdit

getDescription

public abstract String getDescription()
Description copied from interface: MonitoredEdit
Returns a human-readable description of what the edit does.

Specified by:
getDescription in interface MonitoredEdit

die

public void die()
Specified by:
die in interface UndoableEdit
Overrides:
die in class AbstractUndoableEdit

undo

public void undo()
          throws CannotUndoException
Specified by:
undo in interface UndoableEdit
Overrides:
undo in class AbstractUndoableEdit
Throws:
CannotUndoException

canUndo

public boolean canUndo()
Specified by:
canUndo in interface UndoableEdit
Overrides:
canUndo in class AbstractUndoableEdit

redo

public void redo()
          throws CannotRedoException
Specified by:
redo in interface UndoableEdit
Overrides:
redo in class AbstractUndoableEdit
Throws:
CannotRedoException

canRedo

public boolean canRedo()
Specified by:
canRedo in interface UndoableEdit
Overrides:
canRedo in class AbstractUndoableEdit

restoreContext

public void restoreContext(HashMap context)
Specified by:
restoreContext in interface Restorable

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from interface: Copyable
Create a completely separate copy of this object and any mutable objects owned by the object.

NOTE: subclasses should not remove the CloneNotSupportedException throws clause if they themselves support subclassing: removing the CloneNotSupportedException declaration stops subclasses from indicating that a clone was not possible.

Specified by:
clone in interface Copyable
Overrides:
clone in class Object
Throws:
CloneNotSupportedException - if the clone failed or is not possible.

getIcon

public Icon getIcon()
Description copied from interface: Iconic
The small (16x16) icon for the object. May be null if no small icon is available.

Specified by:
getIcon in interface Iconic

getName

public String getName()
Description copied from interface: Iconic
The human-readable name for the object.

Specified by:
getName in interface Iconic

getLargeIcon

public Icon getLargeIcon()
Description copied from interface: Iconic
The large (32x32) icon.

Specified by:
getLargeIcon in interface Iconic
Returns:
The large icon, or null if no large icon is available.


Copyright © 2008 Commonwealth of Australia