Class MapUndoManager
- java.lang.Object
-
- javax.swing.undo.AbstractUndoableEdit
-
- javax.swing.undo.CompoundEdit
-
- javax.swing.undo.UndoManager
-
- oracle.spatial.network.nfe.vis.maps.core.MapUndoManager
-
- All Implemented Interfaces:
java.io.Serializable,java.util.EventListener,javax.swing.event.UndoableEditListener,javax.swing.undo.UndoableEdit
public class MapUndoManager extends javax.swing.undo.UndoManagerA subclass ofUndoManagerthat notifies about any edit to the subscribed ChangeListeners.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MapUndoManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChangeListener(javax.swing.event.ChangeListener l)Adds a ChangeListenerbooleanaddEdit(javax.swing.undo.UndoableEdit anEdit)voiddiscardAllEdits()intgetNumberOfEdits()Returns the current number of editsvoidredo()voidremoveChangeListener(javax.swing.event.ChangeListener l)Removes the given ChangeListenerbooleantrimEdits(javax.swing.undo.UndoableEdit from, boolean inclusiveFrom)booleantrimEdits(javax.swing.undo.UndoableEdit from, boolean inclusiveFrom, javax.swing.undo.UndoableEdit to, boolean inclusiveTo)Removes edits in the specified range.booleantrimEdits(javax.swing.undo.UndoableEdit from, javax.swing.undo.UndoableEdit to)Removes edits in the specified range.voidundo()booleanundoORredoPerfomed()Returns true if an undo or redo action was performed-
Methods inherited from class javax.swing.undo.UndoManager
canRedo, canUndo, canUndoOrRedo, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, redoTo, setLimit, toString, trimEdits, trimForLimit, undoableEditHappened, undoOrRedo, undoTo
-
-
-
-
Method Detail
-
addEdit
public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
- Specified by:
addEditin interfacejavax.swing.undo.UndoableEdit- Overrides:
addEditin classjavax.swing.undo.UndoManager
-
trimEdits
public boolean trimEdits(javax.swing.undo.UndoableEdit from, boolean inclusiveFrom)
-
trimEdits
public boolean trimEdits(javax.swing.undo.UndoableEdit from, javax.swing.undo.UndoableEdit to)Removes edits in the specified range.- Parameters:
from- the minimum UndoableEdit to removeto- the maximum UndoableEdit to remove- Returns:
-
trimEdits
public boolean trimEdits(javax.swing.undo.UndoableEdit from, boolean inclusiveFrom, javax.swing.undo.UndoableEdit to, boolean inclusiveTo)Removes edits in the specified range.- Parameters:
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 included- Returns:
-
discardAllEdits
public void discardAllEdits()
- Overrides:
discardAllEditsin classjavax.swing.undo.UndoManager
-
undo
public void undo() throws javax.swing.undo.CannotUndoException- Specified by:
undoin interfacejavax.swing.undo.UndoableEdit- Overrides:
undoin classjavax.swing.undo.UndoManager- Throws:
javax.swing.undo.CannotUndoException
-
redo
public void redo() throws javax.swing.undo.CannotRedoException- Specified by:
redoin interfacejavax.swing.undo.UndoableEdit- Overrides:
redoin classjavax.swing.undo.UndoManager- Throws:
javax.swing.undo.CannotRedoException
-
undoORredoPerfomed
public boolean undoORredoPerfomed()
Returns true if an undo or redo action was performed- Returns:
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener l)
Adds a ChangeListener- Parameters:
l-
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
Removes the given ChangeListener- Parameters:
l-
-
getNumberOfEdits
public int getNumberOfEdits()
Returns the current number of edits- Returns:
-
-