quicktime.app.actions
Class MatrixAction

java.lang.Object
  |
  +--quicktime.app.actions.PeriodicAction
        |
        +--quicktime.app.actions.MatrixAction
All Implemented Interfaces:
Targetable, Ticklish
Direct Known Subclasses:
BounceAction

Deprecated. since QTJava 6.1

public class MatrixAction
extends PeriodicAction
implements Targetable

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
          Deprecated. since QTJava 6.1
protected static int kBottomSide
          Deprecated. since QTJava 6.1
protected static int kLeftSide
          Deprecated. since QTJava 6.1
protected static int kRightSide
          Deprecated. since QTJava 6.1
protected static int kTopSide
          Deprecated. since QTJava 6.1
protected  Transformable target
          Deprecated. The target of the matrix transformations* @deprecated since QTJava 6.1
protected  TransformMatrix transMatrix
          Deprecated. This is the class that will do the transformations on the target's matrix * @deprecated since QTJava 6.1
 
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)
          Deprecated. since QTJava 6.1
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()
          Deprecated. since QTJava 6.1
protected  void doAction(float er, int t)
          Deprecated. since QTJava 6.1
 boolean equals(java.lang.Object obj)
          Deprecated. since QTJava 6.1
 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()
          Deprecated. 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

kLeftSide

protected static final int kLeftSide
Deprecated. since QTJava 6.1

These constants are used in the boundsReached call to indicate to the subclass which edge the target has collided with. Horizontal and Vertical sides are provided as a means for testing for both left and right, up and down respectively.

See Also:
Constant Field Values

kRightSide

protected static final int kRightSide
Deprecated. since QTJava 6.1

These constants are used in the boundsReached call to indicate to the subclass which edge the target has collided with. Horizontal and Vertical sides are provided as a means for testing for both left and right, up and down respectively.

See Also:
Constant Field Values

kTopSide

protected static final int kTopSide
Deprecated. since QTJava 6.1

These constants are used in the boundsReached call to indicate to the subclass which edge the target has collided with. Horizontal and Vertical sides are provided as a means for testing for both left and right, up and down respectively.

See Also:
Constant Field Values

kBottomSide

protected static final int kBottomSide
Deprecated. since QTJava 6.1

These constants are used in the boundsReached call to indicate to the subclass which edge the target has collided with. Horizontal and Vertical sides are provided as a means for testing for both left and right, up and down respectively.

See Also:
Constant Field Values

target

protected Transformable target
Deprecated. 
The target of the matrix transformations* @deprecated since QTJava 6.1


transMatrix

protected TransformMatrix transMatrix
Deprecated. 
This is the class that will do the transformations on the target's matrix * @deprecated since QTJava 6.1


doConstraintBoundsTesting

protected boolean doConstraintBoundsTesting
Deprecated. since QTJava 6.1

Set this boolean to true or false to perform bounds testing of the target within the bounds of its enclosing Space. Default is false. If true the enclosing Space must be specified.

Constructor Detail

MatrixAction

protected MatrixAction(int scale,
                       int period,
                       QTDrawable space,
                       Transformable t)
                throws QTException
Deprecated. since QTJava 4

Create a PeriodicAction that will act upon a Matrix.

Parameters:
scale - the amount with which a second is divided into at a rate of one
period - 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 deltaMatrix
See Also:
TransformMatrix

MatrixAction

public MatrixAction(int scale,
                    int period,
                    QTDisplaySpace space,
                    Transformable t,
                    TransformMatrix transformMatrixAction)
             throws QTException
Deprecated. since QTJava 6.1

Create a MatrixAction that will act upon a Matrix. It delegates the matrix transformation to the TransformMatrix object that is supplied in the constructor.

Parameters:
scale - the amount with which a second is divided into at a rate of one
period - 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 deltaMatrix
transformMatrixAction - the transformation that will be applied to the target's matrix every time this action is invoked.
Method Detail

setTarget

public void setTarget(java.lang.Object target)
Deprecated. since QTJava 4

Sets the target of the action. The target must be some kind of Transformable object.

Specified by:
setTarget in interface Targetable
Parameters:
target - a Transformable object
See Also:
TransformMatrix

getTarget

public java.lang.Object getTarget()
Deprecated. since QTJava 4

Returns the current target of the action.

Specified by:
getTarget in interface Targetable
Returns:
the current target
See Also:
TransformMatrix

getSpace

public QTDrawable getSpace()
Deprecated. since QTJava 4

The space which is the space that the transformable object is a member of.

Returns:
the enclosing space.
See Also:
TransformMatrix

setSpace

public void setSpace(QTDrawable space)
Deprecated. since QTJava 4

Set the space which is the space that the transformable target is a member of.

Parameters:
space - the enclosing space.
See Also:
TransformMatrix

doAction

protected void doAction(float er,
                        int t)
                 throws QTException
Deprecated. since QTJava 6.1

When called it performs three primary tasks: Once these tasks are performed the target's matrix is set to the transformed matrix through calling the setTargetMatrix with the transformed matrix.

Specified by:
doAction in class PeriodicAction
Parameters:
er - the rate at which the action was invoked.
t - the time at which the action was invoked.
QTException

rateDirectionChanged

protected void rateDirectionChanged(boolean forwards)
                             throws QTException
Deprecated. since QTJava 4

The Matrix action notifies subclasses when the rate at which an action is tickled changes from positive to negative or vice versa.

QTException
See Also:
TransformMatrix

transformMatrix

protected void transformMatrix(Matrix theMatrix)
                        throws QTException
Deprecated. since QTJava 4

The Matrix action calls the transformMatrix method with a Matrix that the subclass should transform according to the particular transformation of the subclass.

Parameters:
theMatrix - the matrix to transform.
QTException
See Also:
TransformMatrix

boundsReached

protected void boundsReached(int whichSide)
Deprecated. since QTJava 4

If the Matrix action is doing constraint bounds testing and a bounding condition is reached the Matrix action calls this method with one of four flags to indicate which side of the enclosing space the target collided with.

Parameters:
whichSide - a flag that indicates which side
See Also:
TransformMatrix

setTargetMatrix

protected void setTargetMatrix(Matrix transformedMatrix)
                        throws QTException
Deprecated. since QTJava 4

This method is invoked by the doAction method once the matrix has been transformed. The default behaviour of this method is to just call the target's setMatrix method with the transformed matrix.

Parameters:
transformedMatrix - the new matrix for the target
QTException
See Also:
TransformMatrix

constraintReached

protected boolean constraintReached()
Deprecated. since QTJava 6.1

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. How this is defined is determined totally by the subclass. This method will only be called by the tickle method if the Action has an Actionable actor.

Specified by:
constraintReached in class PeriodicAction
Returns:
true if the actionable object (if set) should be triggered

toString

public java.lang.String toString()
Deprecated. 
Return a string representation of this class. * @deprecated since QTJava 6.1

Overrides:
toString in class PeriodicAction
Returns:
a String

equals

public boolean equals(java.lang.Object obj)
Deprecated. since QTJava 6.1

Returns true if the incoming object is a Matrix action with the same target.

Overrides:
equals in class PeriodicAction
Parameters:
obj - the object to test
Returns:
true if equal, false if not