Package wprover
Class AnimateC
- java.lang.Object
-
- wprover.AnimateC
-
public class AnimateC extends java.lang.ObjectThe `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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetInitValue()Gets the initial animation value.intgetRounds()Calculates the number of rounds needed based on the type of object being animated.intgetValue(int f)Gets the current animation value.voidLoad(java.io.DataInputStream in, DrawProcess dp)Loads the state of the animation from an input stream.booleanloadAnimationString(java.lang.String s, DrawTextProcess dp)Loads animation settings from a string.booleanonTimer()Handles the animation logic based on a timer event.voidreClaclulate()Recalculates the animation parameters based on the current settings.voidresetXY()Resets the position of the point to its initial coordinates.voidSave(java.io.DataOutputStream out)Saves the current state of the animation to an output stream.voidstartAnimate()Starts the animation by recalculating initial values and setting initial positions.voidstopAnimate()Stops the animation by optionally resetting the point's position.java.lang.StringtoString()Returns a string representation of the animation state.
-
-
-
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:
toStringin classjava.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.IOExceptionSaves 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.IOExceptionLoads the state of the animation from an input stream.- Parameters:
in- the input stream to read fromdp- the draw process to use for retrieving objects- Throws:
java.io.IOException- if an I/O error occurs
-
-