public class MapUndoManager
extends javax.swing.undo.UndoManager
UndoManager
that notifies about any edit to the subscribed ChangeListeners.Constructor and Description |
---|
MapUndoManager() |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener l)
Adds a ChangeListener
|
boolean |
addEdit(javax.swing.undo.UndoableEdit anEdit) |
void |
discardAllEdits() |
int |
getNumberOfEdits()
Returns the current number of edits
|
void |
redo() |
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Removes the given ChangeListener
|
boolean |
trimEdits(javax.swing.undo.UndoableEdit from,
boolean inclusiveFrom) |
boolean |
trimEdits(javax.swing.undo.UndoableEdit from,
boolean inclusiveFrom,
javax.swing.undo.UndoableEdit to,
boolean inclusiveTo)
Removes edits in the specified range.
|
boolean |
trimEdits(javax.swing.undo.UndoableEdit from,
javax.swing.undo.UndoableEdit to)
Removes edits in the specified range.
|
void |
undo() |
boolean |
undoORredoPerfomed()
Returns true if an undo or redo action was performed
|
canRedo, canUndo, canUndoOrRedo, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, setLimit, toString, undoableEditHappened, undoOrRedo
public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
addEdit
in interface javax.swing.undo.UndoableEdit
addEdit
in class javax.swing.undo.UndoManager
public boolean trimEdits(javax.swing.undo.UndoableEdit from, boolean inclusiveFrom)
public boolean trimEdits(javax.swing.undo.UndoableEdit from, javax.swing.undo.UndoableEdit to)
from
- the minimum UndoableEdit to removeto
- the maximum UndoableEdit to removepublic boolean trimEdits(javax.swing.undo.UndoableEdit from, boolean inclusiveFrom, javax.swing.undo.UndoableEdit to, boolean inclusiveTo)
from
- the minimum UndoableEdit to removeinclusiveFrom
- true if the 'from' UndoableEdit has to be includedto
- the maximum UndoableEdit to removeinclusiveTo
- true if the 'to' UndoableEdit has to be includedpublic void discardAllEdits()
discardAllEdits
in class javax.swing.undo.UndoManager
public void undo() throws javax.swing.undo.CannotUndoException
undo
in interface javax.swing.undo.UndoableEdit
undo
in class javax.swing.undo.UndoManager
javax.swing.undo.CannotUndoException
public void redo() throws javax.swing.undo.CannotRedoException
redo
in interface javax.swing.undo.UndoableEdit
redo
in class javax.swing.undo.UndoManager
javax.swing.undo.CannotRedoException
public boolean undoORredoPerfomed()
public void addChangeListener(javax.swing.event.ChangeListener l)
l
- public void removeChangeListener(javax.swing.event.ChangeListener l)
l
- public int getNumberOfEdits()