Class ImageDisplay

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Placeable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
    Direct Known Subclasses:
    ImageDisplay

    public class ImageDisplay
    extends Sink
    implements Placeable
    Display an image on the screen using the ptolemy.media.Picture class. For a sequence of images that are all the same size, this class will continually update the picture with new data. If the size of the input image changes, then a new Picture object is created. This class will only accept an ImageToken on its input. Note that this class does not work well when executed within Eclipse. In Eclipse, the Swing event thread blocks "waiting for: OGLRenderQueue$QueueFluher", and spends most of its time blocked rather than rendering. Hence, we do not get smooth updates of images.
    Since:
    Ptolemy II 3.0
    Version:
    $Id$
    Author:
    James Yeh, Edward A. Lee
    Pt.AcceptedRating:
    Red
    Pt.ProposedRating:
    Red
    • Method Detail

      • cleanUp

        public void cleanUp()
        Free up memory when closing.
      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the actor into the specified workspace. This calls the base class and then removes association with graphical objects belonging to the original class.
        Overrides:
        clone in class TypedAtomicActor
        Parameters:
        workspace - The workspace for the new object.
        Returns:
        A new actor.
        Throws:
        java.lang.CloneNotSupportedException - If a derived class contains an attribute that cannot be cloned.
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • getBackground

        public java.awt.Color getBackground()
        Get the background.
        Returns:
        The background color.
        See Also:
        setBackground(Color)
      • place

        public void place​(java.awt.Container container)
        Set the container that this actor should image display data in. If place is not called, then the actor will create its own frame for display.
        Specified by:
        place in interface Placeable
        Parameters:
        container - The container in which to place the object, or null to specify that there is no current container.
      • setBackground

        public void setBackground​(java.awt.Color background)
        Set the background.
        Parameters:
        background - The background color.
        See Also:
        getBackground()
      • _getImplementation

        protected ImageDisplayInterface _getImplementation()
        Get the right instance of the implementation depending upon the of the dependency specified through dependency injection. If the instance has not been created, then it is created. If the instance already exists then return the same.

        This code is used as part of the dependency injection needed for the HandSimDroid project, see $PTII/ptserver. This code uses dependency inject to determine what implementation to use at runtime. This method eventually reads ptolemy/actor/ActorModule.properties. ActorModuleInitializer.initializeInjector() should be called before this method is called. If it is not called, then a message is printed and initializeInjector() is called.

        Returns:
        the instance of the implementation.