ptolemy.vergil.gt
Class GTFrameTools.DelegatedUndoStackAttribute

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.util.Attribute
          extended by ptolemy.kernel.util.SingletonAttribute
              extended by ptolemy.kernel.undo.UndoStackAttribute
                  extended by ptolemy.vergil.gt.GTFrameTools.DelegatedUndoStackAttribute
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable, Singleton
Enclosing class:
GTFrameTools

public static class GTFrameTools.DelegatedUndoStackAttribute
extends UndoStackAttribute

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
private  UndoStackAttribute _oldAttribute
           
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
GTFrameTools.DelegatedUndoStackAttribute(NamedObj container, java.lang.String name, UndoStackAttribute oldAttribute)
           
 
Method Summary
 void mergeTopTwo()
          Merge the top two undo entries into a single action, unless we are in either a redo or an undo, in which case the merge happens automatically and need not be explicitly requested by the client.
 void push(UndoAction action)
          Push an action to the undo stack, or if we are executing an undo, onto the redo stack.
 void redo()
          Remove the top redo action and execute it.
 void undo()
          Remove the top undo action and execute it.
 
Methods inherited from class ptolemy.kernel.undo.UndoStackAttribute
getUndoInfo
 
Methods inherited from class ptolemy.kernel.util.SingletonAttribute
setContainer
 
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_oldAttribute

private UndoStackAttribute _oldAttribute
Constructor Detail

GTFrameTools.DelegatedUndoStackAttribute

public GTFrameTools.DelegatedUndoStackAttribute(NamedObj container,
                                                java.lang.String name,
                                                UndoStackAttribute oldAttribute)
                                         throws IllegalActionException,
                                                NameDuplicationException
Throws:
IllegalActionException
NameDuplicationException
Method Detail

mergeTopTwo

public void mergeTopTwo()
Description copied from class: UndoStackAttribute
Merge the top two undo entries into a single action, unless we are in either a redo or an undo, in which case the merge happens automatically and need not be explicitly requested by the client. If there are fewer than two entries on the stack, do nothing. Note that when two entries are merged, the one on the top of the stack becomes the first one executed and the one below that on the stack becomes the second one executed. This method gets write access on the workspace.

Overrides:
mergeTopTwo in class UndoStackAttribute

push

public void push(UndoAction action)
Description copied from class: UndoStackAttribute
Push an action to the undo stack, or if we are executing an undo, onto the redo stack. This method gets write access on the workspace.

Overrides:
push in class UndoStackAttribute
Parameters:
action - The undo action.

redo

public void redo()
          throws java.lang.Exception
Description copied from class: UndoStackAttribute
Remove the top redo action and execute it. If there are no redo entries, do nothing. This method gets write access on the workspace.

Overrides:
redo in class UndoStackAttribute
Throws:
java.lang.Exception - If something goes wrong.

undo

public void undo()
          throws java.lang.Exception
Description copied from class: UndoStackAttribute
Remove the top undo action and execute it. If there are no undo entries, do nothing. This method gets write access on the workspace.

Overrides:
undo in class UndoStackAttribute
Throws:
java.lang.Exception - If something goes wrong.