|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.geom.AffineTransform org.geotools.resources.geometry.XAffineTransform
Utility methods for affine transforms. This class provides a set
of public static methods working on any AffineTransform
.
Class overrides all mutable methods
of AffineTransform
in order to check for permission before
changing the transform's state. If checkPermission()
is
defined to always throw an exception, then
is immutable.
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 | |
protected |
XAffineTransform(java.awt.geom.AffineTransform tr)
Constructs a new that is a copy of the specified object. |
Method Summary | |
protected abstract void |
checkPermission()
Check if the caller is allowed to change this 's state. |
void |
concatenate(java.awt.geom.AffineTransform Tx)
Check for permission before concatenating this transform. |
static double |
getScale(java.awt.geom.AffineTransform zoom)
Returns a global scale factor for the specified affine transform. |
static java.awt.geom.AffineTransform |
getScaleInstance(double sx,
double sy,
double x,
double y)
Returns an affine transform representing a zoom carried out around a central point (x,y). |
static double |
getScaleX0(java.awt.geom.AffineTransform zoom)
Returns the scale factor x by cancelling the effect of an eventual rotation. |
static double |
getScaleY0(java.awt.geom.AffineTransform zoom)
Returns the scale factor y by cancelling the effect of an eventual rotation. |
static java.awt.geom.Point2D |
inverseDeltaTransform(java.awt.geom.AffineTransform transform,
java.awt.geom.Point2D source,
java.awt.geom.Point2D dest)
Calculates the inverse affine transform of a point without bearing in mind the translation. |
static java.awt.geom.Rectangle2D |
inverseTransform(java.awt.geom.AffineTransform transform,
java.awt.geom.Rectangle2D bounds,
java.awt.geom.Rectangle2D dest)
Returns a rectangle which entirely contains the inverse transform of . |
void |
preConcatenate(java.awt.geom.AffineTransform Tx)
Check for permission before concatenating this transform. |
void |
rotate(double theta)
Check for permission before rotating this transform. |
void |
rotate(double theta,
double x,
double y)
Check for permission before rotating this transform. |
static void |
round(java.awt.geom.AffineTransform zoom)
|
void |
scale(double sx,
double sy)
Check for permission before scaling this transform. |
void |
setToIdentity()
Check for permission before setting this transform. |
void |
setToRotation(double theta)
Check for permission before setting this transform. |
void |
setToRotation(double theta,
double x,
double y)
Check for permission before setting this transform. |
void |
setToScale(double sx,
double sy)
Check for permission before setting this transform. |
void |
setToShear(double shx,
double shy)
Check for permission before setting this transform. |
void |
setToTranslation(double tx,
double ty)
Check for permission before setting this transform. |
void |
setTransform(java.awt.geom.AffineTransform Tx)
Check for permission before setting this transform. |
void |
setTransform(double m00,
double m10,
double m01,
double m11,
double m02,
double m12)
Check for permission before setting this transform. |
void |
shear(double shx,
double shy)
Check for permission before shearing this transform. |
static java.awt.geom.Rectangle2D |
transform(java.awt.geom.AffineTransform transform,
java.awt.geom.Rectangle2D bounds,
java.awt.geom.Rectangle2D dest)
Returns a rectangle which entirely contains the direct transform of . |
void |
translate(double tx,
double ty)
Check for permission before translating this transform. |
Methods inherited from class java.awt.geom.AffineTransform |
clone, createInverse, createTransformedShape, deltaTransform, deltaTransform, equals, getDeterminant, getMatrix, getRotateInstance, getRotateInstance, getScaleInstance, getScaleX, getScaleY, getShearInstance, getShearX, getShearY, getTranslateInstance, getTranslateX, getTranslateY, getType, hashCode, inverseTransform, inverseTransform, isIdentity, toString, transform, transform, transform, transform, transform, transform |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected XAffineTransform(java.awt.geom.AffineTransform tr)
Method Detail |
protected abstract void checkPermission()
public void translate(double tx, double ty)
public void rotate(double theta)
public void rotate(double theta, double x, double y)
public void scale(double sx, double sy)
public void shear(double shx, double shy)
public void setToIdentity()
public void setToTranslation(double tx, double ty)
public void setToRotation(double theta)
public void setToRotation(double theta, double x, double y)
public void setToScale(double sx, double sy)
public void setToShear(double shx, double shy)
public void setTransform(java.awt.geom.AffineTransform Tx)
public void setTransform(double m00, double m10, double m01, double m11, double m02, double m12)
public void concatenate(java.awt.geom.AffineTransform Tx)
public void preConcatenate(java.awt.geom.AffineTransform Tx)
public static java.awt.geom.Rectangle2D transform(java.awt.geom.AffineTransform transform, java.awt.geom.Rectangle2D bounds, java.awt.geom.Rectangle2D dest)
transform
- Affine transform to use.bounds
- Rectangle to transform. This rectangle will not be
modified.dest
- Rectangle in which to place the result. If null, a new
rectangle will be created.
public static java.awt.geom.Rectangle2D inverseTransform(java.awt.geom.AffineTransform transform, java.awt.geom.Rectangle2D bounds, java.awt.geom.Rectangle2D dest) throws java.awt.geom.NoninvertibleTransformException
transform
- Affine transform to use.bounds
- Rectangle to transform. This rectangle will not be
modified.dest
- Rectangle in which to place the result. If null, a new
rectangle will be created.
java.awt.geom.NoninvertibleTransformException
- if the affine transform can't be
inverted.public static java.awt.geom.Point2D inverseDeltaTransform(java.awt.geom.AffineTransform transform, java.awt.geom.Point2D source, java.awt.geom.Point2D dest) throws java.awt.geom.NoninvertibleTransformException
transform
- Affine transform to use.source
- Point to transform. This rectangle will not be modified.dest
- Point in which to place the result. If null, a new
point will be created.
java.awt.geom.NoninvertibleTransformException
- if the affine transform can't be
inverted.public static double getScaleX0(java.awt.geom.AffineTransform zoom)
public static double getScaleY0(java.awt.geom.AffineTransform zoom)
public static double getScale(java.awt.geom.AffineTransform zoom)
getScaleX0(java.awt.geom.AffineTransform)
and getScaleY0(java.awt.geom.AffineTransform)
.
The way to compute such a "global" scale is somewhat arbitrary and may change
in a future version.
public static java.awt.geom.AffineTransform getScaleInstance(double sx, double sy, double x, double y)
sx
- Scale along x axis.sy
- Scale along y axis.x
- x coordinates of the central point.y
- y coordinates of the central point.
public static void round(java.awt.geom.AffineTransform zoom)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |