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

Class PsKeyframe

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsKeyframeIf, PsTimeListenerIf, PsUpdateIf, PgGeometryIf


    public class PsKeyframe
    extends PgGeometry
    implements PsKeyframeIf, PsTimeListenerIf
    Collection of keys which is a pair of an object and a unique time associated with each object. The objects must be of the same class, and must implement the interpolation method 'blend'.

    Instance of this class can be used as the dynamic in an animation.

    See Also:
    PsAnimation, PsTimeListenerIf, PsKeyframeIf, Serialized Form
    Author:
    Konrad Polthier
    Version:
    21.02.01, 3.00 revised (kp) Implement new methods of PsTimeListenerIf, remove method 'alloc', rename methods.
    16.09.00, 2.50 revised (kp) This class no longer implements PsTimeListener, should be managed by parent class.
    24.08.00, 2.00 revised (kp) Superclass changed to PgGeometry from PsObject.
    04.10.99, 1.01 revised (ur) Four methods getTimeOfFirst/Previous/Next/LastKey added.
    22.06.99, 1.00 created (kp)
    • Constructor Detail

      • PsKeyframe

        public PsKeyframe()
        Constructor with empty list of keyframes.
    • Method Detail

      • init

        public void init()
        Initialize instance variables.
        Overrides:
        init in class PgGeometry
      • getDynamic

        public PgGeometry getDynamic()
        Get the geometry which is used for interpolation between keyframes. This dynamic geometry should be added to a display in order to visualize a time section of this keyframe sequence.
        Returns:
        dynamic section of the time dependent geometry
        Version:
        21.02.01, 1.10 revised (kp) Renamed to getDynamic() from getObject().
      • setDynamic

        public void setDynamic(PgGeometry geom)
        Set the geometry which is used for interpolation between keyframes. This dynamic geometry must be of the same class as all other key objects. Usually, it is assigned automatically by this keyframe class.

        This keyframe class is set as the parent of the dynamic geometry.

        Parameters:
        geom - geometry used to store a dynamic section of the keyframe animation.
        Version:
        21.02.01, 1.10 revised (kp) Renamed to setDynamic() from setObject().
      • setEnabledKeysOnly

        public void setEnabledKeysOnly(boolean flag)
        Set flag to avoid smooth interpolation but displaying key objects only.
        Parameters:
        flag - Set true to avoid smooth interpolation
      • isEnabledKeysOnly

        public boolean isEnabledKeysOnly()
        Get flag which determines smooth interpolation or displaying of key objects only.
        Returns:
        Get true if no smooth interpolation
      • getObject

        public PgGeometry getObject(int ind)
        Get geometry of keyframe with given index.
        Parameters:
        ind - Index of a keyframe in [0, numKeys-1].
        Returns:
        Geometry of key, or null if failure.
        See Also:
        getObject(double)
      • getObject

        public PgGeometry getObject(double time)
        Get geometry of keyframe with currentTime<=time.
        Parameters:
        time - Time of the requested key.
        Returns:
        Geometry of key, or null if failure.
        See Also:
        getNextObject(double)
      • getNextObject

        public PgGeometry getNextObject(double time)
        Get geometry of first keyframe with currentTime>time, or null if no more keyframes.
        Parameters:
        time - Time of the requested key.
        Returns:
        Geometry of key, or null if failure.
        See Also:
        getObject(double)
      • setTime

        public boolean setTime(PsTimeEvent timeEvent)
        Refresh the interpolation geometry at the given time. Method invokes the update method of the interpolation geometry to initiate a redraw.

        HACK: Method should be moved to applications.

        Specified by:
        setTime in interface PsTimeListenerIf
        Version:
        21.02.01, 1.10 revised (kp) Initiate update of interpolation geometry instead this keyframe.
      • setTime

        public boolean setTime(double time)
        Refresh the interpolation geometry at the given time. Method does not invoke the update method of the interpolation geometry.
      • getNumOfKeys

        public int getNumOfKeys()
        Get number of keyframes of this instance.
        Returns:
        number of keys, or 0 if list is empty.
      • addKey

        public int addKey(PgGeometry object,
                          double time)
        Add key at specified time and return index of key. There are four cases: either the new time is left or right of the existing time interval, or it is within EPS tolerance of a key, or between two keys.
      • removeKey

        public void removeKey(double time)
        Remove key at specified time within EPS tolerance. If no key found, just return.
      • removeKey

        public void removeKey(int ind)
        Remove key at specified index.
      • getTimeOfFirstKey

        public double getTimeOfFirstKey()
        Minimal value of animation interval if instance has keyframes. Specific for keyframe animations, otherwise default implementations suffice. Method is invoked from animation panel to browse through set of keys.
        Specified by:
        getTimeOfFirstKey in interface PsKeyframeIf
        See Also:
        PsAnimation.enableKeys(boolean)
      • getTimeOfPreviousKey

        public double getTimeOfPreviousKey()
        Current time minus time step increment if instance has keyframes. Specific for keyframe animations, otherwise default implementations suffice. Method is invoked from animation panel to browse through set of keys.
        Specified by:
        getTimeOfPreviousKey in interface PsKeyframeIf
      • getTimeOfNextKey

        public double getTimeOfNextKey()
        Current time plus time step increment if instance has keyframes. Specific for keyframe animations, otherwise default implementations suffice.
        Specified by:
        getTimeOfNextKey in interface PsKeyframeIf
        See Also:
        PsAnimation.enableKeys(boolean)
      • setAnimation

        public void setAnimation(PsAnimation anAnimation)
        Assign the animation object where this listener is registered. This method is invoked by the animation object during registration of this listener, and usually is not required to be called by a user. If this listener has an assigned animation object, then its animation panel may be shown to change the current time of this listener.

        Only one animation object may be assigned to this listener. Subsequent assignments will replace the previous assignment.

        Specified by:
        setAnimation in interface PsTimeListenerIf
        See Also:
        getAnimation(), hasAnimation()
"JavaView? v5.03.003"

"

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

You see the box below because you did not login.