A Transaction holds a list of ChangedEvents collected during a transaction, as the value of the read-only #changes} property.
The constructor produces an empty UndoManager with no transaction history.
Gets the current Transaction for recording additional model change events.
Gets the index into #history for the current undoable Transaction.
Gets the whole history, a list of all of the Transactions, each representing a transaction with some number of ChangedEvents.
Gets or sets whether this UndoManager records any changes.
This property is true after the first call to #startTransaction and before a corresponding call to #commitTransaction or #rollbackTransaction.
This property is true during a call to #undo or #redo.
Gets or sets the maximum number of transactions that this undo manager will remember.
Gets an iterator for all of the Models that this UndoManager is handling.
Gets a stack of ongoing transaction names.
Gets the current transaction level.
Gets the Transaction in the #history to be redone next.
Gets the Transaction in the #history to be undone next.
Make sure this UndoManager knows about a Model for which it may receive ChangedEvents when the given Model is changed.
any
This predicate returns true if you can call #redo.
boolean
This predicate returns true if you can call #undo.
boolean
Clear all of the Transactions and clear all other state, including any ongoing transaction without rolling back.
any
Commit the current transaction started by a call to #startTransaction. For convenience, this method is called by Model#commitTransaction and Diagram#commitTransaction. If this call stops a top-level transaction, we mark the #currentTransaction as complete (Transaction#isComplete), we add the Transaction to the #history list, and we return true. Committing a transaction when there have been some undos without corresponding redos will throw away the Transactions holding changes that happened after the current state, before adding the new Transaction to the
a short string describing the transaction.
boolean
Maybe record a ChangedEvent in the #currentTransaction. This calls #skipsEvent to see if this should ignore the change. If #skipsEvent returns false, this creates a copy of the ChangedEvent and adds it to the #currentTransaction. If there is no #currentTransaction, this first creates and remembers it. This method always ignores all changes while performing an #undo or #redo. This method is also a no-op if #isEnabled is false.
a ChangedEvent.
any
Re-perform this object change after an #undo.
any
Inform this UndoManager that it will no longer be receiving ChangedEvents when the given Model is changed. The model will no longer receive notifications about transactions and undo or redo operations. You should not call this method during a transaction. If you call this method between transactions when there is a transaction history, you should be careful that there are no ChangedEvents referring to that model in any Transactions.
A Model that this UndoManager should no longer manage.
any
Rollback the current transaction started by a call to #startTransaction, undoing any changes.
boolean
This predicate is called by #handleChanged to decide if a ChangedEvent is not interesting enough to be remembered. Transactional events (of change type ChangedEvent#Transaction) are always skipped. Changed events for GraphObjects that are in Layer#isTemporary layers are also skipped. Sometimes changed events do not even get to #handleChanged because Model#skipsUndoManager or Diagram#skipsUndoManager is true.
the ChangedEvent received by #handleChanged.
boolean
Begin a transaction, where the changes are held by a Transaction object as the value of #currentTransaction. You must call either #commitTransaction or #rollbackTransaction afterwards. For convenience, this method is called by Model#startTransaction and Diagram#startTransaction. Transactions can be nested. Starting or ending a nested transaction will return false. Nested transactions will share the same Transaction list of ChangedEvents. Starting a transaction will not necessarily cause #currentTransaction to be non-null. A Transaction object is usually only created by #handleChanged when a ChangedEvent first occurs.
a short string describing the transaction.
boolean
Reverse the effects of this object change.
any