Package wprover

Class AnimateC


  • public class AnimateC
    extends java.lang.Object
    The `AnimateC` class represents the animation control for a geometric object in the GExpert application. It provides methods to animate a point along a line, circle, or trace path.
    • Constructor Summary

      Constructors 
      Constructor Description
      AnimateC​(AnimateC n)
      Copy constructor for `AnimateC`.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getInitValue()
      Gets the initial animation value.
      int getRounds()
      Calculates the number of rounds needed based on the type of object being animated.
      int getValue​(int f)
      Gets the current animation value.
      void Load​(java.io.DataInputStream in, DrawProcess dp)
      Loads the state of the animation from an input stream.
      boolean loadAnimationString​(java.lang.String s, DrawTextProcess dp)
      Loads animation settings from a string.
      boolean onTimer()
      Handles the animation logic based on a timer event.
      void reClaclulate()
      Recalculates the animation parameters based on the current settings.
      void resetXY()
      Resets the position of the point to its initial coordinates.
      void Save​(java.io.DataOutputStream out)
      Saves the current state of the animation to an output stream.
      void startAnimate()
      Starts the animation by recalculating initial values and setting initial positions.
      void stopAnimate()
      Stops the animation by optionally resetting the point's position.
      java.lang.String toString()
      Returns a string representation of the animation state.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AnimateC

        public AnimateC​(AnimateC n)
        Copy constructor for `AnimateC`.
        Parameters:
        n - The `AnimateC` instance to copy.
    • Method Detail

      • loadAnimationString

        public boolean loadAnimationString​(java.lang.String s,
                                           DrawTextProcess dp)
        Loads animation settings from a string.
        Parameters:
        s - The string containing animation settings.
        dp - The `DrawTextProcess` instance to use for finding points and objects.
        Returns:
        true if the animation settings were loaded successfully, false otherwise.
      • getValue

        public int getValue​(int f)
        Gets the current animation value.
        Parameters:
        f - The frame number.
        Returns:
        The current animation value.
      • getInitValue

        public int getInitValue()
        Gets the initial animation value.
        Returns:
        The initial animation value.
      • reClaclulate

        public void reClaclulate()
        Recalculates the animation parameters based on the current settings.
      • startAnimate

        public void startAnimate()
        Starts the animation by recalculating initial values and setting initial positions.
      • resetXY

        public void resetXY()
        Resets the position of the point to its initial coordinates.
      • toString

        public java.lang.String toString()
        Returns a string representation of the animation state.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representing the point and the object it is on
      • stopAnimate

        public void stopAnimate()
        Stops the animation by optionally resetting the point's position.
      • getRounds

        public int getRounds()
        Calculates the number of rounds needed based on the type of object being animated.
        Returns:
        the number of rounds for the animation
      • onTimer

        public boolean onTimer()
        Handles the animation logic based on a timer event.
        Returns:
        true if the animation continues, false otherwise
      • Save

        public void Save​(java.io.DataOutputStream out)
                  throws java.io.IOException
        Saves the current state of the animation to an output stream.
        Parameters:
        out - the output stream to write to
        Throws:
        java.io.IOException - if an I/O error occurs
      • Load

        public void Load​(java.io.DataInputStream in,
                         DrawProcess dp)
                  throws java.io.IOException
        Loads the state of the animation from an input stream.
        Parameters:
        in - the input stream to read from
        dp - the draw process to use for retrieving objects
        Throws:
        java.io.IOException - if an I/O error occurs