Package ptolemy.data

Class AWTImageToken


  • public class AWTImageToken
    extends ImageToken
    A token that contains a java.awt.Image. This token is used in the standard image processing library.
    Since:
    Ptolemy II 3.0
    Version:
    $Id$
    Author:
    James Yeh
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Constructor Detail

      • AWTImageToken

        public AWTImageToken​(java.awt.Image value)
        Construct a token with a specified java.awt.Image.
        Parameters:
        value - The given value
    • Method Detail

      • asAWTImage

        public java.awt.Image asAWTImage()
        Because all tokens that contain images must extend ImageToken, we must include the following method.
        Specified by:
        asAWTImage in class ImageToken
        Returns:
        The image.
      • getType

        public Type getType()
        Description copied from class: ObjectToken
        Return the type of this token.
        Overrides:
        getType in class ObjectToken
        Returns:
        BaseType.OBJECT
      • getValue

        public java.awt.Image getValue()
        Return the java.awt.Image object associated with this token.
        Overrides:
        getValue in class ObjectToken
        Returns:
        the java.awt.Image object.
      • toString

        public java.lang.String toString()
        Return a description of the token. If possible, derived classes should override this method and 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. Unfortunately, in this base class, we can only return the classname, the width and the height as a string representation of a record.
        Overrides:
        toString in class ObjectToken
        Returns:
        The classname, width and height as string representation of a record.