|
||||||||||
| 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
edu.umd.cs.piccolox.activities.PPositionPathActivity
public class PPositionPathActivity
PPositionPathActivity animates through a sequence of points.
| Nested Class Summary | |
|---|---|
static interface |
PPositionPathActivity.Target
Interface that objects must conform to in order to have their position animated. |
| Nested classes/interfaces inherited from class edu.umd.cs.piccolo.activities.PActivity |
|---|
PActivity.PActivityDelegate |
| Field Summary | |
|---|---|
protected Point2D[] |
positions
Points that define the animation's path. |
protected PPositionPathActivity.Target |
target
An abstract representation of the thing being positioned. |
| Fields inherited from class edu.umd.cs.piccolox.activities.PPathActivity |
|---|
knots |
| 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 | |
|---|---|
PPositionPathActivity(long duration,
long stepRate,
int loopCount,
int mode,
PPositionPathActivity.Target target,
float[] knots,
Point2D[] positions)
Constructs a position activity that will repeat the number of times specified. |
|
PPositionPathActivity(long duration,
long stepRate,
PPositionPathActivity.Target target)
Constructs a position activity that acts on the given target for the duration provided and will update it's position at the given stepRate. |
|
PPositionPathActivity(long duration,
long stepRate,
PPositionPathActivity.Target target,
float[] knots,
Point2D[] positions)
Constructs a position activity that acts on the given target for the duration provided and will update it's position at the given stepRate. |
|
| Method Summary | |
|---|---|
Point2D |
getPosition(int index)
Returns the point at the given index. |
Point2D[] |
getPositions()
Returns a copy of the path's points. |
protected boolean |
isAnimation()
Returns true since this activity modifies the view and so cause a repaint. |
void |
setPosition(int index,
Point2D position)
Sets the position of the point at the given index. |
void |
setPositions(GeneralPath path)
Extracts positions from a GeneralPath and uses them to define this activity's animation points. |
void |
setPositions(Point2D[] positions)
Changes all positions that define where along the target is being positioned during the animation. |
void |
setRelativeTargetValue(float zeroToOne,
int startKnot,
int endKnot)
Overridden to interpret position at correct point along animation. |
| Methods inherited from class edu.umd.cs.piccolox.activities.PPathActivity |
|---|
getKnot, getKnots, getKnotsLength, setKnot, setKnots, setRelativeTargetValue |
| 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, 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 Point2D[] positions
protected PPositionPathActivity.Target target
| Constructor Detail |
|---|
public PPositionPathActivity(long duration,
long stepRate,
PPositionPathActivity.Target target)
duration - milliseconds of animationstepRate - milliseconds between successive position updatestarget - abstract representation of thing being animated
public PPositionPathActivity(long duration,
long stepRate,
PPositionPathActivity.Target target,
float[] knots,
Point2D[] positions)
duration - milliseconds of animationstepRate - milliseconds between successive position updatestarget - abstract representation of thing being animatedknots - timing to use when animatingpositions - points along the path
public PPositionPathActivity(long duration,
long stepRate,
int loopCount,
int mode,
PPositionPathActivity.Target target,
float[] knots,
Point2D[] positions)
duration - milliseconds of animationstepRate - milliseconds between successive position updatesloopCount - number of times this activity should repeatmode - how easing is handled on this activitytarget - abstract representation of thing being animatedknots - timing to use when animatingpositions - points along the path| Method Detail |
|---|
protected boolean isAnimation()
isAnimation in class PActivitypublic Point2D[] getPositions()
public Point2D getPosition(int index)
index - desired position index
public void setPositions(Point2D[] positions)
positions - new animation positions
public void setPosition(int index,
Point2D position)
index - index of the point to changeposition - point defining the new positionpublic void setPositions(GeneralPath path)
path - source of points
public void setRelativeTargetValue(float zeroToOne,
int startKnot,
int endKnot)
setRelativeTargetValue in class PPathActivityzeroToOne - how far along the activity we arestartKnot - the index of the startKnotendKnot - the index of the endKnot
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||