dsto.dfc.swing.panels
Class FloatStateEdit

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

public class FloatStateEdit
extends PropertyEditBean

Edit to represent a change in floating status, customised from the PropertyEdit for its display name.

Version:
$Revision$
Author:
Peter J Smet
See Also:
Serialized Form

Field Summary
protected  int panelIndex
           
protected  PanelManager panelManager
           
protected  String panelName
           
 
Fields inherited from class dsto.dfc.swing.undo.PropertyEdit
newValue, oldValue, propertyName, source
 
Fields inherited from class dsto.dfc.swing.undo.AbstractMonitoredEdit
alive, ICON, parameterNames, parameterValues
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Fields inherited from interface dsto.dfc.swing.icons.Iconic
NULL_ICON
 
Constructor Summary
FloatStateEdit()
          For bean serialisation only
FloatStateEdit(PanelManager panelManager, int panelIndex, String oldState, String newState)
           
 
Method Summary
 boolean canRedo()
           
 boolean canUndo()
           
 String getDescription()
          Returns a description of this type of UndoableEdit.
 Icon getIcon()
          The small (16x16) icon for the object.
protected  String getNameForPanelType()
           
 int getPanelIndex()
           
 String getPanelName()
           
 String getPresentationName()
          Returns a presentation name of the form:
 Object getSource()
          Overridden to prevent PanelManager.Panel serialisation attempt.
 void redo()
          Sets the PropertyEdit.source's propertyName value to newValue.
 void restoreContext(HashMap context)
           
 void setPanelIndex(int newPanelIndex)
           
 void setPanelName(String newPanelName)
           
 void setSource(Object newSource)
          Overridden to prevent PanelManager.Panel serialisation attempt.
 void undo()
          Sets the PropertyEdit.source's propertyName value to oldValue.
protected  void writeSource(ObjectOutputStream out)
          Override this method if your PropertyEdit.source is not serialisable.
 
Methods inherited from class dsto.dfc.swing.undo.PropertyEditBean
getNewValue, getOldValue, setNewValue, setOldValue
 
Methods inherited from class dsto.dfc.swing.undo.PropertyEdit
getPropertyName, getRedoPresentationName, getUndoPresentationName, setPropertyName, setPropertyValue, writeValue
 
Methods inherited from class dsto.dfc.swing.undo.AbstractMonitoredEdit
clone, die, getLargeIcon, getName, getParameterNames, getParameterValues, setParameterNames, setParameterValues
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, 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, isSignificant, replaceEdit
 

Field Detail

panelManager

protected transient PanelManager panelManager

panelIndex

protected int panelIndex

panelName

protected String panelName
Constructor Detail

FloatStateEdit

public FloatStateEdit()
For bean serialisation only


FloatStateEdit

public FloatStateEdit(PanelManager panelManager,
                      int panelIndex,
                      String oldState,
                      String newState)
Method Detail

getSource

public Object getSource()
Overridden to prevent PanelManager.Panel serialisation attempt.

Overrides:
getSource in class PropertyEditBean

setSource

public void setSource(Object newSource)
Overridden to prevent PanelManager.Panel serialisation attempt.

Overrides:
setSource in class PropertyEditBean

setPanelIndex

public void setPanelIndex(int newPanelIndex)

getPanelIndex

public int getPanelIndex()

setPanelName

public void setPanelName(String newPanelName)

getPanelName

public String getPanelName()

getDescription

public String getDescription()
Description copied from class: PropertyEdit
Returns a description of this type of UndoableEdit.

Specified by:
getDescription in interface MonitoredEdit
Overrides:
getDescription in class PropertyEditBean

undo

public void undo()
Description copied from class: PropertyEdit
Sets the PropertyEdit.source's propertyName value to oldValue.

Specified by:
undo in interface UndoableEdit
Overrides:
undo in class PropertyEdit

redo

public void redo()
Description copied from class: PropertyEdit
Sets the PropertyEdit.source's propertyName value to newValue.

Specified by:
redo in interface UndoableEdit
Overrides:
redo in class PropertyEdit

canUndo

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

canRedo

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

getPresentationName

public String getPresentationName()
Description copied from class: PropertyEdit
Returns a presentation name of the form:
   "PropertyEdit.source " change " PropertyEdit.propertyName [PropertyEdit.oldValue} -> PropertyEdit.newValue]@quot;
 
If the Object.toString() methods of the PropertyEdit.source, PropertyEdit.oldValue, or PropertyEdit.newValue are memory references, then their class name is displayed instead for readability purposes.

Specified by:
getPresentationName in interface UndoableEdit
Overrides:
getPresentationName in class PropertyEdit

getNameForPanelType

protected String getNameForPanelType()

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
Overrides:
getIcon in class AbstractMonitoredEdit

restoreContext

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

writeSource

protected void writeSource(ObjectOutputStream out)
                    throws IOException
Description copied from class: PropertyEdit
Override this method if your PropertyEdit.source is not serialisable. Make sure that only one Object is written to the out stream, however.

Overrides:
writeSource in class PropertyEdit
Throws:
IOException


Copyright © 2008 Commonwealth of Australia