Documentation of 'org.jplot2d.env.UndoManager' Java class
UndoManager
org.jplot2d.env

Class UndoManager<E>



  • public class UndoManager<E>
    extends java.lang.Object
    Maintains a queue of undo sets, a current set, and a redo sets.
    • Constructor Summary

      Constructors 
      Constructor and Description
      UndoManager()
      Construct a ChangeHistory with capacity 0.
      UndoManager(int capacity)
      Construct a ChangeHistory with the given capacity.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(E cs)
      Add the given change set as current, and push old change set into history.
      boolean canRedo()
      Returns true if redo is possible.
      boolean canUndo()
      Returns true if undo is possible.
      E current()
      Return the current change set.
      int getCapacity()
      Returns the capacity of undo stack.
      int getCSN()
      Returns the current CSN
      int getUndoSize()
      Returns the possible undo steps.
      E redo()
      Returns the next change set after the current change set.
      void setCapacity(int capacity)
      Sets the The capacity of undo stack.
      E undo()
      Move the change set before the current set to current, and return it.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UndoManager

        public UndoManager()
        Construct a ChangeHistory with capacity 0.
      • UndoManager

        public UndoManager(int capacity)
                    throws java.lang.IllegalArgumentException
        Construct a ChangeHistory with the given capacity.
        Parameters:
        capacity - the capacity of the undo stack.
        Throws:
        java.lang.IllegalArgumentException - if the specified capacity is negative
    • Method Detail

      • getCapacity

        public int getCapacity()
        Returns the capacity of undo stack.
        Returns:
        the capacity of undo stack
      • setCapacity

        public void setCapacity(int capacity)
        Sets the The capacity of undo stack. The default capacity is 0.
        Parameters:
        capacity - the capacity of undo stack
      • getUndoSize

        public int getUndoSize()
        Returns the possible undo steps. The size dose not count the current change set.
        Returns:
        the possible undo steps
      • current

        public E current()
        Return the current change set.
        Returns:
        the current change set
      • getCSN

        public int getCSN()
        Returns the current CSN
        Returns:
        the current CSN
      • add

        public void add(E cs)
        Add the given change set as current, and push old change set into history.
        Parameters:
        cs - the change set
      • canUndo

        public boolean canUndo()
        Returns true if undo is possible.
        Returns:
        true if undo is possible
      • undo

        public E undo()
        Move the change set before the current set to current, and return it.
        Returns:
        the previous change set
      • canRedo

        public boolean canRedo()
        Returns true if redo is possible.
        Returns:
        true if redo is possible
      • redo

        public E redo()
        Returns the next change set after the current change set. Returns null if there is no next change set.
        Returns:
        the next change set

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.