Constructs a new undo manager with the given history size. If no history size is given, then a default size of 100 steps is used.
Variable: eventListeners
Holds the event names and associated listeners in an array. The array contains the event name followed by the respective listener for each registered listener.
Variable: eventSource
Optional source for events. Default is null.
Variable: eventsEnabled
Specifies if events can be fired. Default is true.
Array that contains the steps of the command history.
Index of the element to be added next.
Maximum command history size. 0 means unlimited history. Default is 100.
Function: addListener
Binds the specified function to the given event name. If no event name is given, then the listener is registered for all events.
The parameters of the listener are the sender and an
Returns true if a redo is possible.
Returns true if an undo is possible.
Clears the command history.
Function: fireEvent
Dispatches the given event to the listeners which are registered for the event. The sender argument is optional. The current execution scope ("this") is used for the listener invocation (see <mxUtils.bind>).
Example:
(code) fireEvent(new mxEventObject("eventName", key1, val1, .., keyN, valN)) (end)
Parameters:
evt -
Function: getEventSource
Returns
Returns true if the history is empty.
Function: isEventsEnabled
Returns
Redoes the last change.
Function: removeListener
Removes all occurrences of the given listener from
Function: setEventSource
Sets
Function: setEventsEnabled
Sets
Removes all pending steps after
Undoes the last change.
Method to be called to add new undoable edits to the
Generated using TypeDoc
The code creates a function that informs the undoManager of an undoable edit and binds it to the undo event of mxGraphModel and mxGraphView using mxEventSource.addListener.
Event: mxEvent.CLEAR
Fires after clear was invoked. This event has no properties.
Event: mxEvent.UNDO
Fires afer a significant edit was undone in undo. The
edit
property contains the mxUndoableEdit that was undone.Event: mxEvent.REDO
Fires afer a significant edit was redone in redo. The
edit
property contains the mxUndoableEdit that was redone.Event: mxEvent.ADD
Fires after an undoable edit was added to the history. The
edit
property contains the mxUndoableEdit that was added.