Package dk.gtz.graphedit.util
Class ObservableStackUndoSystem
java.lang.Object
dk.gtz.graphedit.util.ObservableStackUndoSystem
- All Implemented Interfaces:
IObservableUndoSystem,dk.yalibs.yaundo.IUndoSystem
Implementation of an observable undosystem
-
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>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()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dk.gtz.graphedit.util.IObservableUndoSystem
getStringRepresentation
-
Constructor Details
-
ObservableStackUndoSystem
public ObservableStackUndoSystem()Construct a new instance
-
-
Method Details
-
getHistory
- Specified by:
getHistoryin 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
-
getCurrentAction
- Specified by:
getCurrentActionin interfacedk.yalibs.yaundo.IUndoSystem
-
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
-
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
-