public class PTransformActivity extends PInterpolatingActivity
Modifier and Type | Class and Description |
---|---|
static interface |
PTransformActivity.Target
Target Objects that want to get transformed by the transform
activity must implement this interface.
|
PActivity.PActivityDelegate
DESTINATION_TO_SOURCE, SOURCE_TO_DESTINATION, SOURCE_TO_DESTINATION_TO_SOURCE
TERMINATE_AND_FINISH, TERMINATE_AND_FINISH_IF_STEPPING, TERMINATE_WITHOUT_FINISHING
Constructor and Description |
---|
PTransformActivity(long duration,
long stepRate,
int loopCount,
int mode,
PTransformActivity.Target target,
AffineTransform destination)
Create a new PTransformActivity.
|
PTransformActivity(long duration,
long stepRate,
PTransformActivity.Target target)
Constructs a transform activity that will last for the specified
duration, will update at the given step rate and will be applied to the
target.
|
PTransformActivity(long duration,
long stepRate,
PTransformActivity.Target target,
AffineTransform destination)
Constructs a activity that will change the target's transform in the
destination transform.
|
Modifier and Type | Method and Description |
---|---|
protected void |
activityStarted()
Is invoked when the activity is started.
|
double[] |
getDestinationTransform()
Return the final transform that will be set on the transform activities
target when the transform activity stops stepping.
|
protected boolean |
isAnimation()
Whether each step invalidates paint.
|
void |
setDestinationTransform(double[] newDestination)
Set the final transform that will be set on the transform activities
target when the transform activity stops stepping.
|
void |
setRelativeTargetValue(float zeroToOne)
Set's the target value to be the interpolation between the source and
destination transforms.
|
activityFinished, activityStep, computeSlowInSlowOut, getFirstLoop, getLoopCount, getMode, getSlowInSlowOut, setDuration, setFirstLoop, setLoopCount, setMode, setRelativeTargetValueAdjustingForMode, setSlowInSlowOut, terminate
getActivityScheduler, getDelegate, getDuration, getNextStepTime, getStartTime, getStepRate, getStopTime, isStepping, processStep, setActivityScheduler, setDelegate, setStartTime, setStepRate, startAfter, terminate
public PTransformActivity(long duration, long stepRate, PTransformActivity.Target target)
duration
- duration in milliseconds of the entire activitystepRate
- interval in milliseconds between successive animation
stepstarget
- the target of the activitypublic PTransformActivity(long duration, long stepRate, PTransformActivity.Target target, AffineTransform destination)
duration
- duration in milliseconds of the entire activitystepRate
- interval in milliseconds between successive animation
stepstarget
- the target of the activitydestination
- transform that the target will be after the ativity is
finishedpublic PTransformActivity(long duration, long stepRate, int loopCount, int mode, PTransformActivity.Target target, AffineTransform destination)
duration
- the length of one loop of the activitystepRate
- the amount of time between steps of the activityloopCount
- number of times the activity should reschedule itselfmode
- defines how the activity interpolates between statestarget
- the object that the activity will be applied to and where
the source state will be taken from.destination
- the destination color stateprotected boolean isAnimation()
isAnimation
in class PActivity
public double[] getDestinationTransform()
public void setDestinationTransform(double[] newDestination)
newDestination
- an array of doubles representing the destination
transformprotected void activityStarted()
activityStarted
in class PInterpolatingActivity
public void setRelativeTargetValue(float zeroToOne)
setRelativeTargetValue
in class PInterpolatingActivity
zeroToOne
- how far along the activity has progressed. 0 = not at
all, 1 = completedCopyright © 1995-2013 Piccolo2D. All Rights Reserved.