public class Alpha extends NodeComponent
loopCount
-- This is the number of times to run this
Alpha; a value of -1 specifies that the Alpha loops
indefinitely.
triggerTime
-- This is the time in milliseconds since
the start time that this object first triggers. If (startTime +
triggerTime >= currentTime) then the Alpha object starts running.
phaseDelayDuration
-- This is an additional number of
milliseconds to wait after triggerTime before actually starting
this Alpha.
mode
-- This can be set to INCREASING_ENABLE,
DECREASING_ENABLE, or the Or'ed value of the two.
INCREASING_ENABLE activates the increasing Alpha parameters listed
below; DECREASING_ENABLE activates the decreasing Alpha parameters
listed below.
increasingAlphaDuration
-- This is the period of time
during which Alpha goes from zero to one.
increasingAlphaRampDuration
-- This is the period of
time during which the Alpha step size increases at the beginning of
the increasingAlphaDuration and, correspondingly, decreases at the
end of the increasingAlphaDuration. This parameter is clamped to
half of increasingAlphaDuration. When this parameter is non-zero,
one gets constant acceleration while it is in effect; constant
positive acceleration at the beginning of the ramp and constant
negative acceleration at the end of the ramp. If this parameter is
zero, then the effective velocity of the Alpha value is constant
and the acceleration is zero (ie, a linearly increasing alpha
ramp).
alphaAtOneDuration
-- This is the period of time that
Alpha stays at one.
decreasingAlphaDuration
-- This is the period of time
during which Alpha goes from one to zero.
decreasingAlphaRampDuration
-- This is the period of
time during which the Alpha step size increases at the beginning of
the decreasingAlphaDuration and, correspondingly, decreases at the
end of the decreasingAlphaDuration. This parameter is clamped to
half of decreasingAlphaDuration. When this parameter is non-zero,
one gets constant acceleration while it is in effect; constant
positive acceleration at the beginning of the ramp and constant
negative acceleration at the end of the ramp. If this parameter is
zero, the effective velocity of the Alpha value is constant and the
acceleration is zero (i.e., a linearly-decreasing alpha ramp).
alphaAtZeroDuration
-- This is the period of time that
Alpha stays at zero.
Interpolator
Modifier and Type | Field and Description |
---|---|
static int |
DECREASING_ENABLE
Specifies that the decreasing component of the alpha is used
|
static int |
INCREASING_ENABLE
Specifies that the increasing component of the alpha is used.
|
Constructor and Description |
---|
Alpha()
Constructs an Alpha object with default parameters.
|
Alpha(int loopCount,
int mode,
long triggerTime,
long phaseDelayDuration,
long increasingAlphaDuration,
long increasingAlphaRampDuration,
long alphaAtOneDuration,
long decreasingAlphaDuration,
long decreasingAlphaRampDuration,
long alphaAtZeroDuration)
This constructor takes all of the Alpha user-definable parameters.
|
Alpha(int loopCount,
long increasingAlphaDuration)
This constructor takes only the loopCount and increasingAlphaDuration
as parameters and assigns the default values to all of the other
parameters.
|
Alpha(int loopCount,
long triggerTime,
long phaseDelayDuration,
long increasingAlphaDuration,
long increasingAlphaRampDuration,
long alphaAtOneDuration)
Constructs a new Alpha object that assumes that the mode is
INCREASING_ENABLE.
|
Modifier and Type | Method and Description |
---|---|
boolean |
finished()
Query to test if this alpha object is past its activity window,
that is, if it has finished looping.
|
long |
getAlphaAtOneDuration()
Retrieves this alpha's alphaAtOneDuration.
|
long |
getAlphaAtZeroDuration()
Retrieves this alpha's alphaAtZeroDuration.
|
long |
getDecreasingAlphaDuration()
Retrieves this alpha's decreasingAlphaDuration.
|
long |
getDecreasingAlphaRampDuration()
Retrieves this alpha's decreasingAlphaRampDuration.
|
long |
getIncreasingAlphaDuration()
Retrieves this alpha's increasingAlphaDuration.
|
long |
getIncreasingAlphaRampDuration()
Retrieves this alpha's increasingAlphaRampDuration.
|
int |
getLoopCount()
Retrieves this alpha's loopCount.
|
int |
getMode()
Retrieves this alpha's mode.
|
long |
getPauseTime()
Returns the time at which this alpha was paused.
|
long |
getPhaseDelayDuration()
Retrieves this alpha's phaseDelayDuration.
|
long |
getStartTime()
Retrieves this alpha's startTime, the base
for all relative time specifications; the default value
for startTime is the system start time.
|
long |
getTriggerTime()
Retrieves this alpha's triggerTime.
|
boolean |
isPaused()
Returns true if this alpha object is paused.
|
void |
pause()
Pauses this alpha object.
|
void |
pause(long time)
Pauses this alpha object as of the specified time.
|
void |
resume()
Resumes this alpha object.
|
void |
resume(long time)
Resumes this alpha object as of the specified time.
|
void |
setAlphaAtOneDuration(long alphaAtOneDuration)
Set this alpha object's alphaAtOneDuration to the specified
value.
|
void |
setAlphaAtZeroDuration(long alphaAtZeroDuration)
Set this alpha object's alphaAtZeroDuration to the specified
value.
|
void |
setDecreasingAlphaDuration(long decreasingAlphaDuration)
Set this alpha's decreasingAlphaDuration to that specified in
the argument.
|
void |
setDecreasingAlphaRampDuration(long decreasingAlphaRampDuration)
Set this alpha's decreasingAlphaRampDuration to that specified
in the argument.
|
void |
setIncreasingAlphaDuration(long increasingAlphaDuration)
Set this alpha's increasingAlphaDuration to that specified in
the argument.
|
void |
setIncreasingAlphaRampDuration(long increasingAlphaRampDuration)
Set this alpha's increasingAlphaRampDuration to that specified
in the argument.
|
void |
setLoopCount(int loopCount)
Set this alpha's loopCount to that specified in the argument.
|
void |
setMode(int mode)
Set this alpha's mode to that specified in the argument.
|
void |
setPhaseDelayDuration(long phaseDelayDuration)
Set this alpha's phaseDelayDuration to that specified in
the argument.
|
void |
setStartTime(long startTime)
Sets this alpha's startTime to that specified in the argument;
startTime sets the base (or zero) for all relative time
computations; the default value for startTime is the system
start time.
|
void |
setTriggerTime(long triggerTime)
Set this alpha's triggerTime to that specified in the argument.
|
float |
value()
This method returns a value between 0.0 and 1.0 inclusive,
based on the current time and the time-to-alpha parameters
established for this alpha.
|
float |
value(long atTime)
This method returns a value between 0.0 and 1.0 inclusive,
based on the specified time and the time-to-alpha parameters
established for this alpha.
|
cloneNodeComponent, cloneNodeComponent, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
public static final int INCREASING_ENABLE
public static final int DECREASING_ENABLE
public Alpha()
public Alpha(int loopCount, int mode, long triggerTime, long phaseDelayDuration, long increasingAlphaDuration, long increasingAlphaRampDuration, long alphaAtOneDuration, long decreasingAlphaDuration, long decreasingAlphaRampDuration, long alphaAtZeroDuration)
loopCount
- number of times to run this alpha; a value
of -1 specifies that the alpha loops indefinitelymode
- indicates whether the increasing alpha parameters or
the decreasing alpha parameters or both are active. This parameter
accepts the following values, INCREASING_ENABLE or
DECREASING_ENABLE, which may be ORed together to specify
that both are active.
The increasing alpha parameters are increasingAlphaDuration,
increasingAlphaRampDuration, and alphaAtOneDuration.
The decreasing alpha parameters are decreasingAlphaDuration,
decreasingAlphaRampDuration, and alphaAtZeroDuration.triggerTime
- time in milliseconds since the start time
that this object first triggersphaseDelayDuration
- number of milliseconds to wait after
triggerTime before actually starting this alphaincreasingAlphaDuration
- period of time during which alpha goes
from zero to oneincreasingAlphaRampDuration
- period of time during which
the alpha step size increases at the beginning of the
increasingAlphaDuration and, correspondingly, decreases at the end
of the increasingAlphaDuration. This value is clamped to half of
increasingAlphaDuration. NOTE: a value of zero means that the alpha
step size remains constant during the entire increasingAlphaDuration.alphaAtOneDuration
- period of time that alpha stays at onedecreasingAlphaDuration
- period of time during which alpha goes
from one to zerodecreasingAlphaRampDuration
- period of time during which
the alpha step size increases at the beginning of the
decreasingAlphaDuration and, correspondingly, decreases at the end
of the decreasingAlphaDuration. This value is clamped to half of
decreasingAlphaDuration. NOTE: a value of zero means that the alpha
step size remains constant during the entire decreasingAlphaDuration.alphaAtZeroDuration
- period of time that alpha stays at zeropublic Alpha(int loopCount, long triggerTime, long phaseDelayDuration, long increasingAlphaDuration, long increasingAlphaRampDuration, long alphaAtOneDuration)
loopCount
- number of times to run this alpha; a value
of -1 specifies that the alpha loops indefinitely.triggerTime
- time in milliseconds since the start time
that this object first triggersphaseDelayDuration
- number of milliseconds to wait after
triggerTime before actually starting this alphaincreasingAlphaDuration
- period of time during which alpha goes
from zero to oneincreasingAlphaRampDuration
- period of time during which
the alpha step size increases at the beginning of the
increasingAlphaDuration and, correspondingly, decreases at the end
of the increasingAlphaDuration. This value is clamped to half of
increasingAlphaDuration. NOTE: a value of zero means that the alpha
step size remains constant during the entire increasingAlphaDuration.alphaAtOneDuration
- period of time that alpha stays at onepublic Alpha(int loopCount, long increasingAlphaDuration)
loopCount
- number of times to run this alpha; a value
of -1 specifies that the alpha loops indefinitelyincreasingAlphaDuration
- period of time during which alpha goes
from zero to onepublic void pause()
public void pause(long time)
time
- the time at which to pause the alphaIllegalArgumentException
- if time <= 0public void resume()
startTime += System.currentTimeMillis() - pauseTime
public void resume(long time)
startTime += time - pauseTime
time
- the time at which to resume the alphaIllegalArgumentException
- if time <= 0public boolean isPaused()
public long getPauseTime()
public float value()
public float value(long atTime)
atTime
- The time for which we wish to compute alphapublic long getStartTime()
public void setStartTime(long startTime)
startTime
- the new startTime valuepublic int getLoopCount()
public void setLoopCount(int loopCount)
loopCount
- the new loopCount valuepublic int getMode()
public void setMode(int mode)
mode
- indicates whether the increasing alpha parameters or
the decreasing alpha parameters or both are active. This parameter
accepts the following values, INCREASING_ENABLE or
DECREASING_ENABLE, which may be ORed together to specify
that both are active.
The increasing alpha parameters are increasingAlphaDuration,
increasingAlphaRampDuration, and alphaAtOneDuration.
The decreasing alpha parameters are decreasingAlphaDuration,
decreasingAlphaRampDuration, and alphaAtZeroDuration.public long getTriggerTime()
public void setTriggerTime(long triggerTime)
triggerTime
- the new triggerTimepublic long getPhaseDelayDuration()
public void setPhaseDelayDuration(long phaseDelayDuration)
phaseDelayDuration
- the new phaseDelayDurationpublic long getIncreasingAlphaDuration()
public void setIncreasingAlphaDuration(long increasingAlphaDuration)
increasingAlphaDuration
- the new increasingAlphaDurationpublic long getIncreasingAlphaRampDuration()
public void setIncreasingAlphaRampDuration(long increasingAlphaRampDuration)
increasingAlphaRampDuration
- the new increasingAlphaRampDurationpublic long getAlphaAtOneDuration()
public void setAlphaAtOneDuration(long alphaAtOneDuration)
alphaAtOneDuration
- the new alphaAtOneDurationpublic long getDecreasingAlphaDuration()
public void setDecreasingAlphaDuration(long decreasingAlphaDuration)
decreasingAlphaDuration
- the new decreasingAlphaDurationpublic long getDecreasingAlphaRampDuration()
public void setDecreasingAlphaRampDuration(long decreasingAlphaRampDuration)
decreasingAlphaRampDuration
- the new decreasingAlphaRampDurationpublic long getAlphaAtZeroDuration()
public void setAlphaAtZeroDuration(long alphaAtZeroDuration)
alphaAtZeroDuration
- the new alphaAtZeroDurationpublic boolean finished()
Copyright © 2016–2022 SciJava. All rights reserved.