Class ImageRenderable<L extends Locatable>

    • Constructor Detail

      • ImageRenderable

        public ImageRenderable​(L source,
                               Contextualized contextProvider,
                               URL[] images)
        constructs a new ImageRenderable.
        Parameters:
        source - T; the source to be animated.
        contextProvider - Contextualized; the object that can provide the context to store the animation objects
        images - URL[]; the image urls.
      • ImageRenderable

        public ImageRenderable​(OrientedPoint3d staticLocation,
                               Bounds3d size,
                               Contextualized contextProvider,
                               URL[] images)
        constructs a new ImageRenderable.
        Parameters:
        staticLocation - OrientedPoint3d; the static location of the set of imageIcons
        size - Bounds3; the size of the imageIcons in world coordinates.
        contextProvider - Contextualized; the object that can provide the context to store the animation objects
        images - URL[]; the imageIcons to display.
      • ImageRenderable

        public ImageRenderable​(Point3d staticLocation,
                               Bounds3d size,
                               Contextualized contextProvider,
                               URL[] images)
        constructs a new ImageRenderable.
        Parameters:
        staticLocation - Point3d; the static location of the set of imageIcons
        size - Bounds3d; the size of the imageIcons in world coordinates.
        contextProvider - Contextualized; the object that can provide the context to store the animation objects
        images - URL[]; the imageIcons to display.
    • Method Detail

      • paint

        public void paint​(Graphics2D graphics,
                          ImageObserver observer)
        Draws an animation on a world coordinate around [x,y] = [0,0].
        Specified by:
        paint in class Renderable2d<L extends Locatable>
        Parameters:
        graphics - Graphics2D; the graphics object
        observer - ImageObserver; the observer
      • selectImage

        public abstract int selectImage()
        selects the image. This methods makes the ImageRenderable state dependent. One is required to return the index number of the imageIcons[] which has to be drawn.
        Returns:
        int the current (state-dependent) image.
      • setOrientation

        public void setOrientation​(short orientation)
        Parameters:
        orientation - short; The orientation to set.
      • getImages

        public ImageIcon[] getImages()
        Returns:
        Returns the imageIcons.
      • resolveOrigin

        protected Point2D resolveOrigin​(short forOrientation,
                                        Bounds2d size)
        resolves the origin of the image.
        Parameters:
        forOrientation - short; the orientation (CC,..)
        size - Dimension; the size of the image.
        Returns:
        Bounds2d the location
      • getOrientation

        public short getOrientation()
        Returns the orientation of this image to the point [0,0]. Orientations are either LEFT, CENTER, RIGHT and TOP, CENTER, or BOTTOM. An example is thus ImageRenderable.RT.
        Returns:
        the orientation of this image