ptolemy.domains.gr.kernel
Class Scene2DToken

java.lang.Object
  extended by ptolemy.data.Token
      extended by ptolemy.domains.gr.kernel.Scene2DToken
All Implemented Interfaces:
java.io.Serializable

public class Scene2DToken
extends Token

A token that contains a two-dimension GR scene. Two dimensional GR scenes are represented by Diva canvases. This is used by the GR domain to get proper type checking across 2D GR actors.

Since:
Ptolemy II 4.0
Version:
$Id: Scene2DToken.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Steve Neuendorffer
See Also:
Serialized Form
Accepted Rating:
Red (neuendor)
Proposed Rating:
Red (neuendor)

Nested Class Summary
static class Scene2DToken.Scene2DType
          The two dimensional scene type corresponding with a SceneToken.
 
Field Summary
private  Figure _figure
           
static Type TYPE
          The Scene2DType.
 
Fields inherited from class ptolemy.data.Token
NIL
 
Constructor Summary
Scene2DToken(Figure figure)
          Construct a Scene2DToken.
 
Method Summary
 Figure getFigure()
          Return the object contained by this token.
 Type getType()
          Return the type of this token.
 BooleanToken isEqualTo(Token token)
          Test for equality of the values of this Token and the argument Token.
 java.lang.String toString()
          Return the value of this token as a string that can be parsed by the expression language to recover a token with the same value.
 
Methods inherited from class ptolemy.data.Token
add, addReverse, divide, divideReverse, isCloseTo, isCloseTo, isNil, modulo, moduloReverse, multiply, multiplyReverse, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, pow, subtract, subtractReverse, zero, zeroReturnType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final Type TYPE
The Scene2DType.


_figure

private Figure _figure
Constructor Detail

Scene2DToken

public Scene2DToken(Figure figure)
Construct a Scene2DToken.

Parameters:
figure - The figure that is represented by a Diva canvas.
Method Detail

getFigure

public Figure getFigure()
Return the object contained by this token.

Returns:
The figure that is represented by a Diva canvas.

getType

public Type getType()
Return the type of this token.

Overrides:
getType in class Token
Returns:
the type of this token.

isEqualTo

public BooleanToken isEqualTo(Token token)
                       throws IllegalActionException
Test for equality of the values of this Token and the argument Token. It should be overridden in derived classes to provide type specific actions for equality testing.

Overrides:
isEqualTo in class Token
Parameters:
token - The token with which to test equality.
Returns:
A BooleanToken which contains the result of the test.
Throws:
IllegalActionException - If this method is not supported by the derived class.

toString

public java.lang.String toString()
Return the value of this token as a string that can be parsed by the expression language to recover a token with the same value. This method should be overridden by derived classes. In this base class, return the String "present" to indicate that an event is present.

Overrides:
toString in class Token
Returns:
The String "present".