Class Animation

  • Direct Known Subclasses:
    AnimatedButton

    @Deprecated
    public class Animation
    extends Control
    Deprecated.
    The Animation control class.
    This control displays an animation that can be loaded from indexed BMP files (one frame per image) or by a multi-frames BMP. This kind of BMP file contains a list of images having all the same size and that lay side by side.
    • Field Detail

      • pauseIfNotVisible

        public boolean pauseIfNotVisible
        Deprecated.
        Sets to true to stop the animation if its parent window is not the top most.
      • framePeriod

        public int framePeriod
        Deprecated.
        Delay between two frames.
      • isPlaying

        public boolean isPlaying
        Deprecated.
        Reflects the animation play state.
      • isPaused

        public boolean isPaused
        Deprecated.
        Reflects the animation pause state.
      • framesBuffer

        public Image framesBuffer
        Deprecated.
        Frames buffer.
      • eventsMask

        protected int eventsMask
        Deprecated.
        Event notification mask, whose value is eventFinish, which means that an event is posted only when the animation finishes.
      • eventNone

        public static final int eventNone
        Deprecated.
        No notify at all.
        See Also:
        Constant Field Values
      • eventFinish

        public static final int eventFinish
        Deprecated.
        Notifies animation endings.
        See Also:
        Constant Field Values
      • eventLoop

        public static final int eventLoop
        Deprecated.
        Notifies animation loops.
        See Also:
        Constant Field Values
      • eventFrame

        public static final int eventFrame
        Deprecated.
        Notifies animation frames.
        See Also:
        Constant Field Values
      • LOOPS_UNLIMITED

        public static final int LOOPS_UNLIMITED
        Deprecated.
        start() method loops argument special value to loop endlessly.
        See Also:
        Constant Field Values
      • curFrame

        protected int curFrame
        Deprecated.
        The current frame.
      • drawOp

        public int drawOp
        Deprecated.
        Dumb field to keep compilation compatibility with TC 1.
      • background

        protected Image background
        Deprecated.
        Background image.
    • Constructor Detail

      • Animation

        protected Animation()
        Deprecated.
        Animation constructor. This constructor may be used by deriving classes.
      • Animation

        public Animation​(Image frames,
                         int framePeriod)
                  throws ImageException
        Deprecated.
        Animation constructor.
        Parameters:
        frames - Single image containing all frames. The number of frames and the transparent colors are fetched from the image.
        framePeriod - Delay in milliseconds between two frames.
        Throws:
        ImageException - If an internal method throws it.
      • Animation

        public Animation​(Image frames,
                         int frameCount,
                         int framePeriod)
                  throws ImageException
        Deprecated.
        Animation constructor.
        Parameters:
        frames - single image containing all frames.
        frameCount - width in pixels of one frame.
        framePeriod - delay in milliseconds between two frames.
        Throws:
        ImageException - If an internal method throws it.
    • Method Detail

      • setImage

        public void setImage​(Image frames,
                             int frameCount,
                             int framePeriod)
                      throws ImageException
        Deprecated.
        Sets the image of an Animation object.
        Parameters:
        frames - single image containing all frames.
        frameCount - width in pixels of one frame.
        framePeriod - delay in milliseconds between two frames.
        Throws:
        ImageException - If an internal method throws it.
      • onEvent

        public void onEvent​(Event e)
        Deprecated.
        Process events for the Animation class.
        Overrides:
        onEvent in class Control
        Parameters:
        e - The posted event.
        See Also:
        Event, KeyEvent, PenEvent
      • size

        public int size()
        Deprecated.
        Number of frames in the animation.
        Returns:
        Frames amount
      • getPreferredWidth

        public int getPreferredWidth()
        Deprecated.
        Returns the preferred width of this control.
        Overrides:
        getPreferredWidth in class Control
        Returns:
        The preferred width of this control.
      • getPreferredHeight

        public int getPreferredHeight()
        Deprecated.
        Returns the preferred height of this control.
        Overrides:
        getPreferredHeight in class Control
        Returns:
        The preferred height of this control.
      • onPaint

        public void onPaint​(Graphics gfx)
        Deprecated.
        Called by the system to draw the animation.
        Overrides:
        onPaint in class Control
        Parameters:
        gfx - The graphics object for drawing.
        See Also:
        Graphics
      • enableEvents

        public void enableEvents​(int mask)
        Deprecated.
        Enable the posting of events. By default the posting of events are disabled.
      • pause

        public void pause()
        Deprecated.
        Pauses a running animation. If the animation is not playing, this call has no effect.
      • resume

        public void resume()
        Deprecated.
        Resumes a paused animation. If the animation is not playing, this call has no effect.
      • stop

        public void stop()
        Deprecated.
        Stops the animation. If the animation is not playing, this call has no effect.
      • start

        public void start​(int sFrame,
                          int eFrame,
                          int step,
                          int loops)
        Deprecated.
        Starts the animation with a frame range. This method starts an animation by specifying the frame range and a loop flag. If the application is already playing, this call has no effect.
        Parameters:
        sFrame - The start frame.
        eFrame - The end frame.
        step - The frame increment.
        loops - The number of animation iterations.
      • start

        public void start​(int loops)
        Deprecated.
        Starts the animation. This method starts the animation and loops the specified amount of time. If the application is already playing, this call has no effect.
        Parameters:
        loops - Integer value specifying the number of loops or LOOPS_UNLIMITED for an infinite loop.
        See Also:
        LOOPS_UNLIMITED