Java Doc for XAffineTransform.java in  » GIS » GeoTools-2.4.1 » org » geotools » referencing » operation » matrix » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.referencing.operation.matrix 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.geom.AffineTransform
      org.geotools.referencing.operation.matrix.XAffineTransform

All known Subclasses:   org.geotools.referencing.operation.transform.AffineTransform2D,
XAffineTransform
abstract public class XAffineTransform extends AffineTransform (Code)
Utility methods for affine transforms. This class provides two kind of services:
  • A set of public static methods working on any AffineTransform .

  • An abstract base class that override all mutable AffineTransform methods in order to check for permission before changing the transform's state. If XAffineTransform.checkPermission is defined to always throw an exception, then XAffineTransform is immutable.


since:
   2.3
version:
   $Id: XAffineTransform.java 26030 2007-06-26 14:55:47Z desruisseaux $
author:
   Martin Desruisseaux
author:
   Simone Giannecchini


Field Summary
final public static  doubleEPS
     Tolerance value for floating point comparisons.

Constructor Summary
protected  XAffineTransform(AffineTransform tr)
     Constructs a new XAffineTransform that is a copy of the specified AffineTransform object.

Method Summary
abstract protected  voidcheckPermission()
     Check if the caller is allowed to change this XAffineTransform state.
public  voidconcatenate(AffineTransform Tx)
     Check for before concatenating this transform.
public static  intgetFlip(AffineTransform tr)
     Returns -1 if one axis has been flipped, +1 if no axis has been flipped, or 0 if unknown.
public static  doublegetRotation(AffineTransform tr)
     Returns an estimation of the rotation angle in radians.
public static  doublegetScale(AffineTransform tr)
     Returns a global scale factor for the specified affine transform.
public static  AffineTransformgetScaleInstance(double sx, double sy, double x, double y)
     Returns an affine transform representing a zoom carried out around a central point (x, y).
public static  doublegetScaleX0(AffineTransform tr)
     Returns the magnitude of scale factor x by cancelling the effect of eventual flip and rotation.
public static  doublegetScaleY0(AffineTransform tr)
     Returns the magnitude of scale factor y by cancelling the effect of eventual flip and rotation.
public static  intgetSwapXY(AffineTransform tr)
     Returns an estimation about whatever the specified transform swaps x and y axis.
public static  Point2DinverseDeltaTransform(AffineTransform transform, Point2D source, Point2D dest)
     Calculates the inverse affine transform of a point without without applying the translation components.
Parameters:
  transform - Affine transform to use.
Parameters:
  source - Point to transform.
public static  Rectangle2DinverseTransform(AffineTransform transform, Rectangle2D bounds, Rectangle2D dest)
     Returns a rectangle which entirely contains the inverse transform of bounds .
public  booleanisIdentity(double tolerance)
     Check whether or not this XAffineTransform is the identity by using the provided tolerance .
Parameters:
  tolerance - The tolerance to use for this check.
public static  booleanisIdentity(AffineTransform tr, double tolerance)
     Returns true if the specified affine transform is an identity transform up to the specified tolerance.
public  voidpreConcatenate(AffineTransform Tx)
     Check for before concatenating this transform.
public  voidrotate(double theta)
     Check for before rotating this transform.
public  voidrotate(double theta, double x, double y)
     Check for before rotating this transform.
public static  voidround(AffineTransform tr)
     Checks whether the matrix coefficients are close to whole numbers. If this is the case, these coefficients will be rounded up to the nearest whole numbers.
public static  voidround(AffineTransform tr, double tolerance)
     Checks whether the matrix coefficients are close to whole numbers. If this is the case, these coefficients will be rounded up to the nearest whole numbers.
public  voidscale(double sx, double sy)
     Check for before scaling this transform.
public  voidsetToIdentity()
     Check for before setting this transform.
public  voidsetToRotation(double theta)
     Check for before setting this transform.
public  voidsetToRotation(double theta, double x, double y)
     Check for before setting this transform.
public  voidsetToScale(double sx, double sy)
     Check for before setting this transform.
public  voidsetToShear(double shx, double shy)
     Check for before setting this transform.
public  voidsetToTranslation(double tx, double ty)
     Check for before setting this transform.
public  voidsetTransform(AffineTransform Tx)
     Check for before setting this transform.
public  voidsetTransform(double m00, double m10, double m01, double m11, double m02, double m12)
     Check for before setting this transform.
public  voidshear(double shx, double shy)
     Check for before shearing this transform.
public static  Rectangle2Dtransform(AffineTransform transform, Rectangle2D bounds, Rectangle2D dest)
     Returns a rectangle which entirely contains the direct transform of bounds .
