|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.app.actions.TransformMatrix
This class provides a standard mechanism for applying matrix manipulations to a Transformable target and supporting constraint bounding of the target's location after its matrix is altered.
The class presents two modes of operations, depending on which initialize and transformMatrix methods are applied and the class is generally used with this pairing. The notes for the initialize and transformMatrix methods document these usages.
A subclass defines the abstract methods to apply the particular transformation logic that they want to apply. If the kNoConstraint flag is applied then no constraints testing is done to keep the specified Transformable target constrained within the bounds of its enclosing space.
Field Summary | |
protected static int |
kBottomSide
Used to nofify subclasses that the applied transformations have exceeded one of the sides of the enclosing space of the Transformable target. |
static int |
kConstraintSpecifiedAll
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstraintSpecifiedBottom
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstraintSpecifiedHorizontal
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstraintSpecifiedLeft
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstraintSpecifiedRight
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstraintSpecifiedTop
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstraintSpecifiedVertical
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstrainWithinAll
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstrainWithinBottom
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstrainWithinHorizontal
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstrainWithinLeft
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstrainWithinRight
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstrainWithinTop
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
static int |
kConstrainWithinVertical
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
protected static int |
kLeftSide
Used to nofify subclasses that the applied transformations have exceeded one of the sides of the enclosing space of the Transformable target. |
static int |
kNoConstraint
Use these as constraint flags to restrict transformations that relocated the the target within its space. |
protected static int |
kRightSide
Used to nofify subclasses that the applied transformations have exceeded one of the sides of the enclosing space of the Transformable target. |
protected static int |
kTopSide
Used to nofify subclasses that the applied transformations have exceeded one of the sides of the enclosing space of the Transformable target. |
int |
specifiedBottomConstraint
Specify the number of pixels that the target is constrained to when it is positioned beyond the bottom side. |
int |
specifiedLeftConstraint
Specify the number of pixels that the target is constrained to when it is positioned beyond the left hand side. |
int |
specifiedRightConstraint
Specify the number of pixels that the target is constrained to when it is positioned beyond the right hand side. |
int |
specifiedTopConstraint
Specify the number of pixels that the target is constrained to when it is positioned beyond the top side. |
protected Transformable |
target
This is the Transformable target (which MUST be a member of the space) of the TransformMatrix action. |
Constructor Summary | |
protected |
TransformMatrix()
Create a TransformMatrix class |
Method Summary | |
protected void |
boundsReached(int whichSide)
This method is called whenever a constraints test hits one of the sides of the enclosing space. |
protected abstract void |
doTransformation(Matrix theMatrix)
Applies the transformation of the Matrix. |
protected abstract void |
doTransformation(Matrix theMatrix,
int deltaX,
int deltaY)
Applies the transformation of the Matrix. |
boolean |
equals(java.lang.Object obj)
Returns true if the incoming object is a Matrix action with the same target. |
void |
flipTransformationSettings()
If a subclass is applying specified transformations to a matrix, then it should negate the value of these pre-defined transformation values. |
int |
getConstraint()
Returns the current constraint setting |
Transformable |
getTarget()
|
void |
initialize(QTDisplaySpace space,
Transformable memberTarget)
This method is called to initialize the TransformMatrix operation. |
void |
initialize(QTDisplaySpace space,
Transformable memberTarget,
int x,
int y)
This method is called to initialize the TransformMatrix operation. |
void |
setConstraint(int flag)
Using the constrain constants transformation of the target's matrix can be constrained in any direction. |
java.lang.String |
toString()
Return a string representation of this class. |
boolean |
transformTarget()
This method will apply the transformation matrix to the target. |
boolean |
transformTarget(int newX,
int newY)
This method will apply the transformation matrix to the target. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final int kLeftSide
protected static final int kRightSide
protected static final int kTopSide
protected static final int kBottomSide
public static final int kNoConstraint
public static final int kConstrainWithinLeft
public static final int kConstrainWithinRight
public static final int kConstrainWithinTop
public static final int kConstrainWithinBottom
public static final int kConstrainWithinHorizontal
public static final int kConstrainWithinVertical
public static final int kConstrainWithinAll
public static final int kConstraintSpecifiedLeft
public static final int kConstraintSpecifiedRight
public static final int kConstraintSpecifiedTop
public static final int kConstraintSpecifiedBottom
public static final int kConstraintSpecifiedHorizontal
public static final int kConstraintSpecifiedVertical
public static final int kConstraintSpecifiedAll
protected Transformable target
public int specifiedRightConstraint
public int specifiedLeftConstraint
public int specifiedTopConstraint
public int specifiedBottomConstraint
Constructor Detail |
protected TransformMatrix()
Method Detail |
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 testpublic Transformable getTarget()
public void setConstraint(int flag)
flag
- constraint flagpublic int getConstraint()
public void initialize(QTDisplaySpace space, Transformable memberTarget) throws QTException
The TransformMatrix operation need only be initialized when the space itself changes its size.
space
- the space which the Transformable object is a member of.target
- the target member of the specified space.public void initialize(QTDisplaySpace space, Transformable memberTarget, int x, int y) throws QTException
space
- the space which the Transformable object is a member of.target
- the target member of the specified space.x
- the x-origin about which the transformation is applied. In consequent calls to the
transformMatrix (Matrix, int deltaX, int deltaY) method, the deltaX value is a delta from this specified origin.y
- the y-origin about which the transformation is applied. In consequent calls to the
transformMatrix (Matrix, int deltaX, int deltaY) method, the deltaY value is a delta from this specified origin.public boolean transformTarget() throws QTException
public boolean transformTarget(int newX, int newY) throws QTException
newX
- the new x position expressed in the local coordinates of the space.newY
- the new y position expressed in the local coordinates of the space.public void flipTransformationSettings()
protected abstract void doTransformation(Matrix theMatrix, int deltaX, int deltaY) throws QTException
theMatrix
- The matrix handed in is the original matrix of the target when the TransformMatrix object was initialized.deltaX
- the difference between the original x point when the TransformMatrix object was initialized and the current location.deltaY
- the difference between the original y point when the TransformMatrix object was initialized and the current location.protected abstract void doTransformation(Matrix theMatrix) throws QTException
theMatrix
- The matrix handed in is the current matrix of the target.protected void boundsReached(int whichSide)
whichSide
- indicates which side the constraints test hit.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |