|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.app.actions.PeriodicAction | +--quicktime.app.actions.MatrixAction
This class provides the means for a basic Matrix actions. Each time the tickle method is called, it will retrieve the matrix from the target and invoke the transformMatrix method, which the subclass must implement. The subclass defines the transformMatrix method to apply a transformation to the matrix of the target of the action.
The MatrixAction will also notify the subclass of any changes of rate direction and if the subclass is interested in constraint testing will notify the subclass which side(s) a targets matrix has collided with after the transformation has been applied. These two states are notified with the rateDirectionChanged and boundsReached methods respectively.
Though the Space is generally specified it is only used in the bounds testing.
Field Summary | |
protected boolean |
doConstraintBoundsTesting
Set this boolean to true or false to perform bounds testing of the target within the bounds of its enclosing Space. |
protected static int |
kBottomSide
These constants are used in the boundsReached call to indicate to the subclass which edge the target has collided with. |
protected static int |
kLeftSide
These constants are used in the boundsReached call to indicate to the subclass which edge the target has collided with. |
protected static int |
kRightSide
These constants are used in the boundsReached call to indicate to the subclass which edge the target has collided with. |
protected static int |
kTopSide
These constants are used in the boundsReached call to indicate to the subclass which edge the target has collided with. |
protected Transformable |
target
The target of the matrix transformations |
protected TransformMatrix |
transMatrix
This is the class that will do the transformations on the target's matrix |
Fields inherited from class quicktime.app.actions.PeriodicAction |
actor, reschedule |
Fields inherited from interface quicktime.app.time.Ticklish |
kScale |
Constructor Summary | |
|
MatrixAction(int scale,
int period,
QTDisplaySpace space,
Transformable t,
TransformMatrix transformMatrixAction)
Create a MatrixAction that will act upon a Matrix. |
protected |
MatrixAction(int scale,
int period,
QTDrawable space,
Transformable t)
Deprecated. since QTJava 4 |
Method Summary | |
protected void |
boundsReached(int whichSide)
Deprecated. since QTJava 4 |
protected boolean |
constraintReached()
Subclasses should return true if after an action is triggered (the doAction method is called) the action has reached one of its specified constraint conditions and the actionable object should be triggered. |
protected void |
doAction(float er,
int t)
When called it performs three primary tasks: (1) Checks to see if rate direction has changed - if so calls the rateDirectionChanged method (2) Calls the transformMatrix method which the subclass defines (3) If doConstraintBoundsTesting is true does bounds testing of the target within the enclosing space and notifies of any collisions of the target with the space's sides. |
boolean |
equals(java.lang.Object obj)
Returns true if the incoming object is a Matrix action with the same target. |
QTDrawable |
getSpace()
Deprecated. since QTJava 4 |
java.lang.Object |
getTarget()
Deprecated. since QTJava 4 |
protected void |
rateDirectionChanged(boolean forwards)
Deprecated. since QTJava 4 |
void |
setSpace(QTDrawable space)
Deprecated. since QTJava 4 |
void |
setTarget(java.lang.Object target)
Deprecated. since QTJava 4 |
protected void |
setTargetMatrix(Matrix transformedMatrix)
Deprecated. since QTJava 4 |
java.lang.String |
toString()
Return a string representation of this class. |
protected void |
transformMatrix(Matrix theMatrix)
Deprecated. since QTJava 4 |
Methods inherited from class quicktime.app.actions.PeriodicAction |
getActionable, getPeriod, getScale, getTriggerCondition, setActionable, setPeriod, setScale, setTriggerCondition, tickle, timeChanged |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface quicktime.app.time.Ticklish |
tickle, timeChanged |
Field Detail |
protected static final int kLeftSide
protected static final int kRightSide
protected static final int kTopSide
protected static final int kBottomSide
protected Transformable target
protected TransformMatrix transMatrix
protected boolean doConstraintBoundsTesting
Constructor Detail |
protected MatrixAction(int scale, int period, QTDrawable space, Transformable t) throws QTException
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.space
- the QTDrawable object that is the enclosing space of the Transformable target.t
- a transformable object that will have its display matrix altered by the deltaMatrixTransformMatrix
public MatrixAction(int scale, int period, QTDisplaySpace space, Transformable t, TransformMatrix transformMatrixAction) throws QTException
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.space
- the QTDrawable object that is the enclosing space of the Transformable target.t
- a transformable object that will have its display matrix altered by the deltaMatrixtransformMatrixAction
- the transformation that will be applied to the target's matrix every time this action is invoked.Method Detail |
public void setTarget(java.lang.Object target)
setTarget
in interface Targetable
target
- a Transformable objectTransformMatrix
public java.lang.Object getTarget()
getTarget
in interface Targetable
TransformMatrix
public QTDrawable getSpace()
TransformMatrix
public void setSpace(QTDrawable space)
space
- the enclosing space.TransformMatrix
protected void doAction(float er, int t) throws QTException
doAction
in class PeriodicAction
er
- the rate at which the action was invoked.t
- the time at which the action was invoked.protected void rateDirectionChanged(boolean forwards) throws QTException
TransformMatrix
protected void transformMatrix(Matrix theMatrix) throws QTException
theMatrix
- the matrix to transform.TransformMatrix
protected void boundsReached(int whichSide)
whichSide
- a flag that indicates which sideTransformMatrix
protected void setTargetMatrix(Matrix transformedMatrix) throws QTException
transformedMatrix
- the new matrix for the targetTransformMatrix
protected boolean constraintReached()
constraintReached
in class PeriodicAction
public java.lang.String toString()
toString
in class PeriodicAction
quicktime.app.actions.PeriodicAction
public boolean equals(java.lang.Object obj)
equals
in class PeriodicAction
obj
- the object to test
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |