|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.app.actions.PeriodicAction
This class is the base class for all periodically recurring time based actions. The Actionable object (if defined) will be an object that has its trigger method called when the PeriodicAction sub-class action is executed or when a constraining condition of the action is reached. The action is tickled periodically and whether it will do its action is dependant upon the time interval as specified by the scale and period and the time and effective rate of the tickle call.
Field Summary | |
protected Actionable |
actor
The actionable actor object that can be invoked by an action if a constraining condition is reached |
protected boolean |
reschedule
If true then the tickle method returns true and the action is considered to be still active by its owner and will be invoked on consequent tickles. |
Fields inherited from interface quicktime.app.time.Ticklish |
kScale |
Constructor Summary | |
protected |
PeriodicAction(int scale,
int period)
Create a PeriodicAction. |
Method Summary | |
protected abstract boolean |
constraintReached()
If after the doAction method has exeucted this method returns true then if the Action has an Actionable object this actionable is triggered. |
protected abstract void |
doAction(float er,
int t)
This method is called by the tickle method when an action becomes active. |
boolean |
equals(java.lang.Object obj)
Returns true if the objects are equal or false otherwise. |
Actionable |
getActionable()
This method retreives the current actor that is attached to the action |
int |
getPeriod()
Returns the current period of the action |
int |
getScale()
Return the current scale of the action. |
int |
getTriggerCondition()
Returns the trigger condition of the action - an action can trigger either when rate is positive, rate is negative or either. |
void |
setActionable(Actionable actor)
This method sets the actionable object of the action. |
void |
setPeriod(int period)
Sets the current period of the action - how many scale ticks will elapse before the action is executed. |
void |
setScale(int s)
Sets the scale of the action - this is the resolution of a second at rate == 1, thus a scale of 10 is 100msecs at rate == 1, 50msecs at rate == 2 etc. |
void |
setTriggerCondition(int cond)
Sets the trigger condition of the action - an action can trigger either when rate is positive, rate is negative or either. |
boolean |
tickle(float effectiveRate,
int currentTime)
This method can be called as often as you like, though effective rate cannot be zero. |
void |
timeChanged(int newTime)
This method should be called by the actions owner whenver a time condition of the owner's time line has changed, as this can effect the trigger conditions of the action. |
java.lang.String |
toString()
Return a String representation of this object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Actionable actor
protected boolean reschedule
Constructor Detail |
protected PeriodicAction(int scale, int period)
scale
- the amount with which a second is divided into at a rate of oneperiod
- the number of scale ticks that elapse between invocations of the action.Method Detail |
public void timeChanged(int newTime) throws QTException
timeChanged
in interface Ticklish
the
- new time expressed in Ticklish.kScale ticksTicklish
public boolean tickle(float effectiveRate, int currentTime) throws QTException
tickle
in interface Ticklish
er
- the actual rate at which the action has been triggeredt
- the time in Ticklish.kScale that the action has been triggeredprotected abstract void doAction(float er, int t) throws QTException
er
- the actual rate at which the action has been triggeredt
- the time in Ticklish.kScale that the action has been triggeredprotected abstract boolean constraintReached()
public void setActionable(Actionable actor)
public Actionable getActionable()
public void setPeriod(int period)
period
- the new periodpublic int getPeriod()
public void setScale(int s)
s
- the new scale or resolution of the actionpublic int getScale()
public int getTriggerCondition()
quicktime.std.StdConstants.triggerTimeFwd
,
quicktime.std.StdConstants.triggerTimeBwd
,
quicktime.std.StdConstants.triggerTimeEither
public void setTriggerCondition(int cond)
cond
- the current trigger conditionquicktime.std.StdConstants.triggerTimeFwd
,
quicktime.std.StdConstants.triggerTimeBwd
,
quicktime.std.StdConstants.triggerTimeEither
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to test
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |