|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.AffineTransform
edu.umd.cs.piccolo.util.PAffineTransform
public class PAffineTransform
PAffineTransform is a subclass of AffineTransform that has been extended with convenience methods.
Field Summary |
---|
Fields inherited from class java.awt.geom.AffineTransform |
---|
TYPE_FLIP, TYPE_GENERAL_ROTATION, TYPE_GENERAL_SCALE, TYPE_GENERAL_TRANSFORM, TYPE_IDENTITY, TYPE_MASK_ROTATION, TYPE_MASK_SCALE, TYPE_QUADRANT_ROTATION, TYPE_TRANSLATION, TYPE_UNIFORM_SCALE |
Constructor Summary | |
---|---|
PAffineTransform()
Constructs a new AffineTransform representing the Identity transformation. |
|
PAffineTransform(AffineTransform tx)
Constructs a new AffineTransform that is a copy of the specified AffineTransform object. |
|
PAffineTransform(double[] flatmatrix)
Constructs a new AffineTransform from an array of double precision values representing either the 4 non-translation entries or the 6 specifiable entries of the 3x3 transformation matrix. |
|
PAffineTransform(double m00,
double m10,
double m01,
double m11,
double m02,
double m12)
Constructs a new AffineTransform from 6 double precision values representing the 6 specifiable entries of the 3x3 transformation matrix. |
|
PAffineTransform(float[] flatmatrix)
Constructs a new AffineTransform from an array of floating point values representing either the 4 non-translation entries or the 6 specifiable entries of the 3x3 transformation matrix. |
|
PAffineTransform(float m00,
float m10,
float m01,
float m11,
float m02,
float m12)
Constructs a new AffineTransform from 6 floating point values representing the 6 specifiable entries of the 3x3 transformation matrix. |
Method Summary | |
---|---|
double |
getRotation()
Returns the rotation applied to this affine transform in radians. |
double |
getScale()
Returns the scale applied to this transform. |
Dimension2D |
inverseTransform(Dimension2D dimSrc,
Dimension2D dimDst)
Applies the inverse of this transform to the source dimension if possible. |
Point2D |
inverseTransform(Point2D ptSrc,
Point2D ptDst)
Applies the inverse of this transform to the source point if possible. |
Rectangle2D |
inverseTransform(Rectangle2D rectSrc,
Rectangle2D rectDst)
Applies the inverse of this transform to the source rectangle and stores the result in rectDst. |
void |
scaleAboutPoint(double scale,
double x,
double y)
Scales the transform about the given point by the given scale. |
void |
setOffset(double tx,
double ty)
Applies modifies the transform so that it translates by the given offset. |
void |
setRotation(double theta)
Set rotation in radians. |
void |
setScale(double scale)
Sets the scale about to the origin of this transform to the scale provided. |
Dimension2D |
transform(Dimension2D dimSrc,
Dimension2D dimDst)
Applies the transform to the provided dimension. |
Rectangle2D |
transform(Rectangle2D rectSrc,
Rectangle2D rectDst)
Applies this transform to the source rectangle and stores the result in rectDst. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PAffineTransform()
public PAffineTransform(double[] flatmatrix)
flatmatrix
- the double array containing the values to be set in the
new AffineTransform object. The length of the array is assumed
to be at least 4. If the length of the array is less than 6,
only the first 4 values are taken. If the length of the array
is greater than 6, the first 6 values are taken.public PAffineTransform(float[] flatmatrix)
flatmatrix
- the float array containing the values to be set in the
new AffineTransform object. The length of the array is assumed
to be at least 4. If the length of the array is less than 6,
only the first 4 values are taken. If the length of the array
is greater than 6, the first 6 values are taken.public PAffineTransform(double m00, double m10, double m01, double m11, double m02, double m12)
m00
- the X coordinate scaling element of the 3x3 matrixm10
- the Y coordinate shearing element of the 3x3 matrixm01
- the X coordinate shearing element of the 3x3 matrixm11
- the Y coordinate scaling element of the 3x3 matrixm02
- the X coordinate translation element of the 3x3 matrixm12
- the Y coordinate translation element of the 3x3 matrixpublic PAffineTransform(float m00, float m10, float m01, float m11, float m02, float m12)
m00
- the X coordinate scaling element of the 3x3 matrixm10
- the Y coordinate shearing element of the 3x3 matrixm01
- the X coordinate shearing element of the 3x3 matrixm11
- the Y coordinate scaling element of the 3x3 matrixm02
- the X coordinate translation element of the 3x3 matrixm12
- the Y coordinate translation element of the 3x3 matrixpublic PAffineTransform(AffineTransform tx)
tx
- transform to copyMethod Detail |
---|
public void scaleAboutPoint(double scale, double x, double y)
scale
- to transform the transform byx
- x coordinate around which the scale should take placey
- y coordinate around which the scale should take placepublic double getScale()
public void setScale(double scale)
scale
- The desired resulting scalepublic void setOffset(double tx, double ty)
tx
- x translation of resulting transformty
- y translation of resulting transformpublic double getRotation()
public void setRotation(double theta)
theta
- desired rotation in radians.public Dimension2D transform(Dimension2D dimSrc, Dimension2D dimDst)
dimSrc
- source dimensiondimDst
- will be changed to be the transformed dimension, may be
null
public Point2D inverseTransform(Point2D ptSrc, Point2D ptDst)
inverseTransform
in class AffineTransform
ptSrc
- point to be transformedptDst
- result of transform will be placed in this point
public Dimension2D inverseTransform(Dimension2D dimSrc, Dimension2D dimDst)
dimSrc
- dimension to be transformeddimDst
- result of transform will be placed in this dimension
public Rectangle2D transform(Rectangle2D rectSrc, Rectangle2D rectDst)
rectSrc
- rectangle to be transformedrectDst
- result of transform will be placed in this rectangle
public Rectangle2D inverseTransform(Rectangle2D rectSrc, Rectangle2D rectDst)
rectSrc
- rectangle to be transformedrectDst
- result of transform will be placed in this rectangle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |