Documentation of 'jv.anim.PsAnimation' Java class
PsAnimation ("JavaView Reference Manual")
"JavaView? v5.03.003"
jv.anim

Class PsAnimation

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Runnable, PsUpdateIf


    public class PsAnimation
    extends PsObject
    implements java.lang.Runnable
    Animation manager issues time events and updates its listeners. Classes interested in time events must implement the interface PsTimeListenerIf and register itself as listener in an instance this class.

    By default, the time variable runs in the interval [0,100].

    For usage, see interface PsTimeListenerIf. Since version 2.00 each animation has its own animationPanel.

    See Also:
    PsAnimation_IP, PsTimeListenerIf, Serialized Form
    Author:
    Konrad Polthier
    Version:
    26.03.05, 3.50 revised (kp) Use dialog size specified in PsJavaView.
    30.05.03, 3.40 revised (kp) Clear registered time listeners during init().
    21.02.01, 3.30 revised (kp) Now register this object inside its time listeners.
    21.01.01, 3.20 revised (kp) Info panel subclassed from PsPanel than PsDialog.
    01.12.00, 3.10 revised (kp) Implement two methods to get/set the sleep interval.
    16.09.00, 3.00 revised (kp) Interface PsAnimationIf removed, static variable moved to PsAnimation.
    06.10.99, 2.51 revised (ur) Let time for LOOP run in min<=time<= max instead of min<time<max.
    12.06.99, 2.50 revised (kp) Use name of dynamic object as title of the animation panel.
    06.06.99, 2.50 revised (kp) Start/stop and m_thread handling moved here from info panel.
    20.05.99, 2.00 revised (kp) Now each animation has its own animation panel.
    00.00.97, 1.00 created (kp)
    • Field Detail

      • FORWARD

        public static final int FORWARD
        Play animation with normal speed determined by line increment of time ruler.
        See Also:
        Constant Field Values
      • REWIND

        public static final int REWIND
        Play animation with normal speed in backward direction determined by line increment of time ruler.
        See Also:
        Constant Field Values
      • FAST_FORWARD

        public static final int FAST_FORWARD
        Play animation with speed determined by page increment of time ruler.
        See Also:
        Constant Field Values
      • FAST_REWIND

        public static final int FAST_REWIND
        Play animation with fast speed determined by page increment of time ruler in backward direction.
        See Also:
        Constant Field Values
      • ONE_WAY

        public static final int ONE_WAY
        Stop animation, repeat mode when either end of animation is reached.
        See Also:
        Constant Field Values
      • LOOP

        public static final int LOOP
        Jump to other end, repeat mode when either end of animation is reached.
        See Also:
        Constant Field Values
      • BACK_FORTH

        public static final int BACK_FORTH
        Change direction, repeat mode when either end of animation is reached.
        See Also:
        Constant Field Values
      • INTERPOL_NONE

        public static final int INTERPOL_NONE
        Jump to other end, repeat mode when either end of animation is reached.
        See Also:
        Constant Field Values
      • INTERPOL_LINEAR

        public static final int INTERPOL_LINEAR
        Change direction, repeat mode when either end of animation is reached.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PsAnimation

        public PsAnimation()
    • Method Detail

      • init

        public void init()
        Description copied from class: PsObject
        If instance has missing name then assign default name 'Object_NUMBER' where number is the total number of already created instances.
        Overrides:
        init in class PsObject
      • addTimeListener

        public boolean addTimeListener(PsTimeListenerIf listener)
        Register a new update listener, and in return, register this animation in the time listener. This bijective registration allows the time listener to invoke this animation panel.
        Parameters:
        listener - which is being registered
        Returns:
        false if listener already registered.
        See Also:
        hasTimeListener(PsTimeListenerIf), removeTimeListener(PsTimeListenerIf)
        Version:
        21.02.01, 1.10 revised (kp) Now register this object inside its time listeners.
      • getSleepInterval

        public long getSleepInterval()
        Get the length of the sleep interval between two timer events.
      • setSleepInterval

        public void setSleepInterval(long newInterval)
        Set the length of the sleep interval between two timer events.
      • setTimeInterval

        public void setTimeInterval(double aMin,
                                    double aMax,
                                    double aLineIncr,
                                    double aPageIncr)
        Set interval in which time varies, and increments for time slider.
      • setTimeInterval

        public void setTimeInterval(double aMin,
                                    double aMax)
        Set interval in which time varies.
      • getMinTime

        public double getMinTime()
        Get minimal time of animation interval.
      • getMaxTime

        public double getMaxTime()
        Get maximal time of animation interval.
      • getTimeStepIncr

        public double getTimeStepIncr()
        Get time increment of standard animation play.
      • setTimeStepIncr

        public void setTimeStepIncr(double incr)
        Set time increment of standard animation play. The given value is difference of the time between two successive sections.
        Since:
        JavaView 2.49.001
        Version:
        07.01.03, 1.00 created (kp)
      • getTimePageIncr

        public double getTimePageIncr()
        Get time increment of fast forward animation play.
      • setTimePageIncr

        public void setTimePageIncr(double incr)
        Set time increment of fast forward animation play. The given value is difference of the time between two successive sections.
        Since:
        JavaView 2.49.001
        Version:
        07.01.03, 1.00 created (kp)
      • getTime

        public double getTime()
        Get the current time of the animation.
      • setTime

        public void setTime(double newTime)
        Set the time of the animation and the animation panel.
      • synchronize

        public void synchronize(boolean flag)
        Switch synchronization flag and, if flag==true update currentTime with globalTime.
      • enableKeys

        public void enableKeys(boolean flag)
        Set visibility of key buttons prevKey, nextKey etc. in animation panel.
      • getAnimationPanel

        public PsDialog getAnimationPanel()
        Get animation dialog to start and stop animation interactively.
        Version:
        05.03.00, 1.10 revised (kp) Return value changed to PsDialog to help JAX.
      • hasAnimationPanel

        public boolean hasAnimationPanel()
        Query if animation has an animation dialog, or if it runs program controlled.
      • setAnimationPanel

        public void setAnimationPanel(PsDialog panel)
        Set animation panel, e.g. when different animations join a common panel. If different animation panels are used, it is preferred that a subclass of PsAnimation overrides the method getAnimationPanel() and allocates the a animation panel there, instead of calling setAnimationPanel().
      • setPosition

        public void setPosition(int[] position)
        Set position and size of animation panel in absolute screen coordinates.
      • setInterpolType

        public void setInterpolType(int type)
        Set interpolation mode of animation.
        Parameters:
        type - INTERPOL_LINEAR, INTERPOL_NONE
      • setRepeat

        public void setRepeat(int repeat)
        Set repeat mode of animation.
        Parameters:
        repeat - BACK_FORTH, LOOP, ONE_WAY
      • setSpeedType

        public void setSpeedType(int speedType)
        Set the speed type of this animation among four different types. The absolute value of the speed is determined by the value of the step and page increment of this animation. These increments may be modified by calling e.g. getTimeStepIncr(), or by interactively adjusting the line and page increment of the time slider.
        Parameters:
        speedType - FORWARD, FAST_FORWARD, REWIND, FAST_REWIND
        See Also:
        getTimeStepIncr(), getTimePageIncr()
      • isModal

        public boolean isModal()
        Get flag if animation runs modal.
        See Also:
        setModal(boolean)
      • setModal

        public void setModal(boolean modal)
        Set flag if animation runs modal. If an animation runs modal then the start(int) blocks until the animation has stopped. By default, an animation is not modal.

        Note, if an animation runs modal in mode BACK_FORTH one must avoid an infinite loop, for example, by showing the animation panel which allows the user to stop the animation.

        See Also:
        isModal()
      • isRunning

        public boolean isRunning()
        Check if animation is running.
      • start

        public void start(int speedType)
        Deprecated. use setSpeed(speedType) followed by start().
        Start animation with given speed type.
        Parameters:
        speedType - FORWARD, FAST_FORWARD, REWIND, FAST_REWIND
      • start

        public void start()
        Start the animation with current speed type. The default direction and speed is FORWARD.
      • stop

        public void stop()
        Stop animation.
      • run

        public void run()
        Do the animation. Method is called from the animation thread.
        Specified by:
        run in interface java.lang.Runnable
"JavaView? v5.03.003"

"

The software JavaView? is copyright protected. All Rights Reserved.
"

You see the box below because you did not login.