Class RMUndoer
- All Implemented Interfaces:
- RMArchiver.Archiving,- Cloneable
Call: undoer.addDirtyObject(this) - This registers and objects for possible change Implement: undoClone() or clone() - A typical clone implementation should do, except that all relationship objects should be copied deep unless they also register with addDirtyObject(). Objects are copied the first time they are sent to addDirtyObject(). Implement: undoEquals() or equals() - A typical equals implementation should do. At the end of the current event, objects that end up being equal to their registered clone are trimmed to avoid unecessary archival (and no-op undo events). Implement: undoCopy(anObj) or copy(anObj) - This method should restore the state of an object from its registered clone. All relationship objects should be copied deep, unless they also register with addDirtyObject().
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classThis class reprents a distinct "undoable event".
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddDirtyObject(RMObject anObj) Adds the given object to the current undo record.allUndos()Returns all undos (including the current one, if changes are pending).voiddisable()Disables undoer so it can receive new changes.voidenable()Enables undoer.booleanReturns whether undoer coalesces changes.intReturns the number of dirty objects in the current undo record.intReturns whether undoer is disabled.Returns most recent undo event.Returns the next redo event.Returns the last redo.Returns the list of objects that should be selected after current undo is redone.Returns the next undo event.Returns the last undo.Returns the list of objects that should be selected after current undo is fired.booleanhasUndos()Returns whether undoer has undoable changes stored away.booleanisBenignChange(String aString) Returns whether a given change doesn't really effect signficant state change.booleanisDuplicate(String aTitle, RMObject anObj) Returns whether given title is title of last undo.voidredo()Pops last redo event off stack and has it update all changed objects it contains.redos()Returns the list of redos.voidreset()Resets the undoer to its initial state (good to do when a document is saved).voidPushes current undo record on the stack and opens new one.voidsetCoalesce(boolean aFlag) Sets whether undoer coalesces changes.voidsetDisabled(int aValue) Sets whether undoer is disabled.voidsetRedoSelectedObjects(List aList) Sets the list of objects that should be selected after current undo is redone.voidsetUndoSelectedObjects(List aList) Sets the list of objects that should be selected after current undo is fired.voidsetUndoTitle(String aString) Sets the title of the current undo.voidundo()Pops last undo event off stack an has it update all changed objects it contains.undos()Returns the list of undos.Methods inherited from class com.reportmill.base.RMObjectclone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
- 
Constructor Details- 
RMUndoerpublic RMUndoer()Creates a new undoer.
 
- 
- 
Method Details- 
getDirtyObjectCountpublic int getDirtyObjectCount()Returns the number of dirty objects in the current undo record.
- 
addDirtyObjectAdds the given object to the current undo record.
- 
saveChangespublic void saveChanges()Pushes current undo record on the stack and opens new one.
- 
undopublic void undo()Pops last undo event off stack an has it update all changed objects it contains.
- 
redopublic void redo()Pops last redo event off stack and has it update all changed objects it contains.
- 
disablepublic void disable()Disables undoer so it can receive new changes.
- 
enablepublic void enable()Enables undoer.
- 
getDisabledpublic int getDisabled()Returns whether undoer is disabled.
- 
setDisabledpublic void setDisabled(int aValue) Sets whether undoer is disabled.
- 
getCoalescepublic boolean getCoalesce()Returns whether undoer coalesces changes.
- 
setCoalescepublic void setCoalesce(boolean aFlag) Sets whether undoer coalesces changes.
- 
getRecentUndoReturns most recent undo event.
- 
resetpublic void reset()Resets the undoer to its initial state (good to do when a document is saved).
- 
isBenignChangeReturns whether a given change doesn't really effect signficant state change.
- 
hasUndospublic boolean hasUndos()Returns whether undoer has undoable changes stored away.
- 
getUndoEventReturns the next undo event.
- 
getRedoEventReturns the next redo event.
- 
setUndoTitleSets the title of the current undo.
- 
undosReturns the list of undos.
- 
redosReturns the list of redos.
- 
getUndoLastReturns the last undo.
- 
getRedoLastReturns the last redo.
- 
allUndosReturns all undos (including the current one, if changes are pending).
- 
getUndoSelectedObjectsReturns the list of objects that should be selected after current undo is fired.
- 
setUndoSelectedObjectsSets the list of objects that should be selected after current undo is fired.
- 
getRedoSelectedObjectsReturns the list of objects that should be selected after current undo is redone.
- 
setRedoSelectedObjectsSets the list of objects that should be selected after current undo is redone.
- 
isDuplicateReturns whether given title is title of last undo.
 
-