| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.NodeComponent javax.media.j3d.Alpha
Alpha | public class Alpha extends NodeComponent (Code) | | The alpha NodeComponent object provides common methods for
converting a time value into an alpha value (a value in the range 0
to 1). The Alpha object is effectively a function of time that
generates alpha values in the range [0,1] when sampled: f(t) =
[0,1]. A primary use of the Alpha object is to provide alpha
values for Interpolator behaviors. The function f(t) and the
characteristics of the Alpha object are determined by
user-definable parameters:
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.
Increasing Alpha parameters:
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. Decreasing Alpha parameters:
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.
See Also: Interpolator |
Constructor Summary | |
public | Alpha() Constructs an Alpha object with default parameters. | public | 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.
Parameters: loopCount - number of times to run this alpha; a valueof -1 specifies that the alpha loops indefinitely Parameters: mode - indicates whether the increasing alpha parameters orthe decreasing alpha parameters or both are active. | public | 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. | public | 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. |
Method Summary | |
Alpha | cloneAlpha() | public boolean | finished() Query to test if this alpha object is past its activity window,
that is, if it has finished looping. | public long | getAlphaAtOneDuration() Retrieves this alpha's alphaAtOneDuration. | public long | getAlphaAtZeroDuration() Retrieves this alpha's alphaAtZeroDuration. | public long | getDecreasingAlphaDuration() Retrieves this alpha's decreasingAlphaDuration. | public long | getDecreasingAlphaRampDuration() Retrieves this alpha's decreasingAlphaRampDuration. | public long | getIncreasingAlphaDuration() Retrieves this alpha's increasingAlphaDuration. | public long | getIncreasingAlphaRampDuration() Retrieves this alpha's increasingAlphaRampDuration. | public int | getLoopCount() Retrieves this alpha's loopCount. | public int | getMode() Retrieves this alpha's mode. | public long | getPauseTime() Returns the time at which this alpha was paused. | public long | getPhaseDelayDuration() Retrieves this alpha's phaseDelayDuration. | public long | getStartTime() Retrieves this alpha's startTime, the base
for all relative time specifications; the default value
for startTime is the system start time. | public long | getTriggerTime() Retrieves this alpha's triggerTime. | public boolean | isPaused() Returns true if this alpha object is paused. | float | mfmod(float a, float b) | public void | pause() Pauses this alpha object. | public void | pause(long time) Pauses this alpha object as of the specified time. | public void | resume() Resumes this alpha object. | public void | resume(long time) Resumes this alpha object as of the specified time. | public void | setAlphaAtOneDuration(long alphaAtOneDuration) Set this alpha object's alphaAtOneDuration to the specified
value. | public void | setAlphaAtZeroDuration(long alphaAtZeroDuration) Set this alpha object's alphaAtZeroDuration to the specified
value. | public void | setDecreasingAlphaDuration(long decreasingAlphaDuration) Set this alpha's decreasingAlphaDuration to that specified in
the argument. | public void | setDecreasingAlphaRampDuration(long decreasingAlphaRampDuration) Set this alpha's decreasingAlphaRampDuration to that specified
in the argument. | public void | setIncreasingAlphaDuration(long increasingAlphaDuration) Set this alpha's increasingAlphaDuration to that specified in
the argument. | public void | setIncreasingAlphaRampDuration(long increasingAlphaRampDuration) Set this alpha's increasingAlphaRampDuration to that specified
in the argument. | public void | setLoopCount(int loopCount) Set this alpha's loopCount to that specified in the argument. | public void | setMode(int mode) Set this alpha's mode to that specified in the argument.
Parameters: mode - indicates whether the increasing alpha parameters orthe decreasing alpha parameters or both are active. | public void | setPhaseDelayDuration(long phaseDelayDuration) Set this alpha's phaseDelayDuration to that specified in
the argument. | public 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. | public void | setTriggerTime(long triggerTime) Set this alpha's triggerTime to that specified in the argument. | public 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. | public 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.
This method will return the starting alpha value if the alpha
has not yet started (that is, if the specified time is less
than startTime + triggerTime + phaseDelayDuration). |
DECREASING_ENABLE | final public static int DECREASING_ENABLE(Code) | | Specifies that the decreasing component of the alpha is used
|
INCREASING_ENABLE | final public static int INCREASING_ENABLE(Code) | | Specifies that the increasing component of the alpha is used.
|
Alpha | public Alpha()(Code) | | Constructs an Alpha object with default parameters. The default
values are as follows:
loopCount : -1
mode : INCREASING_ENABLE
startTime : system start time
triggerTime : 0
phaseDelayDuration : 0
increasingAlphaDuration : 1000
increasingAlphaRampDuration : 0
alphaAtOneDuration : 0
decreasingAlphaDuration : 0
decreasingAlphaRampDuration : 0
alphaAtZeroDuration : 0
isPaused : false
pauseTime : 0
|
Alpha | public Alpha(int loopCount, int mode, long triggerTime, long phaseDelayDuration, long increasingAlphaDuration, long increasingAlphaRampDuration, long alphaAtOneDuration, long decreasingAlphaDuration, long decreasingAlphaRampDuration, long alphaAtZeroDuration)(Code) | | This constructor takes all of the Alpha user-definable parameters.
Parameters: loopCount - number of times to run this alpha; a valueof -1 specifies that the alpha loops indefinitely Parameters: mode - indicates whether the increasing alpha parameters orthe decreasing alpha parameters or both are active. This parameteraccepts the following values, INCREASING_ENABLE orDECREASING_ENABLE, which may be ORed together to specifythat both are active.The increasing alpha parameters are increasingAlphaDuration,increasingAlphaRampDuration, and alphaAtOneDuration.The decreasing alpha parameters are decreasingAlphaDuration,decreasingAlphaRampDuration, and alphaAtZeroDuration. Parameters: triggerTime - time in milliseconds since the start timethat this object first triggers Parameters: phaseDelayDuration - number of milliseconds to wait aftertriggerTime before actually starting this alpha Parameters: increasingAlphaDuration - period of time during which alpha goesfrom zero to one Parameters: increasingAlphaRampDuration - period of time during whichthe alpha step size increases at the beginning of theincreasingAlphaDuration and, correspondingly, decreases at the endof the increasingAlphaDuration. This value is clamped to half ofincreasingAlphaDuration. NOTE: a value of zero means that the alphastep size remains constant during the entire increasingAlphaDuration. Parameters: alphaAtOneDuration - period of time that alpha stays at one Parameters: decreasingAlphaDuration - period of time during which alpha goesfrom one to zero Parameters: decreasingAlphaRampDuration - period of time during whichthe alpha step size increases at the beginning of thedecreasingAlphaDuration and, correspondingly, decreases at the endof the decreasingAlphaDuration. This value is clamped to half ofdecreasingAlphaDuration. NOTE: a value of zero means that the alphastep size remains constant during the entire decreasingAlphaDuration. Parameters: alphaAtZeroDuration - period of time that alpha stays at zero |
Alpha | public Alpha(int loopCount, long triggerTime, long phaseDelayDuration, long increasingAlphaDuration, long increasingAlphaRampDuration, long alphaAtOneDuration)(Code) | | Constructs a new Alpha object that assumes that the mode is
INCREASING_ENABLE.
Parameters: loopCount - number of times to run this alpha; a valueof -1 specifies that the alpha loops indefinitely. Parameters: triggerTime - time in milliseconds since the start timethat this object first triggers Parameters: phaseDelayDuration - number of milliseconds to wait aftertriggerTime before actually starting this alpha Parameters: increasingAlphaDuration - period of time during which alpha goesfrom zero to one Parameters: increasingAlphaRampDuration - period of time during whichthe alpha step size increases at the beginning of theincreasingAlphaDuration and, correspondingly, decreases at the endof the increasingAlphaDuration. This value is clamped to half ofincreasingAlphaDuration. NOTE: a value of zero means that the alphastep size remains constant during the entire increasingAlphaDuration. Parameters: alphaAtOneDuration - period of time that alpha stays at one |
Alpha | public Alpha(int loopCount, long increasingAlphaDuration)(Code) | | This constructor takes only the loopCount and increasingAlphaDuration
as parameters and assigns the default values to all of the other
parameters.
Parameters: loopCount - number of times to run this alpha; a valueof -1 specifies that the alpha loops indefinitely Parameters: increasingAlphaDuration - period of time during which alpha goesfrom zero to one |
cloneAlpha | Alpha cloneAlpha()(Code) | | This internal method returns a clone of the Alpha
a duplicate of this Alpha |
finished | public boolean finished()(Code) | | Query to test if this alpha object is past its activity window,
that is, if it has finished looping.
true if no longer looping, false otherwise |
getAlphaAtOneDuration | public long getAlphaAtOneDuration()(Code) | | Retrieves this alpha's alphaAtOneDuration.
this alpha's alphaAtOneDuration. |
getAlphaAtZeroDuration | public long getAlphaAtZeroDuration()(Code) | | Retrieves this alpha's alphaAtZeroDuration.
this alpha's alphaAtZeroDuration. |
getDecreasingAlphaDuration | public long getDecreasingAlphaDuration()(Code) | | Retrieves this alpha's decreasingAlphaDuration.
this alpha's decreasingAlphaDuration. |
getDecreasingAlphaRampDuration | public long getDecreasingAlphaRampDuration()(Code) | | Retrieves this alpha's decreasingAlphaRampDuration.
this alpha's decreasingAlphaRampDuration. |
getIncreasingAlphaDuration | public long getIncreasingAlphaDuration()(Code) | | Retrieves this alpha's increasingAlphaDuration.
this alpha's increasingAlphaDuration. |
getIncreasingAlphaRampDuration | public long getIncreasingAlphaRampDuration()(Code) | | Retrieves this alpha's increasingAlphaRampDuration.
this alpha's increasingAlphaRampDuration. |
getLoopCount | public int getLoopCount()(Code) | | Retrieves this alpha's loopCount.
this alpha's loopCount. |
getMode | public int getMode()(Code) | | Retrieves this alpha's mode.
this alpha's mode: any combination ofINCREASING_ENABLE and DECREASING_ENABLE |
getPauseTime | public long getPauseTime()(Code) | | Returns the time at which this alpha was paused.
the pause time; returns 0 if this alpha is not paused since: Java 3D 1.3 |
getPhaseDelayDuration | public long getPhaseDelayDuration()(Code) | | Retrieves this alpha's phaseDelayDuration.
this alpha's phaseDelayDuration. |
getStartTime | public long getStartTime()(Code) | | Retrieves this alpha's startTime, the base
for all relative time specifications; the default value
for startTime is the system start time.
this alpha's startTime. |
getTriggerTime | public long getTriggerTime()(Code) | | Retrieves this alpha's triggerTime.
this alpha's triggerTime. |
isPaused | public boolean isPaused()(Code) | | Returns true if this alpha object is paused.
true if this alpha object is paused, false otherwise since: Java 3D 1.3 |
mfmod | float mfmod(float a, float b)(Code) | | |
pause | public void pause()(Code) | | Pauses this alpha object. The current system time when this
method is called will be used in place of the actual current
time when calculating subsequent alpha values. This has the
effect of freezing the interpolator at the time the method is
called.
since: Java 3D 1.3 |
pause | public void pause(long time)(Code) | | Pauses this alpha object as of the specified time. The specified
time will be used in place of the actual current time when
calculating subsequent alpha values. This has the effect of freezing
the interpolator at the specified time. Note that specifying a
time in the future (that is, a time greater than
System.currentTimeMillis()) will cause the alpha to immediately
advance to that point before pausing. Similarly, specifying a
time in the past (that is, a time less than
System.currentTimeMillis()) will cause the alpha to immediately
revert to that point before pausing.
Parameters: time - the time at which to pause the alpha exception: IllegalArgumentException - if time <= 0 since: Java 3D 1.3 |
resume | public void resume()(Code) | | Resumes this alpha object. If the alpha
object was paused, the difference between the current
time and the pause time will be used to adjust the startTime of
this alpha. The equation is as follows:
startTime += System.currentTimeMillis() - pauseTime
Since the alpha object is no longer paused, this has the effect
of resuming the interpolator as of the current time. If the
alpha object is not paused when this method is called, then this
method does nothing--the start time is not adjusted in this case.
since: Java 3D 1.3 |
resume | public void resume(long time)(Code) | | Resumes this alpha object as of the specified time. If the alpha
object was paused, the difference between the specified
time and the pause time will be used to adjust the startTime of
this alpha. The equation is as follows:
startTime += time - pauseTime
Since the alpha object is no longer paused, this has the effect
of resuming the interpolator as of the specified time. If the
alpha object is not paused when this method is called, then this
method does nothing--the start time is not adjusted in this case.
Parameters: time - the time at which to resume the alpha exception: IllegalArgumentException - if time <= 0 since: Java 3D 1.3 |
setAlphaAtOneDuration | public void setAlphaAtOneDuration(long alphaAtOneDuration)(Code) | | Set this alpha object's alphaAtOneDuration to the specified
value.
Parameters: alphaAtOneDuration - the new alphaAtOneDuration |
setAlphaAtZeroDuration | public void setAlphaAtZeroDuration(long alphaAtZeroDuration)(Code) | | Set this alpha object's alphaAtZeroDuration to the specified
value.
Parameters: alphaAtZeroDuration - the new alphaAtZeroDuration |
setDecreasingAlphaDuration | public void setDecreasingAlphaDuration(long decreasingAlphaDuration)(Code) | | Set this alpha's decreasingAlphaDuration to that specified in
the argument.
Parameters: decreasingAlphaDuration - the new decreasingAlphaDuration |
setDecreasingAlphaRampDuration | public void setDecreasingAlphaRampDuration(long decreasingAlphaRampDuration)(Code) | | Set this alpha's decreasingAlphaRampDuration to that specified
in the argument.
Parameters: decreasingAlphaRampDuration - the new decreasingAlphaRampDuration |
setIncreasingAlphaDuration | public void setIncreasingAlphaDuration(long increasingAlphaDuration)(Code) | | Set this alpha's increasingAlphaDuration to that specified in
the argument.
Parameters: increasingAlphaDuration - the new increasingAlphaDuration |
setIncreasingAlphaRampDuration | public void setIncreasingAlphaRampDuration(long increasingAlphaRampDuration)(Code) | | Set this alpha's increasingAlphaRampDuration to that specified
in the argument.
Parameters: increasingAlphaRampDuration - the new increasingAlphaRampDuration |
setLoopCount | public void setLoopCount(int loopCount)(Code) | | Set this alpha's loopCount to that specified in the argument.
Parameters: loopCount - the new loopCount value |
setMode | public void setMode(int mode)(Code) | | Set this alpha's mode to that specified in the argument.
Parameters: mode - indicates whether the increasing alpha parameters orthe decreasing alpha parameters or both are active. This parameteraccepts the following values, INCREASING_ENABLE orDECREASING_ENABLE, which may be ORed together to specifythat both are active.The increasing alpha parameters are increasingAlphaDuration,increasingAlphaRampDuration, and alphaAtOneDuration.The decreasing alpha parameters are decreasingAlphaDuration,decreasingAlphaRampDuration, and alphaAtZeroDuration. |
setPhaseDelayDuration | public void setPhaseDelayDuration(long phaseDelayDuration)(Code) | | Set this alpha's phaseDelayDuration to that specified in
the argument.
Parameters: phaseDelayDuration - the new phaseDelayDuration |
setStartTime | public void setStartTime(long startTime)(Code) | | 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.
Parameters: startTime - the new startTime value |
setTriggerTime | public void setTriggerTime(long triggerTime)(Code) | | Set this alpha's triggerTime to that specified in the argument.
Parameters: triggerTime - the new triggerTime |
value | public float value()(Code) | | 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. If this alpha object is paused,
the value will be based on the pause time rather than the
current time.
This method will return the starting alpha value if the alpha
has not yet started (that is, if the current time is less
than startTime + triggerTime + phaseDelayDuration). This
method will return the ending alpha value if the alpha has
finished (that is, if the loop count has expired).
a value between 0.0 and 1.0 based on the current time |
value | public float value(long atTime)(Code) | | 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.
This method will return the starting alpha value if the alpha
has not yet started (that is, if the specified time is less
than startTime + triggerTime + phaseDelayDuration). This
method will return the ending alpha value if the alpha has
finished (that is, if the loop count has expired).
Parameters: atTime - The time for which we wish to compute alpha a value between 0.0 and 1.0 based on the specified time |
Fields inherited from javax.media.j3d.NodeComponent | boolean forceDuplicate(Code)(Java Doc)
|
|
|