|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.base.CommandStream
This class represents a stream of Commands. It is useful for implementing undoable operations in applications.
Constructor Summary | |
CommandStream()
Initializes a new CommandStream object with unlimited size |
Method Summary | |
Command |
backward()
Returns the next command for which an undo operation is meaningful and consistent in respect to the order of the commands registered. |
boolean |
backwardPossible()
Returns true iff it is possible to retrive a command by calling backward() . |
void |
clear()
Clears this stream |
void |
clearTo(Command com)
Clears the stream up to the given command (exclusive) |
Command |
forward()
Returns the next command for which a redo operation is meaningful and consistent in respect to the order of the commands registered. |
boolean |
forwardPossible()
Returns true iff it is possible to retrive a command by calling forward() . |
Object |
getActiveToken()
Obtains a token which determines the currently active position in the stream. |
int |
getMaximumSize()
Returns the maximum size of this stream |
boolean |
isActiveToken(Object token)
determines, whether the stream is currently at the same position, the time the token was obtained using CommandStream.getActiveToken() |
void |
push(Command com)
Addes the given command to this stream |
void |
setMaximumSize(int maxSize)
Sets the maximum size of this stream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CommandStream()
Method Detail |
public void setMaximumSize(int maxSize)
public int getMaximumSize()
public void push(Command com)
public boolean backwardPossible()
backward()
.
public void clearTo(Command com)
public void clear()
public Command backward()
null
is returned.
public boolean forwardPossible()
forward()
.
public Command forward()
null
is returned.
public Object getActiveToken()
CommandStream.isActiveToken(Object)
can be used to determine, whether the
current stream position equals the position at the time to token was
obtained
public boolean isActiveToken(Object token)
CommandStream.getActiveToken()
token
- the token
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |