Documentation of 'org.jhotdraw.undo.UndoRedoManager' Java class
UndoRedoManager
org.jhotdraw.undo

Class UndoRedoManager

  • All Implemented Interfaces:
    java.io.Serializable, java.util.EventListener, javax.swing.event.UndoableEditListener, javax.swing.undo.UndoableEdit


    public class UndoRedoManager
    extends javax.swing.undo.UndoManager
    Same as javax.swing.UndoManager but provides actions for undo and redo operations.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static javax.swing.undo.UndoableEdit DISCARD_ALL_EDITS
      Sending this UndoableEdit event to the UndoRedoManager disables the Undo and Redo functions of the manager.
    • Constructor Summary

      Constructors 
      Constructor and Description
      UndoRedoManager()
      Creates new UndoRedoManager
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
      If inProgress, inserts anEdit at indexOfNextAdd, and removes any old edits that were at indexOfNextAdd or later.
      void addPropertyChangeListener(java.beans.PropertyChangeListener listener) 
      void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener) 
      void discardAllEdits()
      Discards all edits.
      static ResourceBundleUtil getLabels() 
      javax.swing.Action getRedoAction()
      Gets the redo action for use as a Redo menu item.
      javax.swing.Action getUndoAction()
      Gets the undo action for use as an Undo menu item.
      boolean hasSignificantEdits()
      Returns true if at least one significant UndoableEdit has been added since the last call to discardAllEdits.
      void redo()
      Redoes the last undone edit event.
      void removePropertyChangeListener(java.beans.PropertyChangeListener listener) 
      void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener) 
      void setHasSignificantEdits(boolean newValue) 
      void setLocale(java.util.Locale l) 
      void undo()
      Undoes the last edit event.
      void undoOrRedo()
      Undoes or redoes the last edit event.
      • Methods inherited from class javax.swing.undo.UndoManager

        canRedo, canUndo, canUndoOrRedo, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, setLimit, toString, undoableEditHappened
      • Methods inherited from class javax.swing.undo.CompoundEdit

        die, getPresentationName, isInProgress, isSignificant
      • Methods inherited from class javax.swing.undo.AbstractUndoableEdit

        replaceEdit
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DISCARD_ALL_EDITS

        public static final javax.swing.undo.UndoableEdit DISCARD_ALL_EDITS
        Sending this UndoableEdit event to the UndoRedoManager disables the Undo and Redo functions of the manager.
    • Constructor Detail

      • UndoRedoManager

        public UndoRedoManager()
        Creates new UndoRedoManager
    • Method Detail

      • setLocale

        public void setLocale(java.util.Locale l)
      • discardAllEdits

        public void discardAllEdits()
        Discards all edits.
        Overrides:
        discardAllEdits in class javax.swing.undo.UndoManager
      • setHasSignificantEdits

        public void setHasSignificantEdits(boolean newValue)
      • hasSignificantEdits

        public boolean hasSignificantEdits()
        Returns true if at least one significant UndoableEdit has been added since the last call to discardAllEdits.
      • addEdit

        public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
        If inProgress, inserts anEdit at indexOfNextAdd, and removes any old edits that were at indexOfNextAdd or later. The die method is called on each edit that is removed is sent, in the reverse of the order the edits were added. Updates indexOfNextAdd.

        If not inProgress, acts as a CompoundEdit

        Regardless of inProgress, if undoOrRedoInProgress, calls die on each edit that is sent.

        Specified by:
        addEdit in interface javax.swing.undo.UndoableEdit
        Overrides:
        addEdit in class javax.swing.undo.UndoManager
        See Also:
        CompoundEdit.end(), CompoundEdit.addEdit(javax.swing.undo.UndoableEdit)
      • getUndoAction

        public javax.swing.Action getUndoAction()
        Gets the undo action for use as an Undo menu item.
      • getRedoAction

        public javax.swing.Action getRedoAction()
        Gets the redo action for use as a Redo menu item.
      • undo

        public void undo()
                  throws javax.swing.undo.CannotUndoException
        Undoes the last edit event. The UndoRedoManager ignores all incoming UndoableEdit events, while undo is in progress.
        Specified by:
        undo in interface javax.swing.undo.UndoableEdit
        Overrides:
        undo in class javax.swing.undo.UndoManager
        Throws:
        javax.swing.undo.CannotUndoException
      • redo

        public void redo()
                  throws javax.swing.undo.CannotUndoException
        Redoes the last undone edit event. The UndoRedoManager ignores all incoming UndoableEdit events, while redo is in progress.
        Specified by:
        redo in interface javax.swing.undo.UndoableEdit
        Overrides:
        redo in class javax.swing.undo.UndoManager
        Throws:
        javax.swing.undo.CannotUndoException
      • undoOrRedo

        public void undoOrRedo()
                        throws javax.swing.undo.CannotUndoException,
                               javax.swing.undo.CannotRedoException
        Undoes or redoes the last edit event. The UndoRedoManager ignores all incoming UndoableEdit events, while undo or redo is in progress.
        Overrides:
        undoOrRedo in class javax.swing.undo.UndoManager
        Throws:
        javax.swing.undo.CannotUndoException
        javax.swing.undo.CannotRedoException
      • addPropertyChangeListener

        public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
      • addPropertyChangeListener

        public void addPropertyChangeListener(java.lang.String propertyName,
                                              java.beans.PropertyChangeListener listener)
      • removePropertyChangeListener

        public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
      • removePropertyChangeListener

        public void removePropertyChangeListener(java.lang.String propertyName,
                                                 java.beans.PropertyChangeListener listener)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.