|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectoperators.PSNewpath
Implements PSPathOperator interface.
Methods such as getOperatorToken() are inherited from PSPathOperator interface which, in turn, are inherited from PSOperator. This concrete class is responsible for the deleting everything in the Graphics Stack up to the last stroke command and setting the current position and the last move to null. The Runtime Stack is not affected by this operation.
| Constructor Summary | |
PSNewpath()
|
|
| Method Summary | |
void |
action(dtypes.PSStack s,
dtypes.PSPath p)
Deletes everything in the Graphics Stack up to the last stroke command and setting the current position and the last move to null. |
java.lang.String |
getOperatorToken()
Returns the token identifying this operator. |
boolean |
isValid(dtypes.PSStack s)
Checks if it valid to use this operator now. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PSNewpath()
| Method Detail |
public java.lang.String getOperatorToken()
Returns the name of the operand that this concrete class simulates, here "newpath".
Precondition : A valid operator class has been created.
Postcondition : A string is returned, labeling the semantics of this class.
getOperatorToken in interface pstypes.PSOperator
public boolean isValid(dtypes.PSStack s)
throws exceptions.PSSyntaxException
The creation of a new path can occur any time.
Precondition : A valid instance of PSStack is given.
Postcondition : A reply to the question whether the operator can perfom its defined behaviour.
isValid in interface pstypes.PSOperators - A reference to an instance of PSStack.
exceptions.PSSyntaxException - The syntax of the token is wrong.
public void action(dtypes.PSStack s,
dtypes.PSPath p)
When a new PSPath is created, every variable which represents position or state is reset.
Precondition : A valid stack is given to method.
Postcondition : Unstroked commands will be lost and the current position and last move variables will be reset.
action in interface pstypes.PSPathOperators - The stack which serves no actual purpose here.p - The Graphics Stack.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||