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 TypeMethodDescriptionvoid
addListener
(javafx.beans.value.ChangeListener<dk.yalibs.yaundo.Undoable> listener) Add a listener for when the currentUndoable
changesOptional<dk.yalibs.yaundo.Undoable>
javafx.beans.value.ObservableValue<dk.yalibs.yaundo.Undoable>
Get the currentUndoable
observable valueIterable<dk.yalibs.yaundo.Undoable>
Get a list ofObservableUndoable
that represent the undo history, which contains a string representation for pretty printing.void
gotoAction
(dk.yalibs.yaundo.Undoable action) Go to a specificUndoable
action.void
push
(dk.yalibs.yaundo.Undoable action) void
redo()
void
removeListener
(javafx.beans.value.ChangeListener<dk.yalibs.yaundo.Undoable> listener) Remove a listener for when the currentUndoable
changesvoid
undo()
-
Constructor Details
-
ObservableTreeUndoSystem
public ObservableTreeUndoSystem()Constructs a newObservableTreeUndoSystem
instance.
-
-
Method Details
-
getHistory
- Specified by:
getHistory
in interfacedk.yalibs.yaundo.IUndoSystem
-
getCurrentAction
- Specified by:
getCurrentAction
in interfacedk.yalibs.yaundo.IUndoSystem
-
push
public void push(dk.yalibs.yaundo.Undoable action) - Specified by:
push
in interfacedk.yalibs.yaundo.IUndoSystem
-
undo
public void undo()- Specified by:
undo
in interfacedk.yalibs.yaundo.IUndoSystem
-
redo
public void redo()- Specified by:
redo
in interfacedk.yalibs.yaundo.IUndoSystem
-
getCurrentUndoableProperty
public javafx.beans.value.ObservableValue<dk.yalibs.yaundo.Undoable> getCurrentUndoableProperty()Description copied from interface:IObservableUndoSystem
Get the currentUndoable
observable value- Specified by:
getCurrentUndoableProperty
in interfaceIObservableUndoSystem
- Returns:
- The current undoable
-
addListener
public void addListener(javafx.beans.value.ChangeListener<dk.yalibs.yaundo.Undoable> listener) Description copied from interface:IObservableUndoSystem
Add a listener for when the currentUndoable
changes- Specified by:
addListener
in interfaceIObservableUndoSystem
- Parameters:
listener
- The listener to add
-
removeListener
public void removeListener(javafx.beans.value.ChangeListener<dk.yalibs.yaundo.Undoable> listener) Description copied from interface:IObservableUndoSystem
Remove a listener for when the currentUndoable
changes- Specified by:
removeListener
in interfaceIObservableUndoSystem
- Parameters:
listener
- The listener to remove
-
getStringRepresentation
Description copied from interface:IObservableUndoSystem
Get a list ofObservableUndoable
that represent the undo history, which contains a string representation for pretty printing.- Specified by:
getStringRepresentation
in interfaceIObservableUndoSystem
- Returns:
- A list of
ObservableUndoable
-
gotoAction
public void gotoAction(dk.yalibs.yaundo.Undoable action) Description copied from interface:IObservableUndoSystem
Go to a specificUndoable
action. Note that this may trigger many change events.- Specified by:
gotoAction
in interfaceIObservableUndoSystem
- Parameters:
action
- The action to go to
-