public  voidtranslate(double tx, double ty)
     Check for before translating this transform.

Field Detail
EPS
final public static double EPS(Code)
Tolerance value for floating point comparisons. XAffineTransform.round(AffineTransform)XAffineTransform.round(AffineTransform,double)




Constructor Detail
XAffineTransform
protected XAffineTransform(AffineTransform tr)(Code)
Constructs a new XAffineTransform that is a copy of the specified AffineTransform object.




Method Detail
checkPermission
abstract protected void checkPermission()(Code)
Check if the caller is allowed to change this XAffineTransform state. If this method is defined to thrown an exception in all case, then this XAffineTransform is immutable.



concatenate
public void concatenate(AffineTransform Tx)(Code)
Check for before concatenating this transform.



getFlip
public static int getFlip(AffineTransform tr)(Code)
Returns -1 if one axis has been flipped, +1 if no axis has been flipped, or 0 if unknown. A flipped axis in an axis with direction reversed (typically the y axis). This method assumes that the specified affine transform is built from arbitrary translations, scales or rotations, but no shear. Note that it is not possible to determine which of the x or y axis has been flipped.

This method can be used in order to set the sign of a scale according the flipping state. The example below choose to apply the sign on the y scale, but this is an arbitrary (while common) choice:

double scaleX0 = getScaleX0(transform); double scaleY0 = getScaleY0(transform); int flip = getFlip(transform); if (flip != 0) { scaleY0 *= flip; // ... continue the process here. }
This method is similar to the following code, except that this method distinguish between "unflipped" and "unknow" states.
boolean flipped = (tr. & ) != 0;



getRotation
public static double getRotation(AffineTransform tr)(Code)
Returns an estimation of the rotation angle in radians. This method assumes that the specified affine transform is built from arbitrary translations, scales or rotations, but no shear. If a flip has been applied, then this method assumes that the flipped axis is the y one in source CRS space. For a grid to world CRS transform, this is the row number in grid coordinates.
Parameters:
  tr - The affine transform to inspect. An estimation of the rotation angle in radians, or Double.NaN NaNif the angle can not be estimated.



getScale
public static double getScale(AffineTransform tr)(Code)
Returns a global scale factor for the specified affine transform. This scale factor will combines XAffineTransform.getScaleX0 and XAffineTransform.getScaleY0 . The way to compute such a "global" scale is somewhat arbitrary and may change in a future version.



getScaleInstance
public static AffineTransform getScaleInstance(double sx, double sy, double x, double y)(Code)
Returns an affine transform representing a zoom carried out around a central point (x, y). The transforms will leave the specified (x, y) coordinate unchanged.
Parameters:
  sx - Scale along x axis.
Parameters:
  sy - Scale along y axis.
Parameters:
  x - x coordinates of the central point.
Parameters:
  y - y coordinates of the central point. Affine transform of a zoom which leaves the(x,y) coordinate unchanged.



getScaleX0
public static double getScaleX0(AffineTransform tr)(Code)
Returns the magnitude of scale factor x by cancelling the effect of eventual flip and rotation. This factor is calculated by .



getScaleY0
public static double getScaleY0(AffineTransform tr)(Code)
Returns the magnitude of scale factor y by cancelling the effect of eventual flip and rotation. This factor is calculated by .



getSwapXY
public static int getSwapXY(AffineTransform tr)(Code)
Returns an estimation about whatever the specified transform swaps x and y axis. This method assumes that the specified affine transform is built from arbitrary translations, scales or rotations, but no shear. It returns +1 if the (x, y) axis order seems to be preserved, -1 if the transform seems to swap axis to the (y, x) axis order, or 0 if this method can not make a decision.



inverseDeltaTransform
public static Point2D inverseDeltaTransform(AffineTransform transform, Point2D source, Point2D dest) throws NoninvertibleTransformException(Code)
Calculates the inverse affine transform of a point without without applying the translation components.
Parameters:
  transform - Affine transform to use.
Parameters:
  source - Point to transform. This rectangle will not be modified.
Parameters:
  dest - Point in which to place the result. If null , anew point will be created. The inverse transform of the source point.
throws:
  NoninvertibleTransformException - if the affine transform can't be inverted.



inverseTransform
public static Rectangle2D inverseTransform(AffineTransform transform, Rectangle2D bounds, Rectangle2D dest) throws NoninvertibleTransformException(Code)
Returns a rectangle which entirely contains the inverse transform of bounds . This operation is equivalent to:
. (bounds).

Parameters:
  transform - Affine transform to use.
Parameters:
  bounds - Rectangle to transform. This rectangle will not be modified.
Parameters:
  dest - Rectangle in which to place the result. If null, a newrectangle will be created. The inverse transform of the bounds rectangle.
throws:
  NoninvertibleTransformException - if the affine transform can't be inverted.



isIdentity
public boolean isIdentity(double tolerance)(Code)
Check whether or not this XAffineTransform is the identity by using the provided tolerance .
Parameters:
  tolerance - The tolerance to use for this check. true if the transform is identity, false otherwise.
since:
   2.3.1



isIdentity
public static boolean isIdentity(AffineTransform tr, double tolerance)(Code)
Returns true if the specified affine transform is an identity transform up to the specified tolerance. This method is equivalent to computing the difference between this matrix and an identity matrix (as created by AffineTransform.AffineTransformnew AffineTransform() ) and returning true if and only if all differences are smaller than or equal to tolerance .

This method is used for working around rounding error in affine transforms resulting from a computation, as in the example below:

 [ 1.0000000000000000001  0.0                      0.0 ]
 [ 0.0                    0.999999999999999999999  0.0 ]
 [ 0.0                    0.0                      1.0 ]
 

Parameters:
  tr - The affine transform to be checked for identity.
Parameters:
  tolerance - The tolerance value to use when checking for identity.return true if this tranformation is close enough to theidentity, false otherwise.
since:
   2.3.1



preConcatenate
public void preConcatenate(AffineTransform Tx)(Code)
Check for before concatenating this transform.



rotate
public void rotate(double theta)(Code)
Check for before rotating this transform.



rotate
public void rotate(double theta, double x, double y)(Code)
Check for before rotating this transform.



round
public static void round(AffineTransform tr)(Code)
Checks whether the matrix coefficients are close to whole numbers. If this is the case, these coefficients will be rounded up to the nearest whole numbers. This rounding up is useful, for example, for speeding up image displays. Above all, it is efficient when we know that a matrix has a chance of being close to the similarity matrix.

It is crucial to note that this method uses a default rounding threshold whose value is held by the field XAffineTransform.EPS which is . XAffineTransform.round(AffineTransform,double)




round
public static void round(AffineTransform tr, double tolerance)(Code)
Checks whether the matrix coefficients are close to whole numbers. If this is the case, these coefficients will be rounded up to the nearest whole numbers. This rounding up is useful, for example, for speeding up image displays. Above all, it is efficient when we know that a matrix has a chance of being close to the similarity matrix.
Parameters:
  tr - The matrix to round. Rounding will be applied in place.
Parameters:
  tolerance - The maximal departure from integers in order to allow rounding.It is typically a small number like 1E-6 .
since:
   2.3.1



scale
public void scale(double sx, double sy)(Code)
Check for before scaling this transform.



setToIdentity
public void setToIdentity()(Code)
Check for before setting this transform.



setToRotation
public void setToRotation(double theta)(Code)
Check for before setting this transform.



setToRotation
public void setToRotation(double theta, double x, double y)(Code)
Check for before setting this transform.



setToScale
public void setToScale(double sx, double sy)(Code)
Check for before setting this transform.



setToShear
public void setToShear(double shx, double shy)(Code)
Check for before setting this transform.



setToTranslation
public void setToTranslation(double tx, double ty)(Code)
Check for before setting this transform.



setTransform
public void setTransform(AffineTransform Tx)(Code)
Check for before setting this transform.



setTransform
public void setTransform(double m00, double m10, double m01, double m11, double m02, double m12)(Code)
Check for before setting this transform.



shear
public void shear(double shx, double shy)(Code)
Check for before shearing this transform.



transform
public static Rectangle2D transform(AffineTransform transform, Rectangle2D bounds, Rectangle2D dest)(Code)
Returns a rectangle which entirely contains the direct transform of bounds . This operation is equivalent to:
(bounds).

Parameters:
  transform - Affine transform to use.
Parameters:
  bounds - Rectangle to transform. This rectangle will not be modified.
Parameters:
  dest - Rectangle in which to place the result. If null, a newrectangle will be created. The direct transform of the bounds rectangle.



translate
public void translate(double tx, double ty)(Code)
Check for before translating this transform.



Fields inherited from java.awt.geom.AffineTransform
final public static int TYPE_FLIP(Code)(Java Doc)
final public static int TYPE_GENERAL_ROTATION(Code)(Java Doc)
final public static int TYPE_GENERAL_SCALE(Code)(Java Doc)
final public static int TYPE_GENERAL_TRANSFORM(Code)(Java Doc)
final public static int TYPE_IDENTITY(Code)(Java Doc)
final public static int TYPE_MASK_ROTATION(Code)(Java Doc)
final public static int TYPE_MASK_SCALE(Code)(Java Doc)
final public static int TYPE_QUADRANT_ROTATION(Code)(Java Doc)
final public static int TYPE_TRANSLATION(Code)(Java Doc)
final public static int TYPE_UNIFORM_SCALE(Code)(Java Doc)

Methods inherited from java.awt.geom.AffineTransform
public Object clone()(Code)(Java Doc)
public void concatenate(AffineTransform Tx)(Code)(Java Doc)
public AffineTransform createInverse() throws NoninvertibleTransformException(Code)(Java Doc)
public Shape createTransformedShape(Shape pSrc)(Code)(Java Doc)
public Point2D deltaTransform(Point2D ptSrc, Point2D ptDst)(Code)(Java Doc)
public void deltaTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
public double getDeterminant()(Code)(Java Doc)
public void getMatrix(double[] flatmatrix)(Code)(Java Doc)
public static AffineTransform getQuadrantRotateInstance(int numquadrants)(Code)(Java Doc)
public static AffineTransform getQuadrantRotateInstance(int numquadrants, double anchorx, double anchory)(Code)(Java Doc)
public static AffineTransform getRotateInstance(double theta)(Code)(Java Doc)
public static AffineTransform getRotateInstance(double theta, double anchorx, double anchory)(Code)(Java Doc)
public static AffineTransform getRotateInstance(double vecx, double vecy)(Code)(Java Doc)
public static AffineTransform getRotateInstance(double vecx, double vecy, double anchorx, double anchory)(Code)(Java Doc)
public static AffineTransform getScaleInstance(double sx, double sy)(Code)(Java Doc)
public double getScaleX()(Code)(Java Doc)
public double getScaleY()(Code)(Java Doc)
public static AffineTransform getShearInstance(double shx, double shy)(Code)(Java Doc)
public double getShearX()(Code)(Java Doc)
public double getShearY()(Code)(Java Doc)
public static AffineTransform getTranslateInstance(double tx, double ty)(Code)(Java Doc)
public double getTranslateX()(Code)(Java Doc)
public double getTranslateY()(Code)(Java Doc)
public int getType()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public Point2D inverseTransform(Point2D ptSrc, Point2D ptDst) throws NoninvertibleTransformException(Code)(Java Doc)
public void inverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws NoninvertibleTransformException(Code)(Java Doc)
public void invert() throws NoninvertibleTransformException(Code)(Java Doc)
public boolean isIdentity()(Code)(Java Doc)
public void preConcatenate(AffineTransform Tx)(Code)(Java Doc)
public void quadrantRotate(int numquadrants)(Code)(Java Doc)
public void quadrantRotate(int numquadrants, double anchorx, double anchory)(Code)(Java Doc)
public void rotate(double theta)(Code)(Java Doc)
public void rotate(double theta, double anchorx, double anchory)(Code)(Java Doc)
public void rotate(double vecx, double vecy)(Code)(Java Doc)
public void rotate(double vecx, double vecy, double anchorx, double anchory)(Code)(Java Doc)
public void scale(double sx, double sy)(Code)(Java Doc)
public void setToIdentity()(Code)(Java Doc)
public void setToQuadrantRotation(int numquadrants)(Code)(Java Doc)
public void setToQuadrantRotation(int numquadrants, double anchorx, double anchory)(Code)(Java Doc)
public void setToRotation(double theta)(Code)(Java Doc)
public void setToRotation(double theta, double anchorx, double anchory)(Code)(Java Doc)
public void setToRotation(double vecx, double vecy)(Code)(Java Doc)
public void setToRotation(double vecx, double vecy, double anchorx, double anchory)(Code)(Java Doc)
public void setToScale(double sx, double sy)(Code)(Java Doc)
public void setToShear(double shx, double shy)(Code)(Java Doc)
public void setToTranslation(double tx, double ty)(Code)(Java Doc)
public void setTransform(AffineTransform Tx)(Code)(Java Doc)
public void setTransform(double m00, double m10, double m01, double m11, double m02, double m12)(Code)(Java Doc)
public void shear(double shx, double shy)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public Point2D transform(Point2D ptSrc, Point2D ptDst)(Code)(Java Doc)
public void transform(Point2D[] ptSrc, int srcOff, Point2D[] ptDst, int dstOff, int numPts)(Code)(Java Doc)
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)(Code)(Java Doc)
public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)(Code)(Java Doc)
public void transform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)(Code)(Java Doc)
public void transform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)(Code)(Java Doc)
public void translate(double tx, double ty)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.