Package ptolemy.vergil.gt
Class GTFrameTools.DelegatedUndoStackAttribute
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.kernel.util.SingletonAttribute
-
- ptolemy.kernel.undo.UndoStackAttribute
-
- ptolemy.vergil.gt.GTFrameTools.DelegatedUndoStackAttribute
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,Singleton
- Enclosing class:
- GTFrameTools
public static class GTFrameTools.DelegatedUndoStackAttribute extends UndoStackAttribute
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Constructor Description DelegatedUndoStackAttribute(NamedObj container, java.lang.String name, UndoStackAttribute oldAttribute)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, 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, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
-
-
-
Constructor Detail
-
DelegatedUndoStackAttribute
public DelegatedUndoStackAttribute(NamedObj container, java.lang.String name, UndoStackAttribute oldAttribute) 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 classUndoStackAttribute
-
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 classUndoStackAttribute
- 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 classUndoStackAttribute
- 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 classUndoStackAttribute
- Throws:
java.lang.Exception
- If something goes wrong.
-
-