|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolo.activities.PActivity
edu.umd.cs.piccolo.activities.PInterpolatingActivity
edu.umd.cs.piccolox.activities.PPathActivity
public abstract class PPathActivity
PPathActivity is the abstract base class for all path activity interpolators. Path activities interpolate between multiple states over the duration of the activity.
Knots are used to determine when in time the activity should move from state to state. Knot values should be increasing in value from 0 to 1 inclusive. This class is based on the Java 3D PathInterpolator object, see that class documentation for more information on the basic concepts used in this classes design.
See PPositionPathActivity for a concrete path activity that will animate through a list of points.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class edu.umd.cs.piccolo.activities.PActivity |
---|
PActivity.PActivityDelegate |
Field Summary | |
---|---|
protected float[] |
knots
The "knots" that define this path's activity timing through its activity and should be an monotonously increasing array starting where each value is >=0 and ending at 1f. |
Fields inherited from class edu.umd.cs.piccolo.activities.PInterpolatingActivity |
---|
DESTINATION_TO_SOURCE, SOURCE_TO_DESTINATION, SOURCE_TO_DESTINATION_TO_SOURCE |
Fields inherited from class edu.umd.cs.piccolo.activities.PActivity |
---|
TERMINATE_AND_FINISH, TERMINATE_AND_FINISH_IF_STEPPING, TERMINATE_WITHOUT_FINISHING |
Constructor Summary | |
---|---|
PPathActivity(long duration,
long stepRate,
float[] knots)
Constructs a PPathActivity that will last the specified duration, will animate every stepRate and will progress according to the knots provided. |
|
PPathActivity(long duration,
long stepRate,
int loopCount,
int mode,
float[] knots)
Constructs a PPathActivity that will repeat the specified number of times, last the specified duration, will animate every stepRate and will progress according to the knots provided. |
Method Summary | |
---|---|
float |
getKnot(int index)
Returns the value of the knot at the given index. |
float[] |
getKnots()
Return the knots that define the timing of this activity. |
int |
getKnotsLength()
Returns the number of knots that define the timing of this activity. |
void |
setKnot(int index,
float knot)
Changes the knot at the given index. |
void |
setKnots(float[] newKnots)
Changes the knots that define the timing of this activity. |
void |
setRelativeTargetValue(float zeroToOne)
Sets the target's value taking knot timing into account. |
abstract void |
setRelativeTargetValue(float zeroToOne,
int startKnot,
int endKnot)
An abstract method that allows subclasses to define what target value matches the given progress and knots. |
Methods inherited from class edu.umd.cs.piccolo.activities.PInterpolatingActivity |
---|
activityFinished, activityStarted, activityStep, computeSlowInSlowOut, getFirstLoop, getLoopCount, getMode, getSlowInSlowOut, setDuration, setFirstLoop, setLoopCount, setMode, setRelativeTargetValueAdjustingForMode, setSlowInSlowOut, terminate |
Methods inherited from class edu.umd.cs.piccolo.activities.PActivity |
---|
getActivityScheduler, getDelegate, getDuration, getNextStepTime, getStartTime, getStepRate, getStopTime, isAnimation, isStepping, paramString, processStep, setActivityScheduler, setDelegate, setStartTime, setStepRate, startAfter, terminate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected float[] knots
Constructor Detail |
---|
public PPathActivity(long duration, long stepRate, float[] knots)
duration
- duration in milliseconds that this activity should laststepRate
- interval in milliseconds between animation stepsknots
- array defining the speed of the animation alongs it's
animationpublic PPathActivity(long duration, long stepRate, int loopCount, int mode, float[] knots)
duration
- duration in milliseconds that this activity should laststepRate
- interval in milliseconds between animation stepsknots
- array defining the speed of the animation alongs it's
animationloopCount
- # of times activity should repeatmode
- controls easing of the activityMethod Detail |
---|
public int getKnotsLength()
public void setKnots(float[] newKnots)
newKnots
- the new knots to assign to this activitypublic float[] getKnots()
public void setKnot(int index, float knot)
index
- index of knot to changeknot
- new value to assign to the knotpublic float getKnot(int index)
index
- index of desired knot
public void setRelativeTargetValue(float zeroToOne)
setRelativeTargetValue
in class PInterpolatingActivity
zeroToOne
- how much of this activity has elapsed 0=none,
1=completedpublic abstract void setRelativeTargetValue(float zeroToOne, int startKnot, int endKnot)
zeroToOne
- how far between the knots the activity isstartKnot
- knot that defines the start of this particular interpolationendKnot
- knot that defines the end of this particular interpolation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |