dsto.dfc.swing.panels
Class ActivePanelEdit

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.ActivePanelEdit
All Implemented Interfaces:
Iconic, MonitoredEdit, Restorable, Copyable, Serializable, Cloneable, UndoableEdit

public class ActivePanelEdit
extends PropertyEditBean

Edit for changing the active panel of the PanelManager. Checks for invalid panels.

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

Field Summary
protected  String newActivePanelName
           
protected  String oldActivePanelName
           
static boolean PANELS_UNLOCKED
           
 
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
ActivePanelEdit()
          For bean serialisation only
ActivePanelEdit(PanelManager panelManager, int oldActivePanelIndex, int newActivePanelIndex)
           
 
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.
 String getNameForPanelType()
           
 String getNewActivePanelName()
           
 String getOldActivePanelName()
           
 String getPresentationName()
          Returns a presentation name of the form:
 Object getSource()
          Overridden to prevent PanelManager.Panel serialisation attempt.
 String nameForPanelAt(Object index)
           
 boolean panelsUnlocked()
           
 void redo()
          Sets the PropertyEdit.source's propertyName value to newValue.
 void restoreContext(HashMap context)
           
 void setNewActivePanelName(String name)
           
 void setOldActivePanelName(String name)
           
 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

PANELS_UNLOCKED

public static boolean PANELS_UNLOCKED

oldActivePanelName

protected String oldActivePanelName

newActivePanelName

protected String newActivePanelName
Constructor Detail

ActivePanelEdit

public ActivePanelEdit()
For bean serialisation only


ActivePanelEdit

public ActivePanelEdit(PanelManager panelManager,
                       int oldActivePanelIndex,
                       int newActivePanelIndex)
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

getOldActivePanelName

public String getOldActivePanelName()

setOldActivePanelName

public void setOldActivePanelName(String name)

getNewActivePanelName

public String getNewActivePanelName()

setNewActivePanelName

public void setNewActivePanelName(String name)

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

nameForPanelAt

public String nameForPanelAt(Object index)

getNameForPanelType

public String getNameForPanelType()

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

panelsUnlocked

public boolean panelsUnlocked()

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

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