Package snap.props

Class Undoer

All Implemented Interfaces:
PropChange.DoChange

public class Undoer extends PropObject
Undoer - this object manages undo by keeping lists of property changes.
  • Field Details

  • Constructor Details

    • Undoer

      public Undoer()
      Constructor.
  • Method Details

    • getActiveUndoSet

      public UndoSet getActiveUndoSet()
      Returns the active undo set.
    • setUndoTitle

      public void setUndoTitle(String aString)
      Sets the title of the current undo.
    • getUndoSets

      public List<UndoSet> getUndoSets()
      Returns the list of undo sets.
    • getRedoSets

      public List<UndoSet> getRedoSets()
      Returns the list of redo sets.
    • getUndoSetLast

      public UndoSet getUndoSetLast()
      Returns the last undo.
    • getRedoSetLast

      public UndoSet getRedoSetLast()
      Returns the last redo.
    • setAutoSave

      public void setAutoSave(boolean aValue)
      Sets whether to auto save changes.
    • setUndoSelection

      public void setUndoSelection(Object aList)
      Sets the list of objects that should be selected after current undo is fired.
    • getRedoSelection

      public Object getRedoSelection()
      Returns the list of objects that should be selected after current undo is redone.
    • setRedoSelection

      public void setRedoSelection(Object aList)
      Sets the list of objects that should be selected after current undo is redone.
    • addPropChange

      public void addPropChange(PropChange propChange)
      Adds a property change.
    • saveChanges

      public void saveChanges()
      Pushes current undo record on the stack and opens new one.
    • undo

      public UndoSet undo()
      Pops last undo set off stack and has it update all changed objects it contains.
    • redo

      public UndoSet redo()
      Pops last redo set off stack and has it update all changed objects it contains.
    • isEnabled

      public boolean isEnabled()
      Returns whether undoer is disabled.
    • disable

      public void disable()
      Disables undoer so it can receive new changes.
    • enable

      public void enable()
      Enables undoer.
    • reset

      public void reset()
      Resets the undoer to its initial state (good to do when a document is saved).
    • hasUndos

      public boolean hasUndos()
      Returns whether undoer has Undo changes stored away.
    • hasRedos

      public boolean hasRedos()
      Returns whether undoer has Redo changes stored away.
    • isUndoAvailable

      public boolean isUndoAvailable()
      Returns whether an undo is available.
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class PropObject