public class UndoStack extends OMComponent implements java.awt.event.ActionListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ClearCmd |
static java.lang.String |
ClearRedoCmd |
static java.lang.String |
ClearUndoCmd |
protected UndoEvent |
currentState
The notion of the current state is important.
|
static int |
DEFAULT_MAX_SIZE |
static java.lang.String |
RedoCmd |
protected java.util.Stack<UndoEvent> |
redoStack |
static int |
REMEMBER_ALL |
protected int |
stackSize |
protected UndoStackSupport |
triggers |
static java.lang.String |
UndoCmd |
protected java.util.Stack<UndoEvent> |
undoStack |
i18n, propertyPrefix
beanContextChildSupport, isolated
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
Constructor and Description |
---|
UndoStack() |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent ae) |
void |
addUndoStackTrigger(UndoStackTrigger trigger)
UndoStackTriggers should call this method to add themselves for stack
notifications, and all will be well.
|
void |
clearStacks(boolean clearUndoStack,
boolean clearRedoStack)
Clear out the chosen undo stacks and fire an event to update the triggers
on stack status.
|
void |
fireStackStatus() |
protected UndoEvent |
getWhatWillHappenNextFromStack(java.util.Stack<UndoEvent> stack) |
protected void |
redo()
Take a UndoEvent off the forwardStack, and push it on the backStack.
|
protected void |
rememberLastThing(UndoEvent event)
Put a new UndoEvent on the backStack, to remember for later in case we
need to back up.
|
void |
removeUndoStackTrigger(UndoStackTrigger trigger)
UndoStackTriggers should call this method to remove themselves from stack
notifications, and all will be well.
|
void |
setTheWayThingsAre(UndoEvent event)
Sets the current state of some object on the stack.
|
protected void |
undo()
Take a UndoEvent off the backStack, and push it on the forward stack, and
invoke the new currentState so the source component gets modified.
|
getProperties, getPropertyInfo, getPropertyPrefix, setProperties, setProperties, setPropertyPrefix
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, findAndInit, findAndUndo, firePropertyChange, fireVetoableChange, getBeanContext, isIsolated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, setIsolated
public static final int DEFAULT_MAX_SIZE
public static final int REMEMBER_ALL
protected transient UndoEvent currentState
protected int stackSize
public static final transient java.lang.String UndoCmd
public static final transient java.lang.String RedoCmd
public static final transient java.lang.String ClearUndoCmd
public static final transient java.lang.String ClearRedoCmd
public static final transient java.lang.String ClearCmd
protected final java.util.Stack<UndoEvent> undoStack
protected final java.util.Stack<UndoEvent> redoStack
protected final UndoStackSupport triggers
public void setTheWayThingsAre(UndoEvent event)
event
- public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed
in interface java.awt.event.ActionListener
protected void rememberLastThing(UndoEvent event)
event
- UndoEvent.protected void undo()
protected void redo()
public void clearStacks(boolean clearUndoStack, boolean clearRedoStack)
clearUndoStack
- clear out the undo stack.clearRedoStack
- clear out the redo stack.public void fireStackStatus()
protected UndoEvent getWhatWillHappenNextFromStack(java.util.Stack<UndoEvent> stack)
public void addUndoStackTrigger(UndoStackTrigger trigger)
public void removeUndoStackTrigger(UndoStackTrigger trigger)
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details