Package snap.props
Class Undoer
java.lang.Object
snap.props.PropObject
snap.props.Undoer
- All Implemented Interfaces:
PropChange.DoChange
Undoer - this object manages undo by keeping lists of property changes.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
An interface for undo/redo selection. -
Field Summary
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropChange
(PropChange propChange) Adds a property change.void
disable()
Disables undoer so it can receive new changes.void
enable()
Enables undoer.Returns the active undo set.Returns the list of objects that should be selected after current undo is redone.Returns the last redo.Returns the list of redo sets.Returns the last undo.Returns the list of undo sets.boolean
hasRedos()
Returns whether undoer has Redo changes stored away.boolean
hasUndos()
Returns whether undoer has Undo changes stored away.boolean
Returns whether undoer is disabled.boolean
Returns whether an undo is available.redo()
Pops last redo set off stack and has it update all changed objects it contains.void
reset()
Resets the undoer to its initial state (good to do when a document is saved).void
Pushes current undo record on the stack and opens new one.void
setAutoSave
(boolean aValue) Sets whether to auto save changes.void
setRedoSelection
(Object aList) Sets the list of objects that should be selected after current undo is redone.void
setUndoSelection
(Object aList) Sets the list of objects that should be selected after current undo is fired.void
setUndoTitle
(String aString) Sets the title of the current undo.toString()
Standard toString implementation.undo()
Pops last undo set off stack and has it update all changed objects it contains.Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, clone, firePropChange, firePropChange, firePropChange, getPropDefault, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, getPropValue, initProps, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropsString, setPropValue, setPropValues, toStringProps
-
Field Details
-
UndoAvailable_Prop
- See Also:
-
DISABLED_UNDOER
-
-
Constructor Details
-
Undoer
public Undoer()Constructor.
-
-
Method Details
-
getActiveUndoSet
Returns the active undo set. -
setUndoTitle
Sets the title of the current undo. -
getUndoSets
Returns the list of undo sets. -
getRedoSets
Returns the list of redo sets. -
getUndoSetLast
Returns the last undo. -
getRedoSetLast
Returns the last redo. -
setAutoSave
public void setAutoSave(boolean aValue) Sets whether to auto save changes. -
setUndoSelection
Sets the list of objects that should be selected after current undo is fired. -
getRedoSelection
Returns the list of objects that should be selected after current undo is redone. -
setRedoSelection
Sets the list of objects that should be selected after current undo is redone. -
addPropChange
Adds a property change. -
saveChanges
public void saveChanges()Pushes current undo record on the stack and opens new one. -
undo
Pops last undo set off stack and has it update all changed objects it contains. -
redo
Pops last redo set off stack and has it update all changed objects it contains. -
isEnabled
public boolean isEnabled()Returns whether undoer is disabled. -
disable
public void disable()Disables undoer so it can receive new changes. -
enable
public void enable()Enables undoer. -
reset
public void reset()Resets the undoer to its initial state (good to do when a document is saved). -
hasUndos
public boolean hasUndos()Returns whether undoer has Undo changes stored away. -
hasRedos
public boolean hasRedos()Returns whether undoer has Redo changes stored away. -
isUndoAvailable
public boolean isUndoAvailable()Returns whether an undo is available. -
toString
Standard toString implementation.- Overrides:
toString
in classPropObject
-