Package dk.gtz.graphedit.util
Class ObservableTreeUndoSystem
java.lang.Object
dk.gtz.graphedit.util.ObservableTreeUndoSystem
- All Implemented Interfaces:
IObservableUndoSystem,dk.yalibs.yaundo.IUndoSystem
An implementation of the
IObservableUndoSystem interface that uses a tree structure to store the undo history.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(javafx.beans.value.ChangeListener<dk.yalibs.yaundo.Undoable> listener) Add a listener for when the currentUndoablechangesOptional<dk.yalibs.yaundo.Undoable>javafx.beans.value.ObservableValue<dk.yalibs.yaundo.Undoable>Get the currentUndoableobservable valueIterable<dk.yalibs.yaundo.Undoable>Get a list ofObservableUndoablethat represent the undo history, which contains a string representation for pretty printing.voidgotoAction(dk.yalibs.yaundo.Undoable action) Go to a specificUndoableaction.voidpush(dk.yalibs.yaundo.Undoable action) voidredo()voidremoveListener(javafx.beans.value.ChangeListener<dk.yalibs.yaundo.Undoable> listener) Remove a listener for when the currentUndoablechangesvoidundo()
-
Constructor Details
-
ObservableTreeUndoSystem
public ObservableTreeUndoSystem()Constructs a newObservableTreeUndoSysteminstance.
-
-
Method Details
-
getHistory
- Specified by:
getHistoryin interfacedk.yalibs.yaundo.IUndoSystem
-
getCurrentAction
- Specified by:
getCurrentActionin interfacedk.yalibs.yaundo.IUndoSystem
-
push
public void push(dk.yalibs.yaundo.Undoable action) - Specified by:
pushin interfacedk.yalibs.yaundo.IUndoSystem
-
undo
public void undo()- Specified by:
undoin interfacedk.yalibs.yaundo.IUndoSystem
-
redo
public void redo()- Specified by:
redoin interfacedk.yalibs.yaundo.IUndoSystem
-
getCurrentUndoableProperty
public javafx.beans.value.ObservableValue<dk.yalibs.yaundo.Undoable> getCurrentUndoableProperty()Description copied from interface:IObservableUndoSystemGet the currentUndoableobservable value- Specified by:
getCurrentUndoablePropertyin interfaceIObservableUndoSystem- Returns:
- The current undoable
-
addListener
public void addListener(javafx.beans.value.ChangeListener<dk.yalibs.yaundo.Undoable> listener) Description copied from interface:IObservableUndoSystemAdd a listener for when the currentUndoablechanges- Specified by:
addListenerin interfaceIObservableUndoSystem- Parameters:
listener- The listener to add
-
removeListener
public void removeListener(javafx.beans.value.ChangeListener<dk.yalibs.yaundo.Undoable> listener) Description copied from interface:IObservableUndoSystemRemove a listener for when the currentUndoablechanges- Specified by:
removeListenerin interfaceIObservableUndoSystem- Parameters:
listener- The listener to remove
-
getStringRepresentation
Description copied from interface:IObservableUndoSystemGet a list ofObservableUndoablethat represent the undo history, which contains a string representation for pretty printing.- Specified by:
getStringRepresentationin interfaceIObservableUndoSystem- Returns:
- A list of
ObservableUndoable
-
gotoAction
public void gotoAction(dk.yalibs.yaundo.Undoable action) Description copied from interface:IObservableUndoSystemGo to a specificUndoableaction. Note that this may trigger many change events.- Specified by:
gotoActionin interfaceIObservableUndoSystem- Parameters:
action- The action to go to
-