+
+ /** Add an undo operation to the stack */
+ public synchronized boolean add(UndoOperation inOp)
+ {
+ return super.add(new UndoOpWithState(inOp, _numUndos));
+ }
+
+ /** Pop the latest operation from the stack */
+ public synchronized UndoOperation popOperation()
+ {
+ _numUndos++;
+ return super.pop()._undoOperation;
+ }
+
+ /** Get the operation at the given index */
+ public UndoOperation getOperationAt(int inIndex)
+ {
+ return super.elementAt(inIndex)._undoOperation;
+ }
+
+ /** @return number of undos */
+ public int getNumUndos()
+ {
+ if (isEmpty()) {return 0;}
+ // Get the number of undos stored by the last operation on the stack
+ return peek()._undoCounter;
+ }