Package kiyut.sketsa.undo

## Class DOMUndoManager

- java.lang.Object
- - javax.swing.undo.AbstractUndoableEdit
  - - javax.swing.undo.CompoundEdit
    - - javax.swing.undo.UndoManager
      - - kiyut.sketsa.undo.DOMUndoManager

- All Implemented Interfaces:
    `Serializable`, `EventListener`, `UndoableEditListener`, `UndoableEdit`

      public class DOMUndoManager
      extends UndoManager

  DOMUndoManager. Note: This is not a thread safe class.
  Author:
    KIYUT
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `class` | `DOMUndoManager.Entry` | Undo Entry
    `class` | `DOMUndoManager.ExtendedCompoundEdit` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected DOMUndoManager.Entry` | `currentEntry` |
    `protected org.w3c.dom.svg.SVGDocument` | `document` |
    `protected EventListener` | `domListener` |
    `protected boolean` | `end` |
    `protected boolean` | `inProgress` |
    `protected int` | `limit` |
    `protected EventListenerList` | `listenerList` |
    `protected List<DOMUndoManager.Entry>` | `redoList` |
    `protected List<DOMUndoManager.Entry>` | `undoList` |

    - ### Fields inherited from class javax.swing.undo.CompoundEdit

      `edits`

    - ### Fields inherited from class javax.swing.undo.AbstractUndoableEdit

      `RedoName, UndoName`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DOMUndoManager()` | Creates a new instance of DOMUndoManager.
    `DOMUndoManager​(int limit)` | Creates a new instance of DOMUndoManager.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `addDOMEventListener​(EventTarget et)` |
    `void` | `addUndoableEditListener​(UndoableEditListener listener)` | Registers an UndoableEditListener.
    `void` | `cancel()` | Cancel the recording of change
    `boolean` | `canRedo()` |
    `boolean` | `canUndo()` |
    `void` | `discardAllEdits()` |
    `protected void` | `domNodeHandleEvent​(Event evt)` |
    `void` | `end()` | Stop recording the change
    `protected void` | `fireUndoableEditHappened()` | Notifies all listeners that have registered interest for notification on this event type.
    `int` | `getLimit()` |
    `String` | `getRedoPresentationName()` |
    `String` | `getUndoOrRedoPresentationName()` |
    `String` | `getUndoPresentationName()` |
    `void` | `redo()` |
    `protected void` | `removeDOMEventListener​(EventTarget et)` |
    `void` | `removeUndoableEditListener​(UndoableEditListener listener)` | Removes an UndoableEditListener.
    `void` | `setLimit​(int limit)` |
    `void` | `setSVGDocument​(org.w3c.dom.svg.SVGDocument doc)` | set `SVGDocument` to be monitored
    `void` | `start​(String name)` | Start recording the change
    `void` | `undo()` |

    - ### Methods inherited from class javax.swing.undo.UndoManager

      `addEdit, canUndoOrRedo, editToBeRedone, editToBeUndone, redoTo, toString, trimEdits, trimForLimit, undoableEditHappened, undoOrRedo, undoTo`

    - ### Methods inherited from class javax.swing.undo.CompoundEdit

      `die, getPresentationName, isInProgress, isSignificant, lastEdit`

    - ### Methods inherited from class javax.swing.undo.AbstractUndoableEdit

      `replaceEdit`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### domListener

          protected EventListener domListener

    - #### document

          protected org.w3c.dom.svg.SVGDocument document

    - #### listenerList

          protected EventListenerList listenerList

    - #### limit

          protected int limit

    - #### undoList

          protected List<DOMUndoManager.Entry> undoList

    - #### redoList

          protected List<DOMUndoManager.Entry> redoList

    - #### currentEntry

          protected DOMUndoManager.Entry currentEntry

    - #### end

          protected boolean end

    - #### inProgress

          protected boolean inProgress

  - ### Constructor Detail

    - #### DOMUndoManager

          public DOMUndoManager()

      Creates a new instance of DOMUndoManager. The default limit is 100

    - #### DOMUndoManager

          public DOMUndoManager​(int limit)

      Creates a new instance of DOMUndoManager.
      Parameters:
        `limit` - The limit

  - ### Method Detail

    - #### addUndoableEditListener

          public void addUndoableEditListener​(UndoableEditListener listener)

      Registers an UndoableEditListener. The listener is notified whenever an edit occurs which can be undone.
      Parameters:
        `listener` - Listener to be added

    - #### removeUndoableEditListener

          public void removeUndoableEditListener​(UndoableEditListener listener)

      Removes an UndoableEditListener.
      Parameters:
        `listener` - Listener to be removed

    - #### fireUndoableEditHappened

          protected void fireUndoableEditHappened()

      Notifies all listeners that have registered interest for notification on this event type.

    - #### getLimit

          public int getLimit()

      Overrides:
        `getLimit` in class `UndoManager`

    - #### setLimit

          public void setLimit​(int limit)

      Overrides:
        `setLimit` in class `UndoManager`

    - #### start

          public void start​(String name)

      Start recording the change
      Parameters:
        `name` - The name of the Undoable

    - #### end

          public void end()

      Stop recording the change
      Overrides:
        `end` in class `UndoManager`

    - #### cancel

          public void cancel()

      Cancel the recording of change

    - #### discardAllEdits

          public void discardAllEdits()

      Overrides:
        `discardAllEdits` in class `UndoManager`

    - #### canUndo

          public boolean canUndo()

      Specified by:
        `canUndo` in interface `UndoableEdit`
      Overrides:
        `canUndo` in class `UndoManager`

    - #### canRedo

          public boolean canRedo()

      Specified by:
        `canRedo` in interface `UndoableEdit`
      Overrides:
        `canRedo` in class `UndoManager`

    - #### undo

          public void undo()
                    throws CannotUndoException

      Specified by:
        `undo` in interface `UndoableEdit`
      Overrides:
        `undo` in class `UndoManager`
      Throws:
        `CannotUndoException`

    - #### redo

          public void redo()
                    throws CannotRedoException

      Specified by:
        `redo` in interface `UndoableEdit`
      Overrides:
        `redo` in class `UndoManager`
      Throws:
        `CannotRedoException`

    - #### setSVGDocument

          public void setSVGDocument​(org.w3c.dom.svg.SVGDocument doc)

      set `SVGDocument` to be monitored
      Parameters:
        `doc` - `SVGDocument`

    - #### getUndoOrRedoPresentationName

          public String getUndoOrRedoPresentationName()

      Overrides:
        `getUndoOrRedoPresentationName` in class `UndoManager`

    - #### getUndoPresentationName

          public String getUndoPresentationName()

      Specified by:
        `getUndoPresentationName` in interface `UndoableEdit`
      Overrides:
        `getUndoPresentationName` in class `UndoManager`

    - #### getRedoPresentationName

          public String getRedoPresentationName()

      Specified by:
        `getRedoPresentationName` in interface `UndoableEdit`
      Overrides:
        `getRedoPresentationName` in class `UndoManager`

    - #### addDOMEventListener

          protected void addDOMEventListener​(EventTarget et)

    - #### removeDOMEventListener

          protected void removeDOMEventListener​(EventTarget et)

    - #### domNodeHandleEvent

          protected void domNodeHandleEvent​(Event evt)