java.awt.geom

Class AffineTransform

Implemented Interfaces:
Cloneable, Serializable

public class AffineTransform
extends Object
implements Cloneable, Serializable

The AffineTransform class represents a 2D affine transform that performs a linear mapping from 2D coordinates to other 2D coordinates that preserves the "straightness" and "parallelness" of lines. Affine transformations can be constructed using sequences of translations, scales, flips, rotations, and shears.

Such a coordinate transformation can be represented by a 3 row by 3 column matrix with an implied last row of [ 0 0 1 ]. This matrix transforms source coordinates (x, y) into destination coordinates (x', y') by considering them to be a column vector and multiplying the coordinate vector by the matrix according to the following process:

	[ x']   [  m00  m01  m02  ] [ x ]   [ m00x + m01y + m02 ]
	[ y'] = [  m10  m11  m12  ] [ y ] = [ m10x + m11y + m12 ]
	[ 1 ]   [   0    0    1   ] [ 1 ]   [         1         ]
 
See Also:
Serialized Form

Field Summary

static int
TYPE_FLIP
This flag bit indicates that the transform defined by this object performs a mirror image flip about some axis which changes the normally right handed coordinate system into a left handed system in addition to the conversions indicated by other flag bits.
static int
TYPE_GENERAL_ROTATION
This flag bit indicates that the transform defined by this object performs a rotation by an arbitrary angle in addition to the conversions indicated by other flag bits.
static int
TYPE_GENERAL_SCALE
This flag bit indicates that the transform defined by this object performs a general scale in addition to the conversions indicated by other flag bits.
static int
TYPE_GENERAL_TRANSFORM
This constant indicates that the transform defined by this object performs an arbitrary conversion of the input coordinates.
static int
TYPE_IDENTITY
This constant indicates that the transform defined by this object is an identity transform.
static int
TYPE_MASK_ROTATION
This constant is a bit mask for any of the rotation flag bits.
static int
TYPE_MASK_SCALE
This constant is a bit mask for any of the scale flag bits.
static int
TYPE_QUADRANT_ROTATION
This flag bit indicates that the transform defined by this object performs a quadrant rotation by some multiple of 90 degrees in addition to the conversions indicated by other flag bits.
static int
TYPE_TRANSLATION
This flag bit indicates that the transform defined by this object performs a translation in addition to the conversions indicated by other flag bits.
static int
TYPE_UNIFORM_SCALE
This flag bit indicates that the transform defined by this object performs a uniform scale in addition to the conversions indicated by other flag bits.

Constructor Summary

AffineTransform()
Constructs a new AffineTransform representing the Identity transformation.
AffineTransform(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.
AffineTransform(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.
AffineTransform(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.
AffineTransform(float[] flatmatrix)
Constructs a new AffineTransform from an array of floating point values representing either the 4 non-translation enries or the 6 specifiable entries of the 3x3 transformation matrix.
AffineTransform(AffineTransform Tx)
Constructs a new AffineTransform that is a copy of the specified AffineTransform object.

Method Summary

Object
clone()
Returns a copy of this AffineTransform object.
void
concatenate(AffineTransform Tx)
Concatenates an AffineTransform Tx to this AffineTransform Cx in the most commonly useful way to provide a new user space that is mapped to the former user space by Tx.
AffineTransform
createInverse()
Returns an AffineTransform object representing the inverse transformation.
Shape
createTransformedShape(Shape pSrc)
Returns a new Shape object defined by the geometry of the specified Shape after it has been transformed by this transform.
void
deltaTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
Transforms an array of relative distance vectors by this transform.
Point2D
deltaTransform(Point2D ptSrc, Point2D ptDst)
Transforms the relative distance vector specified by ptSrc and stores the result in ptDst.
boolean
equals(Object obj)
Returns true if this AffineTransform represents the same affine coordinate transform as the specified argument.
double
getDeterminant()
Returns the determinant of the matrix representation of the transform.
void
getMatrix(double[] flatmatrix)
Retrieves the 6 specifiable values in the 3x3 affine transformation matrix and places them into an array of double precisions values.
static AffineTransform
getRotateInstance(double theta)
Returns a transform representing a rotation transformation.
static AffineTransform
getRotateInstance(double theta, double x, double y)
Returns a transform that rotates coordinates around an anchor point.
static AffineTransform
getScaleInstance(double sx, double sy)
Returns a transform representing a scaling transformation.
double
getScaleX()
Returns the X coordinate scaling element (m00) of the 3x3 affine transformation matrix.
double
getScaleY()
Returns the Y coordinate scaling element (m11) of the 3x3 affine transformation matrix.
static AffineTransform
getShearInstance(double shx, double shy)
Returns a transform representing a shearing transformation.
double
getShearX()
Returns the X coordinate shearing element (m01) of the 3x3 affine transformation matrix.
double
getShearY()
Returns the Y coordinate shearing element (m10) of the 3x3 affine transformation matrix.
static AffineTransform
getTranslateInstance(double tx, double ty)
Returns a transform representing a translation transformation.
double
getTranslateX()
Returns the X coordinate of the translation element (m02) of the 3x3 affine transformation matrix.
double
getTranslateY()
Returns the Y coordinate of the translation element (m12) of the 3x3 affine transformation matrix.
int
getType()
Retrieves the flag bits describing the conversion properties of this transform.
int
hashCode()
Returns the hashcode for this transform.
void
inverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
Inverse transforms an array of double precision coordinates by this transform.
Point2D
inverseTransform(Point2D ptSrc, Point2D ptDst)
Inverse transforms the specified ptSrc and stores the result in ptDst.
boolean
isIdentity()
Returns true if this AffineTransform is an identity transform.
void
preConcatenate(AffineTransform Tx)
Concatenates an AffineTransform Tx to this AffineTransform Cx in a less commonly used way such that Tx modifies the coordinate transformation relative to the absolute pixel space rather than relative to the existing user space.
void
rotate(double theta)
Concatenates this transform with a rotation transformation.
void
rotate(double theta, double x, double y)
Concatenates this transform with a transform that rotates coordinates around an anchor point.
void
scale(double sx, double sy)
Concatenates this transform with a scaling transformation.
void
setToIdentity()
Resets this transform to the Identity transform.
void
setToRotation(double theta)
Sets this transform to a rotation transformation.
void
setToRotation(double theta, double x, double y)
Sets this transform to a translated rotation transformation.
void
setToScale(double sx, double sy)
Sets this transform to a scaling transformation.
void
setToShear(double shx, double shy)
Sets this transform to a shearing transformation.
void
setToTranslation(double tx, double ty)
Sets this transform to a translation transformation.
void
setTransform(double m00, double m10, double m01, double m11, double m02, double m12)
Sets this transform to the matrix specified by the 6 double precision values.
void
setTransform(AffineTransform Tx)
Sets this transform to a copy of the transform in the specified AffineTransform object.
void
shear(double shx, double shy)
Concatenates this transform with a shearing transformation.
String
toString()
Returns a String that represents the value of this Object.
void
transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
Transforms an array of double precision coordinates by this transform.
void
transform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
Transforms an array of double precision coordinates by this transform and stores the results into an array of floats.
void
transform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
Transforms an array of floating point coordinates by this transform and stores the results into an array of doubles.
void
transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
Transforms an array of floating point coordinates by this transform.
Point2D
transform(Point2D ptSrc, Point2D ptDst)
Transforms the specified ptSrc and stores the result in ptDst.
void
transform(Point2D[] ptSrc, int srcOff, Point2D[] ptDst, int dstOff, int numPts)
Transforms an array of point objects by this transform.
void
translate(double tx, double ty)
Concatenates this transform with a translation transformation.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

TYPE_FLIP

public static final int TYPE_FLIP
This flag bit indicates that the transform defined by this object performs a mirror image flip about some axis which changes the normally right handed coordinate system into a left handed system in addition to the conversions indicated by other flag bits. A right handed coordinate system is one where the positive X axis rotates counterclockwise to overlay the positive Y axis similar to the direction that the fingers on your right hand curl when you stare end on at your thumb. A left handed coordinate system is one where the positive X axis rotates clockwise to overlay the positive Y axis similar to the direction that the fingers on your left hand curl. There is no mathematical way to determine the angle of the original flipping or mirroring transformation since all angles of flip are identical given an appropriate adjusting rotation.
Field Value:
64
Usages and Demos :

View More Examples of AffineTransform.TYPE_FLIP
   1:     private static int getFlipFromType(final AffineTransform tr) {
   2:         return (tr.getType() & AffineTransform.TYPE_FLIP) != 0 ? -1 : +1;
   3:     }
   4: 
   5:     private static void runTest(final int f) {

View Full Code Here
   1:                      AffineTransform.TYPE_TRANSLATION   |
   2:                      AffineTransform.TYPE_FLIP, tr2.getType());
   3:         assertEquals( 0.1, tr2.getScaleX(), EPS);
   4:         assertEquals(-0.2, tr2.getScaleY(), EPS);
   5:         assertSame("Transform should be cached", tr2, mapper.createAffineTransform());

View Full Code Here

TYPE_GENERAL_ROTATION

public static final int TYPE_GENERAL_ROTATION
This flag bit indicates that the transform defined by this object performs a rotation by an arbitrary angle in addition to the conversions indicated by other flag bits. A rotation changes the angles of vectors by the same amount regardless of the original direction of the vector and without changing the length of the vector. This flag bit is mutually exclusive with the TYPE_QUADRANT_ROTATION flag.
Field Value:
16
Usages and Demos :

View More Examples of AffineTransform.TYPE_GENERAL_ROTATION
   1: 
   2:         final int typeGRot   = AffineTransform.TYPE_GENERAL_ROTATION;
   3:         final int typeGTrans = AffineTransform.TYPE_GENERAL_TRANSFORM;
   4: 
   5:         if (useHinting) {

View Full Code Here

TYPE_GENERAL_SCALE

public static final int TYPE_GENERAL_SCALE
This flag bit indicates that the transform defined by this object performs a general scale in addition to the conversions indicated by other flag bits. A general scale multiplies the length of vectors by different amounts in the x and y directions without changing the angle between perpendicular vectors. This flag bit is mutually exclusive with the TYPE_UNIFORM_SCALE flag.
Field Value:
4
Usages and Demos :

View More Examples of AffineTransform.TYPE_GENERAL_SCALE
   1:         final AffineTransform tr1 = mapper.createAffineTransform();
   2:         assertEquals(AffineTransform.TYPE_GENERAL_SCALE |
   3:                      AffineTransform.TYPE_TRANSLATION, tr1.getType());
   4:         ...
   5:         assertNotSame("Should be a new transform", tr1, tr2);
   6:         assertEquals(AffineTransform.TYPE_GENERAL_SCALE |
   7:                      AffineTransform.TYPE_TRANSLATION   |
   8:         ...
   9:         assertEquals(AffineTransform.TYPE_QUADRANT_ROTATION |
  10:                      AffineTransform.TYPE_GENERAL_SCALE     |
  11:                      AffineTransform.TYPE_TRANSLATION, tr3.getType());

View Full Code Here

TYPE_GENERAL_TRANSFORM

public static final int TYPE_GENERAL_TRANSFORM
This constant indicates that the transform defined by this object performs an arbitrary conversion of the input coordinates. If this transform can be classified by any of the above constants, the type will either be the constant TYPE_IDENTITY or a combination of the appropriate flag bits for the various coordinate conversions that this transform performs.
Field Value:
32
Usages and Demos :

View More Examples of AffineTransform.TYPE_GENERAL_TRANSFORM
   1:                 ( AffineTransform.TYPE_MASK_ROTATION 
   2:                         | AffineTransform.TYPE_GENERAL_TRANSFORM)) == 0;
   3:     }
   4: 
   5:     public static String printShapeAsCode (String name, Shape shape) {

View Full Code Here
   1:                 ( AffineTransform.TYPE_MASK_ROTATION 
   2:                         | AffineTransform.TYPE_GENERAL_TRANSFORM)) == 0;
   3:     }
   4:     
   5:     public static double moduloAngle(double angle) {

View Full Code Here
   1:         final int typeGRot   = AffineTransform.TYPE_GENERAL_ROTATION;
   2:         final int typeGTrans = AffineTransform.TYPE_GENERAL_TRANSFORM;
   3: 
   4:         if (useHinting) {
   5:             AffineTransform at = graphics2D.getTransform();

View Full Code Here

TYPE_IDENTITY

public static final int TYPE_IDENTITY
This constant indicates that the transform defined by this object is an identity transform. An identity transform is one in which the output coordinates are always the same as the input coordinates. If this transform is anything other than the identity transform, the type will either be the constant GENERAL_TRANSFORM or a combination of the appropriate flag bits for the various coordinate conversions that this transform performs.
Field Value:
0
Usages and Demos :

View More Examples of AffineTransform.TYPE_IDENTITY
   1:         switch (getType()) {
   2:             case AffineTransform.TYPE_IDENTITY:
   3:                 if (rectSrc != rectDst)
   4:         ...
   5:         switch (getType()) {
   6:             case AffineTransform.TYPE_IDENTITY:
   7:                 if (rectSrc != rectDst)
   8:                     rectDst.setRect(rectSrc);
   9:                 break;

View Full Code Here
   1:                                 AffineTransform.TYPE_TRANSLATION |
   2:                                 AffineTransform.TYPE_IDENTITY)) != 0) {
   3:             double x = r.getX();
   4:         ...
   5: 
   6:             case (AffineTransform.TYPE_IDENTITY):
   7:                 xdash = x;
   8:                 ydash = y;
   9:                 wdash = w;

View Full Code Here
   1:         switch(transform.getType()) {
   2:             case AffineTransform.TYPE_IDENTITY:
   3:             case AffineTransform.TYPE_TRANSLATION:
   4:                 return true;
   5:             default:

View Full Code Here

TYPE_MASK_ROTATION

public static final int TYPE_MASK_ROTATION
This constant is a bit mask for any of the rotation flag bits.
Field Value:
24

TYPE_MASK_SCALE

public static final int TYPE_MASK_SCALE
This constant is a bit mask for any of the scale flag bits.
Field Value:
6

TYPE_QUADRANT_ROTATION

public static final int TYPE_QUADRANT_ROTATION
This flag bit indicates that the transform defined by this object performs a quadrant rotation by some multiple of 90 degrees in addition to the conversions indicated by other flag bits. A rotation changes the angles of vectors by the same amount regardless of the original direction of the vector and without changing the length of the vector. This flag bit is mutually exclusive with the TYPE_GENERAL_ROTATION flag.
Field Value:
8

TYPE_TRANSLATION

public static final int TYPE_TRANSLATION
This flag bit indicates that the transform defined by this object performs a translation in addition to the conversions indicated by other flag bits. A translation moves the coordinates by a constant amount in x and y without changing the length or angle of vectors.
Field Value:
1
Usages and Demos :

View More Examples of AffineTransform.TYPE_TRANSLATION
   1:         assertEquals(AffineTransform.TYPE_UNIFORM_SCALE |
   2:                      AffineTransform.TYPE_TRANSLATION, tr.getType());
   3: 
   4:         assertEquals(4, tr.getScaleX(), 0);
   5:         assertEquals(4, tr.getScaleY(), 0);

View Full Code Here
   1:         assertEquals(AffineTransform.TYPE_UNIFORM_SCALE |
   2:                      AffineTransform.TYPE_TRANSLATION, tr.getType());
   3: 
   4:         assertEquals(4, tr.getScaleX(), 0);
   5:         assertEquals(4, tr.getScaleY(), 0);

View Full Code Here
   1: 
   2:             case AffineTransform.TYPE_TRANSLATION:
   3:                 rectDst.setRect(rectSrc.getX() + getTranslateX(), 
   4:         ...
   5:                 
   6:             case AffineTransform.TYPE_TRANSLATION | AffineTransform.TYPE_UNIFORM_SCALE:
   7:                 scale = getScaleX();
   8:         ...
   9: 
  10:             case AffineTransform.TYPE_TRANSLATION:
  11:                 rectDst.setRect(rectSrc.getX() - getTranslateX(), 

View Full Code Here
   1:         assertEquals(AffineTransform.TYPE_GENERAL_SCALE |
   2:                      AffineTransform.TYPE_TRANSLATION, tr1.getType());
   3:         assertEquals(0.1,  tr1.getScaleX(),     EPS);
   4:         ...
   5:         assertEquals(AffineTransform.TYPE_GENERAL_SCALE |
   6:                      AffineTransform.TYPE_TRANSLATION   |
   7:                      AffineTransform.TYPE_FLIP, tr2.getType());
   8:         ...
   9:                      AffineTransform.TYPE_GENERAL_SCALE     |
  10:                      AffineTransform.TYPE_TRANSLATION, tr3.getType());
  11:         assertEquals( 0.0,  tr3.getScaleX(), EPS);

View Full Code Here
   1:                         (AffineTransform.TYPE_MASK_SCALE |
   2:                                 AffineTransform.TYPE_TRANSLATION |
   3:                                 AffineTransform.TYPE_IDENTITY)) != 0) {
   4:         ...
   5:                 case (AffineTransform.TYPE_GENERAL_SCALE |
   6:                         AffineTransform.TYPE_TRANSLATION):
   7:                     case (AffineTransform.TYPE_UNIFORM_SCALE |
   8:         ...
   9:                             AffineTransform.TYPE_TRANSLATION):
  10:                     xdash = x * m[m00] + m[m02];

View Full Code Here

TYPE_UNIFORM_SCALE

public static final int TYPE_UNIFORM_SCALE
This flag bit indicates that the transform defined by this object performs a uniform scale in addition to the conversions indicated by other flag bits. A uniform scale multiplies the length of vectors by the same amount in both the x and y directions without changing the angle between vectors. This flag bit is mutually exclusive with the TYPE_GENERAL_SCALE flag.
Field Value:
2
Usages and Demos :

View More Examples of AffineTransform.TYPE_UNIFORM_SCALE
   1: 
   2:             case AffineTransform.TYPE_UNIFORM_SCALE:
   3:                 scale = getScaleX();
   4:         ...
   5:                 
   6:             case AffineTransform.TYPE_TRANSLATION | AffineTransform.TYPE_UNIFORM_SCALE:
   7:                 scale = getScaleX();
   8:         ...
   9: 
  10:             case AffineTransform.TYPE_UNIFORM_SCALE:
  11:                 scale = 1 / getScaleX();

View Full Code Here
   1:                 break;
   2:             case AffineTransform.TYPE_UNIFORM_SCALE:
   3:                 gl.glScaled(aTransform.getScaleX(), aTransform.getScaleX(), 1);
   4:         ...
   5:             case AffineTransform.TYPE_TRANSLATION |
   6:             AffineTransform.TYPE_UNIFORM_SCALE:
   7:                 gl.glTranslated(aTransform.getTranslateX(),
   8:                                 aTransform.getTranslateY(), 0);
   9:                 gl.glScaled(aTransform.getScaleX(), aTransform.getScaleX(), 1);

View Full Code Here

Constructor Details

AffineTransform

public AffineTransform()
Constructs a new AffineTransform representing the Identity transformation.
Usages and Demos :

View More Examples of AffineTransform()
   1: 
   2:         g.setTransform(new java.awt.geom.AffineTransform());
   3:         g.translate(0, -150);
   4: 
   5:         g.draw(ellipse);

View Full Code Here
   1:               g2.fillRect(0,0,100,100);
   2:                g2.setTransform(new AffineTransform());
   3:                AlphaComposite ac =
   4:             AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.5f);
   5:                 g2.setComposite(ac);

View Full Code Here
   1:     public static boolean shapeEquals (Shape s1, Shape s2, double epsilon) {
   2:         PathIterator p1 = s1.getPathIterator(new AffineTransform());
   3:         ...
   4:         PathIterator p2 = s2.getPathIterator(new AffineTransform());
   5:         double c1[] = new double[6];
   6:         double c2[] = new double[6];
   7:         int t1, t2, i, n = 0;

View Full Code Here
   1:         java.awt.geom.AffineTransform txf = g.getTransform();
   2:         g.setTransform(new java.awt.geom.AffineTransform());
   3:         Shape shearBounds = txf.createTransformedShape(rect).getBounds();
   4:         g.setPaint(new Color(0, 0, 0, 128));
   5:         g.fill(shearBounds);

View Full Code Here
   1:         
   2:         PathIterator i=shape.getPathIterator(new AffineTransform());
   3:         double[] tmp=new double[6];
   4:         int result=i.currentSegment(tmp);
   5:         assertFalse( i.isDone() );

View Full Code Here

AffineTransform

public AffineTransform(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.
Parameters:
Usages and Demos :

View More Examples of AffineTransform(double m00,double m10,double m01,double m11,double m02,double m12)
   1:         java.awt.geom.AffineTransform trans =
   2:             new java.awt.geom.AffineTransform(0, -1, 1, 0, 0, size.height - 1);
   3:         g2d.transform(trans);
   4:         g2d.setPaintMode();
   5:         if (isOpaque() && (getBackground() != null)) {

View Full Code Here
   1:         java.awt.geom.AffineTransform trans =
   2:             new java.awt.geom.AffineTransform(0, -1, 1, 0, 0, size.height - 1);
   3:         g2d.transform(trans);
   4:         g2d.setPaintMode();
   5:         if (isOpaque() && (getBackground() != null)) {

View Full Code Here
   1:     protected final static AffineTransform FLIP_X_TRANSFORM =
   2:         new AffineTransform(-1, 0, 0, 1, 0, 0);
   3: 
   4:         ...
   5:     protected final static AffineTransform FLIP_Y_TRANSFORM =
   6:         new AffineTransform(1, 0, 0, -1, 0, 0);
   7: 
   8:     protected abstract AffineTransform getAffineTransform();
   9:     

View Full Code Here
   1:   public SVGMatrixImpl(float a, float b, float c, float d, float e, float f) {
   2:     transform = new AffineTransform(a, b, c, d, e, f);
   3:   }
   4:         ...
   5:     float f = getF();
   6:     transform = new AffineTransform(a, b, c, d, e, f);
   7:   }
   8:         ...
   9:     float f = getF();
  10:     transform = new AffineTransform(a, b, c, d, e, f);
  11:   }

View Full Code Here
   1:             case 2:
   2:                 transform = new AffineTransform(-1, 0, 0, 1, origWidth, 0);
   3:                 break;
   4:         ...
   5:             case 3:
   6:                 transform = new AffineTransform(-1, 0, 0, -1, origWidth, origHeight);
   7:                 break;
   8:         ...
   9:             case 4:
  10:                 transform = new AffineTransform(1, 0, 0, -1, 0, origHeight);
  11:                 break;

View Full Code Here

AffineTransform

public AffineTransform(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. The values are retrieved from the array as { m00 m10 m01 m11 [m02 m12]}.
Parameters:
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.
Usages and Demos :

View More Examples of AffineTransform(double[] flatmatrix)
   1:     public void paint(GraphicContext gc) {
   2:     AffineTransform original = new AffineTransform(gc.getTransform());
   3:     gc.transform(transform());
   4:         ...
   5:     public PickedList pick(GraphicContext gc, Rectangle deviceRect) {
   6:     AffineTransform original = new AffineTransform(gc.getTransform());
   7: 
   8:     gc.transform(transform());
   9:     PickedList list = super.pick(gc, deviceRect);

View Full Code Here
   1:                     }
   2:                     AffineTransform at = new AffineTransform(cat);
   3:                     try {
   4:                         at.preConcatenate(tat.createInverse());
   5:                         return at;

View Full Code Here
   1:         } else if (transform != null) {
   2:             at = new AffineTransform(at);
   3:             at.concatenate(transform);
   4:         }
   5:         return array.getPathIterator(at);

View Full Code Here
   1:         } else if (transform != null) {
   2:             at = new AffineTransform(at);
   3:             at.concatenate(transform);
   4:         }
   5:         return array.getPathIterator(at);

View Full Code Here
   1:             }
   2:             at = new AffineTransform(at);
   3:             at.concatenate(this);
   4:         ...
   5:             }
   6:             at = new AffineTransform(at);
   7:             at.concatenate(this);
   8:         }
   9:         return shape.getPathIterator(at, flatness);

View Full Code Here

AffineTransform

public AffineTransform(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.
Parameters:
Usages and Demos :

View More Examples of AffineTransform(float m00,float m10,float m01,float m11,float m02,float m12)
   1:         java.awt.geom.AffineTransform trans =
   2:             new java.awt.geom.AffineTransform(0, -1, 1, 0, 0, size.height - 1);
   3:         g2d.transform(trans);
   4:         g2d.setPaintMode();
   5:         if (isOpaque() && (getBackground() != null)) {

View Full Code Here
   1:         java.awt.geom.AffineTransform trans =
   2:             new java.awt.geom.AffineTransform(0, -1, 1, 0, 0, size.height - 1);
   3:         g2d.transform(trans);
   4:         g2d.setPaintMode();
   5:         if (isOpaque() && (getBackground() != null)) {

View Full Code Here
   1:     protected final static AffineTransform FLIP_X_TRANSFORM =
   2:         new AffineTransform(-1, 0, 0, 1, 0, 0);
   3: 
   4:         ...
   5:     protected final static AffineTransform FLIP_Y_TRANSFORM =
   6:         new AffineTransform(1, 0, 0, -1, 0, 0);
   7: 
   8:     protected abstract AffineTransform getAffineTransform();
   9:     

View Full Code Here
   1:   public SVGMatrixImpl(float a, float b, float c, float d, float e, float f) {
   2:     transform = new AffineTransform(a, b, c, d, e, f);
   3:   }
   4:         ...
   5:     float f = getF();
   6:     transform = new AffineTransform(a, b, c, d, e, f);
   7:   }
   8:         ...
   9:     float f = getF();
  10:     transform = new AffineTransform(a, b, c, d, e, f);
  11:   }

View Full Code Here
   1:             case 2:
   2:                 transform = new AffineTransform(-1, 0, 0, 1, origWidth, 0);
   3:                 break;
   4:         ...
   5:             case 3:
   6:                 transform = new AffineTransform(-1, 0, 0, -1, origWidth, origHeight);
   7:                 break;
   8:         ...
   9:             case 4:
  10:                 transform = new AffineTransform(1, 0, 0, -1, 0, origHeight);
  11:                 break;

View Full Code Here

AffineTransform

public AffineTransform(float[] flatmatrix)
Constructs a new AffineTransform from an array of floating point values representing either the 4 non-translation enries or the 6 specifiable entries of the 3x3 transformation matrix. The values are retrieved from the array as { m00 m10 m01 m11 [m02 m12]}.
Parameters:
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.
Usages and Demos :

View More Examples of AffineTransform(float[] flatmatrix)
   1:     public void paint(GraphicContext gc) {
   2:     AffineTransform original = new AffineTransform(gc.getTransform());
   3:     gc.transform(transform());
   4:         ...
   5:     public PickedList pick(GraphicContext gc, Rectangle deviceRect) {
   6:     AffineTransform original = new AffineTransform(gc.getTransform());
   7: 
   8:     gc.transform(transform());
   9:     PickedList list = super.pick(gc, deviceRect);

View Full Code Here
   1:                     }
   2:                     AffineTransform at = new AffineTransform(cat);
   3:                     try {
   4:                         at.preConcatenate(tat.createInverse());
   5:                         return at;

View Full Code Here
   1:         } else if (transform != null) {
   2:             at = new AffineTransform(at);
   3:             at.concatenate(transform);
   4:         }
   5:         return array.getPathIterator(at);

View Full Code Here
   1:         } else if (transform != null) {
   2:             at = new AffineTransform(at);
   3:             at.concatenate(transform);
   4:         }
   5:         return array.getPathIterator(at);

View Full Code Here
   1:             }
   2:             at = new AffineTransform(at);
   3:             at.concatenate(this);
   4:         ...
   5:             }
   6:             at = new AffineTransform(at);
   7:             at.concatenate(this);
   8:         }
   9:         return shape.getPathIterator(at, flatness);

View Full Code Here

AffineTransform

public AffineTransform(AffineTransform Tx)
Constructs a new AffineTransform that is a copy of the specified AffineTransform object.
Parameters:
Tx - the AffineTransform object to copy
Usages and Demos :

View More Examples of AffineTransform(AffineTransform Tx)
   1:     public void paint(GraphicContext gc) {
   2:     AffineTransform original = new AffineTransform(gc.getTransform());
   3:     gc.transform(transform());
   4:         ...
   5:     public PickedList pick(GraphicContext gc, Rectangle deviceRect) {
   6:     AffineTransform original = new AffineTransform(gc.getTransform());
   7: 
   8:     gc.transform(transform());
   9:     PickedList list = super.pick(gc, deviceRect);

View Full Code Here
   1:                     }
   2:                     AffineTransform at = new AffineTransform(cat);
   3:                     try {
   4:                         at.preConcatenate(tat.createInverse());
   5:                         return at;

View Full Code Here
   1:         } else if (transform != null) {
   2:             at = new AffineTransform(at);
   3:             at.concatenate(transform);
   4:         }
   5:         return array.getPathIterator(at);

View Full Code Here
   1:         } else if (transform != null) {
   2:             at = new AffineTransform(at);
   3:             at.concatenate(transform);
   4:         }
   5:         return array.getPathIterator(at);

View Full Code Here
   1:             }
   2:             at = new AffineTransform(at);
   3:             at.concatenate(this);
   4:         ...
   5:             }
   6:             at = new AffineTransform(at);
   7:             at.concatenate(this);
   8:         }
   9:         return shape.getPathIterator(at, flatness);

View Full Code Here

Method Details

clone

public Object clone()
Returns a copy of this AffineTransform object.
Overrides:
clone in interface Object
Returns:
an Object that is a copy of this AffineTransform object.
Usages and Demos :

View More Examples of clone()
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     AffineTransform affine;
   7:         ...
   8:     AffineTransform invAffine;
   9: 
  10:         ...
  11:     public AffineTransform getAffine() {
  12:         return (AffineTransform)affine.clone();

View Full Code Here
   1: import java.awt.AWTEvent;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: 
   6:     public AffineTransform viewTransform = null;
   7: 
   8:         ...
   9:     public ZCameraEvent(ZCamera source, int id, AffineTransform viewTransform) {
  10:         super(source, id);
  11:         ...
  12:     public AffineTransform getOrigViewTransform() {
  13:         return (AffineTransform) viewTransform.clone();

View Full Code Here
   1:     
   2:     private AffineTransform buildOffsetTrans(AffineTransform a_trans) {
   3:         if (m_xOffset == 0 && m_yOffset == 0) {
   4:         ...
   5:         
   6:         AffineTransform retval = (AffineTransform) a_trans.clone();
   7:         retval.translate(m_xOffset, m_yOffset);
   8:         
   9:         return retval;

View Full Code Here
   1:     
   2:     private AffineTransform buildOffsetTrans(AffineTransform a_trans) {
   3:         if (m_xOffset == 0 && m_yOffset == 0) {
   4:         ...
   5:         
   6:         AffineTransform retval = (AffineTransform) a_trans.clone();
   7:         retval.translate(m_xOffset, m_yOffset);
   8:         
   9:         return retval;

View Full Code Here
   1: import java.awt.Paint;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: 
   6:     protected AffineTransform gradientTransform;
   7: 
   8:         ...
   9:                                  ColorSpaceEnum colorSpace,
  10:                                  AffineTransform gradientTransform) {
  11: 
  12:         ...
  13: 
  14:         this.gradientTransform = (AffineTransform)gradientTransform.clone();

View Full Code Here

concatenate

public void concatenate(AffineTransform Tx)
Concatenates an AffineTransform Tx to this AffineTransform Cx in the most commonly useful way to provide a new user space that is mapped to the former user space by Tx. Cx is updated to perform the combined transformation. Transforming a point p by the updated transform Cx' is equivalent to first transforming p by Tx and then transforming the result by the original transform Cx like this: Cx'(p) = Cx(Tx(p)) In matrix notation, if this transform Cx is represented by the matrix [this] and Tx is represented by the matrix [Tx] then this method does the following:
		[this] = [this] x [Tx]
 
Parameters:
Tx - the AffineTransform object to be concatenated with this AffineTransform object.
Usages and Demos :

View More Examples of concatenate(AffineTransform Tx)
   1: import java.awt.event.MouseEvent;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: 
   6:         AffineTransform at = rotateTransform(c.getSize(), e.getX(), e.getY());
   7:         ...
   8:         at.concatenate(c.getRenderingTransform());
   9:         c.setRenderingTransform(at);
  10:         ...
  11: 
  12:     protected AffineTransform rotateTransform(Dimension d, int x, int y) {

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.io.Reader;
   4:         ...
   5: public class AWTTransformProducer implements TransformListHandler {
   6:     protected AffineTransform affineTransform;
   7: 
   8:         ...
   9:             = AffineTransform.getRotateInstance(Math.PI * theta / 180, cx, cy);
  10:         affineTransform.concatenate(at);
  11:     }
  12:         ...
  13:         AffineTransform at = AffineTransform.getTranslateInstance(tx, 0);
  14:         affineTransform.concatenate(at);

View Full Code Here
   1: import java.awt.event.MouseEvent;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Line2D;
   4:         ...
   5:         
   6:             AffineTransform at = new AffineTransform();
   7:             at.scale(scale, scale);
   8:         ...
   9: 
  10:             at.concatenate(c.getRenderingTransform());
  11:             c.setRenderingTransform(at);

View Full Code Here
   1: import java.awt.event.WindowEvent;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Dimension2D;
   4:         ...
   5: 
   6:             AffineTransform Tx;
   7:             if (viewBox.length() != 0) {
   8:         ...
   9:                 double s = Math.min(sx, sy);
  10:                 Tx = AffineTransform.getScaleInstance(s, s);
  11:             }
  12:         ...
  13:                         AffineTransform invVTx = vTx.createInverse();
  14:                         Tx.concatenate(invVTx);

View Full Code Here
   1: import java.awt.image.renderable.RenderableImage;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     private AffineTransform transform;
   7:     private Stroke stroke;
   8:         ...
   9:         this.group = group;
  10:         transform = new AffineTransform();
  11:     }
  12:         ...
  13:         at.translate(x, y);
  14:         transform.concatenate(at);

View Full Code Here

createInverse

public AffineTransform createInverse()
            throws NoninvertibleTransformException
Returns an AffineTransform object representing the inverse transformation. The inverse transform Tx' of this transform Tx maps coordinates transformed by Tx back to their original coordinates. In other words, Tx'(Tx(p)) = p = Tx(Tx'(p)).

If this transform maps all coordinates onto a point or a line then it will not have an inverse, since coordinates that do not lie on the destination point or line will not have an inverse mapping. The getDeterminant method can be used to determine if this transform has no inverse, in which case an exception will be thrown if the createInverse method is called.

Returns:
a new AffineTransform object representing the inverse transformation.
Throws:
NoninvertibleTransformException - if the matrix cannot be inverted.
Usages and Demos :

View More Examples of createInverse()
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.GeneralPath;
   4:         ...
   5:     public Shape createStrokedShape(Shape p) {
   6:         AffineTransform t = new AffineTransform();
   7:         t.rotate(angle);
   8:         ...
   9:         try {
  10:             ti = t.createInverse();
  11:         } catch (NoninvertibleTransformException e) {

View Full Code Here
   1: import java.awt.color.ColorSpace;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:         AffineTransform usr2dev = rc.getTransform();
   7: 
   8:         ...
   9: 
  10:         AffineTransform patternTxf = new AffineTransform();
  11:         try{
  12:         ...
  13:             patternTxf = usr2dev.createInverse();

View Full Code Here
   1: import java.awt.color.ColorSpace;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5:     RenderingHints  hints;
   6:     AffineTransform src2me;
   7:         ...
   8:     AffineTransform me2src;
   9: 
  10:         ...
  11:         try {
  12:             me2src = src2me.createInverse();

View Full Code Here
   1: import java.awt.event.MouseEvent;
   2: import java.awt.geom.AffineTransform;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     private AffineTransform dotToCoordinateTransform = new AffineTransform();
   7: 
   8:         ...
   9:                 graphics.getClipBounds(),
  10:                 dotToCoordinateTransform.createInverse());
  11:         } catch (java.awt.geom.NoninvertibleTransformException e) {

View Full Code Here
   1: import java.awt.geom.RectangularShape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     public Shape getSelectedArea(final AffineTransform transform)
   7:                                  throws NoninvertibleTransformException {
   8:         ...
   9:                 else {
  10:                     return transform.createInverse().createTransformedShape(shape);
  11:                 }
  12:         ...
  13:     private static boolean canReshape(final RectangularShape shape,
  14:                                       final AffineTransform transform) {

View Full Code Here

createTransformedShape

public Shape createTransformedShape(Shape pSrc)
Returns a new Shape object defined by the geometry of the specified Shape after it has been transformed by this transform.
Parameters:
pSrc - the specified Shape object to be transformed by this transform.
Returns:
a new Shape object that defines the geometry of the transformed Shape.
Usages and Demos :

View More Examples of createTransformedShape(Shape pSrc)
   1: import java.awt.*;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     private Figure figure;
   6:     private AffineTransform A;
   7: 
   8:         ...
   9:     public TransformFigure(Figure figure, AffineTransform A) {
  10:         this.figure = figure;
  11:         ...
  12:         g.setTransform(T);
  13:         return A.createTransformedShape(r).getBounds2D();

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5: public class ImageFigure extends AbstractFigure {
   6:     private AffineTransform _xf = new AffineTransform();
   7: 
   8:         ...
   9:             Rectangle2D r = new Rectangle2D.Double(0, 0, w, h);
  10:             return _xf.createTransformedShape(r);
  11:         }

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     AffineTransform affine;
   7:         ...
   8:     AffineTransform invAffine;
   9: 
  10:         ...
  11:         Rectangle2D r = src.getBounds2D();
  12:         return affine.createTransformedShape(r).getBounds2D();

View Full Code Here
   1: import java.awt.geom.GeneralPath;
   2: import java.awt.geom.AffineTransform;
   3: import junit.framework.Test;
   4:         ...
   5:         final Rectangle2D    bounds = shape.getBounds2D();
   6:         final AffineTransform scale = new AffineTransform();
   7:         scale.translate(+bounds.getCenterX(), +bounds.getCenterY());
   8:         ...
   9:         scale.translate(-bounds.getCenterX(), -bounds.getCenterY());
  10:         return scale.createTransformedShape(shape);
  11:     }

View Full Code Here
   1: import java.awt.event.MouseEvent;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5:     protected Shape getShape() throws Exception {
   6:         AffineTransform transform = new AffineTransform();
   7:         transform.translate(
   8:         ...
   9: 
  10:         return transform.createTransformedShape(selectedFeaturesShape);
  11:     }

View Full Code Here

deltaTransform

public void deltaTransform(double[] srcPts,
                           int srcOff,
                           double[] dstPts,
                           int dstOff,
                           int numPts)
Transforms an array of relative distance vectors by this transform. A relative distance vector is transformed without applying the translation components of the affine transformation matrix using the following equations:
	[  x' ]   [  m00  m01 (m02) ] [  x  ]   [ m00x + m01y ]
	[  y' ] = [  m10  m11 (m12) ] [  y  ] = [ m10x + m11y ]
	[ (1) ]   [  (0)  (0) ( 1 ) ] [ (1) ]   [     (1)     ]
 
The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the indicated offset in the order [x0, y0, x1, y1, ..., xn, yn].
Parameters:
srcPts - the array containing the source distance vectors. Each vector is stored as a pair of relative x, y coordinates.
srcOff - the offset to the first vector to be transformed in the source array
dstPts - the array into which the transformed distance vectors are returned. Each vector is stored as a pair of relative x, y coordinates.
dstOff - the offset to the location of the first transformed vector that is stored in the destination array
numPts - the number of vector coordinate pairs to be transformed
Usages and Demos :

View More Examples of deltaTransform(double[] srcPts,int srcOff,double[] dstPts,int dstOff,int numPts)
   1:     private RenderingHints  renderingHints = new RenderingHints(null);
   2:     private AffineTransform transform = new AffineTransform();
   3:     private Area            clipArea = null;
   4:         ...
   5:         Area absClipArea;
   6:         AffineTransform transform;
   7:         
   8:         ...
   9:                 point[1] = 0;
  10:                 transform.deltaTransform(point, 0, point, 0, 1);
  11:                 scale = Math.sqrt((point[0] * point[0]) +

View Full Code Here

deltaTransform

public Point2D deltaTransform(Point2D ptSrc,
                              Point2D ptDst)
Transforms the relative distance vector specified by ptSrc and stores the result in ptDst. A relative distance vector is transformed without applying the translation components of the affine transformation matrix using the following equations:
	[  x' ]   [  m00  m01 (m02) ] [  x  ]   [ m00x + m01y ]
	[  y' ] = [  m10  m11 (m12) ] [  y  ] = [ m10x + m11y ]
	[ (1) ]   [  (0)  (0) ( 1 ) ] [ (1) ]   [     (1)     ]
 
If ptDst is null, a new Point2D object is allocated and then the result of the transform is stored in this object. In either case, ptDst, which contains the transformed point, is returned for convenience. If ptSrc and ptDst are the same object, the input point is correctly overwritten with the transformed point.
Parameters:
ptSrc - the distance vector to be delta transformed
ptDst - the resulting transformed distance vector
Returns:
ptDst, which contains the result of the transformation.
Usages and Demos :

View More Examples of deltaTransform(Point2D ptSrc,Point2D ptDst)
   1: import java.awt.RenderingHints;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:     public PaintContext createContext (ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds,
   6:                                        AffineTransform xform, RenderingHints hints)
   7:     {
   8:         ...
   9:         Point2D transformedPoint = xform.transform(point, null);
  10:         Point2D transformedRadius = xform.deltaTransform(radius, null);
  11:         return new RoundGradientContext(transformedPoint, pointColor, transformedRadius, bgColor);

View Full Code Here
   1: import java.awt.geom.PathIterator;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.RectangularShape;
   4:         ...
   5: 
   6:     private final AffineTransform transform = new AffineTransform();
   7: 
   8:         ...
   9:         tmp.y = logicalShape.getHeight();
  10:         transform.deltaTransform(tmp, tmp);
  11:         if (Math.abs(tmp.x) < MIN_WIDTH || Math.abs(tmp.y) < MIN_HEIGHT) {

View Full Code Here

equals

public boolean equals(Object obj)
Returns true if this AffineTransform represents the same affine coordinate transform as the specified argument.
Overrides:
equals in interface Object
Parameters:
obj - the Object to test for equality with this AffineTransform
Returns:
true if obj equals this AffineTransform object; false otherwise.
Usages and Demos :

View More Examples of equals(Object obj)
   1: 
   2: import jp.ujihara.java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: {
   6:   private AffineTransform affineTransform;
   7:   private boolean isAntiAliased;
   8:         ...
   9:   {
  10:     return (affineTransform.equals(rhs.getTransform ())
  11:             && isAntiAliased == rhs.isAntiAliased ()

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12:     {
  13:         return theTransform.equals(o);

View Full Code Here
   1: import java.awt.FontFormatException;
   2: import java.awt.geom.AffineTransform;
   3: import java.nio.ByteBuffer;
   4:         ...
   5: 
   6:   private AffineTransform deviceTransform;
   7: 
   8:         ...
   9:   public boolean setup(double pointSize,
  10:                        AffineTransform deviceTransform,
  11:                        boolean antialiased)
  12:         ...
  13:     changeCTM = ((pointSize_Fixed != this.pointSize)
  14:                  || !deviceTransform.equals(this.deviceTransform)

View Full Code Here

getDeterminant

public double getDeterminant()
Returns the determinant of the matrix representation of the transform. The determinant is useful both to determine if the transform can be inverted and to get a single value representing the combined X and Y scaling of the transform.

If the determinant is non-zero, then this transform is invertible and the various methods that depend on the inverse transform do not need to throw a NoninvertibleTransformException. If the determinant is zero then this transform can not be inverted since the transform maps all input coordinates onto a line or a point. If the determinant is near enough to zero then inverse transform operations might not carry enough precision to produce meaningful results.

If this transform represents a uniform scale, as indicated by the getType method then the determinant also represents the square of the uniform scale factor by which all of the points are expanded from or contracted towards the origin. If this transform represents a non-uniform scale or more general transform then the determinant is not likely to represent a value useful for any purpose other than determining if inverse transforms are possible.

Mathematically, the determinant is calculated using the formula:

		|  m00  m01  m02  |
		|  m10  m11  m12  |  =  m00 * m11 - m01 * m10
		|   0    0    1   |
 
Returns:
the determinant of the matrix used to transform the coordinates.
See Also:
getType(), createInverse(), inverseTransform, TYPE_UNIFORM_SCALE
Usages and Demos :

View More Examples of getDeterminant()
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12:     
  13:     public double getDeterminant() { return theTransform.getDeterminant(); }

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.util.List;
   4:         ...
   5:     public float getCurrentScale( ) {
   6:         AffineTransform scrnTrans = getSVGContext().getScreenTransform();
   7:         if (scrnTrans != null)
   8:         ...
   9:             return (float)Math.sqrt(scrnTrans.getDeterminant());
  10:         return 1;
  11:         ...
  12:         SVGContext context = getSVGContext();
  13:         AffineTransform scrnTrans = context.getScreenTransform();

View Full Code Here

getMatrix

public void getMatrix(double[] flatmatrix)
Retrieves the 6 specifiable values in the 3x3 affine transformation matrix and places them into an array of double precisions values. The values are stored in the array as { m00 m10 m01 m11 m02 m12 }. An array of 4 doubles can also be specified, in which case only the first four elements representing the non-transform parts of the array are retrieved and the values are stored into the array as { m00 m10 m01 m11 }
Parameters:
flatmatrix - the double array used to store the returned values.
Usages and Demos :

View More Examples of getMatrix(double[] flatmatrix)
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: {
   6:     public static void errPrintAffineTransform( AffineTransform transform )
   7:     {
   8:         ...
   9:         double [] mat = new double[6];
  10:         transform.getMatrix( mat );
  11:         System.err.println("matrix: ");

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: 
   6:   public QMatrix( AffineTransform t )
   7:   {
   8:         ...
   9:     double[] matrix = new double[6];
  10:     t.getMatrix( matrix );
  11:     init( matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] );
  12:         ...
  13: 
  14:   public AffineTransform getTransform()

View Full Code Here
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:         Graphics2D g2d = (Graphics2D)g;
   6:         AffineTransform form = g2d.getTransform();
   7: 
   8:         ...
   9:         Shape s = vertexShapeFunction.getShape(v);
  10:         AffineTransform xform = AffineTransform.getTranslateInstance(x,y);
  11:         s = xform.createTransformedShape(s);
  12:         ...
  13:         double[] matrix = new double[6];
  14:         form.getMatrix(matrix);

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:     public static TransformStackElement createGeneralTransformElement
   6:         (AffineTransform txf){
   7:         double matrix[] = new double[6];
   8:         ...
   9:         txf.getMatrix(matrix);
  10:         return new TransformStackElement(TransformType.GENERAL, matrix) {
  11:         ...
  12:         double[] product = new double[6];
  13:         AffineTransform transform1 = new AffineTransform(matrix1);

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12:         double[] retval = new double[6];
  13:         theTransform.getMatrix(retval);

View Full Code Here

getRotateInstance

public static AffineTransform getRotateInstance(double theta)
Returns a transform representing a rotation transformation. The matrix representing the returned transform is:
		[   cos(theta)    -sin(theta)    0   ]
		[   sin(theta)     cos(theta)    0   ]
		[       0              0         1   ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta - the angle of rotation in radians
Returns:
an AffineTransform object that is a rotation transformation, created with the specified angle of rotation.
Usages and Demos :

View More Examples of getRotateInstance(double theta)
   1:     ig.setFont(font);
   2:     ig.transform(AffineTransform.getTranslateInstance(imgSize/2, imgSize/2));
   3: 
   4:         ...
   5:     double angle = -Rotation.getDouble() * Math.PI / 180.0;
   6:     AffineTransform rot = AffineTransform.getRotateInstance(angle);
   7:     boolean mirror = Mirror.getFlag();
   8:         ...
   9:     rot.transform(p0, p1);
  10:     ig.transform(AffineTransform.getTranslateInstance(p1.x, p1.y));
  11:     ig.transform(rot);

View Full Code Here
   1:           op = new AffineTransformOp(
   2:               AffineTransform.getRotateInstance(Math.PI / 6), null);
   3:         else if (option.equals("scale"))
   4:         ...
   5:           op = new AffineTransformOp(
   6:               AffineTransform.getScaleInstance(.5, .5), null);
   7:         if (op != null) destination = op.filter(source, null);
   8:         repaint();
   9:       }

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: 
   6:     protected AffineTransform affineTransform;
   7: 
   8:         ...
   9:         type = SVG_TRANSFORM_ROTATE;
  10:         affineTransform = AffineTransform.getRotateInstance(Math.toRadians(angle),cx,cy);
  11:         this.angle = angle;

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import org.opensourcephysics.display.DrawingPanel;
   4:         ...
   5: public class YAxis extends XYAxis {
   6:   AffineTransform rot90 = AffineTransform.getRotateInstance(-Math.PI/2);
   7: 
   8:   public YAxis() {
   9:     this("Y Axis");

View Full Code Here
   1: import java.awt.font.GlyphVector;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Line2D;
   4:         ...
   5:     private double            depth;
   6:     private AffineTransform   antiQuarter;
   7:     private int               tickDirection;
   8:         ...
   9:         fontRx = new FontRenderContext(null, true, true);
  10:         antiQuarter = AffineTransform.getRotateInstance(Math.toRadians(-90));
  11: 
  12:         ...
  13:     {
  14:         AffineTransform prevTransform = g2.getTransform();

View Full Code Here

getRotateInstance

public static AffineTransform getRotateInstance(double theta,
                                                double x,
                                                double y)
Returns a transform that rotates coordinates around an anchor point. This operation is equivalent to translating the coordinates so that the anchor point is at the origin (S1), then rotating them about the new origin (S2), and finally translating so that the intermediate origin is restored to the coordinates of the original anchor point (S3).

This operation is equivalent to the following sequence of calls:

	    AffineTransform Tx = new AffineTransform();
	    Tx.setToTranslation(x, y);	// S3: final translation
	    Tx.rotate(theta);		// S2: rotate around anchor
	    Tx.translate(-x, -y);	// S1: translate anchor to origin
 
The matrix representing the returned transform is:
		[   cos(theta)    -sin(theta)    x-x*cos+y*sin  ]
		[   sin(theta)     cos(theta)    y-x*sin-y*cos  ]
		[       0              0               1        ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta - the angle of rotation in radians
Returns:
an AffineTransform object that rotates coordinates around the specified point by the specified angle of rotation.
Usages and Demos :

View More Examples of getRotateInstance(double theta,double x,double y)
   1: import java.awt.event.MouseEvent;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: 
   6:         AffineTransform at = rotateTransform(c.getSize(), e.getX(), e.getY());
   7:         at.concatenate(c.getRenderingTransform());
   8:         ...
   9: 
  10:     protected AffineTransform rotateTransform(Dimension d, int x, int y) {
  11:         double dx = x - d.width / 2;
  12:         ...
  13: 
  14:         return AffineTransform.getRotateInstance(angle, d.width / 2, d.height / 2);

View Full Code Here
   1: 
   2:     static AffineTransform mirrorTransform;
   3:         ...
   4:     mirrorTransform = AffineTransform.getTranslateInstance(127, 0);
   5:     }
   6:         ...
   7:     new AffineTransformOp(mirrorTransform,AffineTransformOp.TYPE_BILINEAR),
   8:     new AffineTransformOp(AffineTransform.getRotateInstance(Math.PI,64,95),
   9:                   AffineTransformOp.TYPE_NEAREST_NEIGHBOR),
  10:         ...
  11:     new AffineTransformOp(AffineTransform.getRotateInstance(Math.PI/12,

View Full Code Here
   1: 
   2:     static AffineTransform mirrorTransform;
   3:         ...
   4:     mirrorTransform = AffineTransform.getTranslateInstance(127, 0);
   5:     }
   6:         ...
   7:     new AffineTransformOp(mirrorTransform,AffineTransformOp.TYPE_BILINEAR),
   8:     new AffineTransformOp(AffineTransform.getRotateInstance(Math.PI,64,95),
   9:                   AffineTransformOp.TYPE_NEAREST_NEIGHBOR),
  10:         ...
  11:     new AffineTransformOp(AffineTransform.getRotateInstance(Math.PI/12,

View Full Code Here
   1: import java.awt.font.TextLayout;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Area;
   4:         ...
   5:         Point2D.Double center = new Point2D.Double((double) getWidth() / 2, (double) getHeight() / 2);
   6:         AffineTransform toCenter = AffineTransform.getTranslateInstance(center.getX(), center.getY());
   7:         AffineTransform fromCenter = AffineTransform.getTranslateInstance(-center.getX(), -center.getY());
   8:         ...
   9:         float angle = filled * (float)Math.PI / ((float)sectorCount);
  10:         AffineTransform rotateClockwise = AffineTransform.getRotateInstance(angle, 0.0d, 0.0d);
  11:         intersection.addPoint(0,0);
  12:         ...
  13:             double fixedIncrement = 2.0 * Math.PI / ((double) barsCount);
  14:             AffineTransform rotate = AffineTransform.getRotateInstance(fixedIncrement, 0.0d,0.0d);

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Area;
   4:         ...
   5:         }
   6:         AffineTransform transform = AffineTransform.getTranslateInstance(transX, transY);
   7:         return transform.createTransformedShape(shape);
   8:         ...
   9:         }
  10:         AffineTransform rotate = AffineTransform.getRotateInstance(angle, x, y);
  11:         Shape result = rotate.createTransformedShape(base);
  12:         ...
  13:         AffineTransform saved = g2.getTransform();
  14:         AffineTransform rotate = AffineTransform.getRotateInstance(angle, x, y);

View Full Code Here

getScaleInstance

public static AffineTransform getScaleInstance(double sx,
                                               double sy)
Returns a transform representing a scaling transformation. The matrix representing the returned transform is:
		[   sx   0    0   ]
		[   0    sy   0   ]
		[   0    0    1   ]
 
Parameters:
sx - the factor by which coordinates are scaled along the X axis direction
sy - the factor by which coordinates are scaled along the Y axis direction
Returns:
an AffineTransform object that scales coordinates by the specified factors.
Usages and Demos :

View More Examples of getScaleInstance(double sx,double sy)
   1: import org.eclipse.swt.events.MouseEvent;
   2: import java.awt.geom.AffineTransform;
   3: import org.eclipse.swt.graphics.Rectangle;
   4:         ...
   5: 
   6:                 AffineTransform af=canvas.getTransform();
   7:         ...
   8:                 AffineTransform scale=
   9:         ...
  10:                 AffineTransform.getScaleInstance(1/scale_rate,1/scale_rate);

View Full Code Here
   1: import org.eclipse.swt.events.MouseEvent;
   2: import java.awt.geom.AffineTransform;
   3: import org.eclipse.swt.graphics.Rectangle;
   4:         ...
   5: 
   6:                 AffineTransform af=canvas.getTransform();
   7:         ...
   8:                 AffineTransform scale=
   9:         ...
  10:                 AffineTransform.getScaleInstance(scale_rate,scale_rate);

View Full Code Here
   1:           op = new AffineTransformOp(
   2:               AffineTransform.getRotateInstance(Math.PI / 6), null);
   3:         else if (option.equals("scale"))
   4:         ...
   5:           op = new AffineTransformOp(
   6:               AffineTransform.getScaleInstance(.5, .5), null);
   7:         if (op != null) destination = op.filter(source, null);
   8:         repaint();
   9:       }

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.io.Reader;
   4:         ...
   5: public class AWTTransformProducer implements TransformListHandler {
   6:     protected AffineTransform affineTransform;
   7: 
   8:         ...
   9:     public void scale(float sx) throws ParseException {
  10:         affineTransform.concatenate(AffineTransform.getScaleInstance(sx, sx));
  11:     }
  12:         ...
  13:     public void scale(float sx, float sy) throws ParseException {
  14:         affineTransform.concatenate(AffineTransform.getScaleInstance(sx, sy));

View Full Code Here
   1:         Component mappedComponent = getMappedComponent();
   2:         AffineTransform at = getViewToMiniMapTransform(mappedComponent);
   3:         g2d.transform(at);
   4:         ...
   5:     protected void drawViewRectangle(Graphics2D g2d, Rectangle viewPortRectangle) {
   6:         AffineTransform at = new AffineTransform();
   7:         at.setToIdentity();
   8:         ...
   9: 
  10:         at.concatenate(AffineTransform.getScaleInstance(scaleX, scaleY));
  11:         return at;

View Full Code Here

getScaleX

public double getScaleX()
Returns the X coordinate scaling element (m00) of the 3x3 affine transformation matrix.
Returns:
a double value that is the X coordinate of the scaling element of the affine transformation matrix.
Usages and Demos :

View More Examples of getScaleX()
   1: import java.awt.event.WindowEvent;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5: 
   6:     private AffineTransform iterate(double dx, double dy, AffineTransform T,
   7:                                     Figure f, Graphics2D g) {
   8:         ...
   9:         T = new AffineTransform();
  10:         T.setToScale(T.getScaleX(), T.getScaleY());
  11:         Rectangle2D r = null, A_r = null;
  12:         ...
  13:             }
  14:             T.setToScale(T.getScaleX(), T.getScaleY());

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     public AffineTransform getModelTransformation() {
   7:         return metadata.getModelTransformation();
   8:         ...
   9:         if (modelPixelScales != null) {
  10:             message.println("[" + modelPixelScales.getScaleX() + ","
  11:                     + modelPixelScales.getScaleY() + ","
  12:         ...
  13: 
  14:         AffineTransform modelTransformation = getModelTransformation();

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public void primitivePaint(Graphics2D g2d) {
   6:         AffineTransform at = g2d.getTransform();
   7: 
   8:         ...
   9:         double scx = Math.sqrt(at.getShearY()*at.getShearY()+
  10:                                at.getScaleX()*at.getScaleX());
  11:         double scy = Math.sqrt(at.getShearX()*at.getShearX()+
  12:         ...
  13: 
  14:         AffineTransform nat = g2d.getTransform();

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12:     
  13:     public double getScaleX() { return theTransform.getScaleX(); }

View Full Code Here
   1: import javax.vecmath.GMatrix;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:     
   6:     public Matrix(final AffineTransform transform) {
   7:         super(3,3, new double[] {
   8:         ...
   9:             transform.getScaleX(), transform.getShearX(), transform.getTranslateX(),
  10:             transform.getShearY(), transform.getScaleY(), transform.getTranslateY(),
  11:         ...
  12:     
  13:     public final AffineTransform toAffineTransform2D() throws IllegalStateException {

View Full Code Here

getScaleY

public double getScaleY()
Returns the Y coordinate scaling element (m11) of the 3x3 affine transformation matrix.
Returns:
a double value that is the Y coordinate of the scaling element of the affine transformation matrix.
Usages and Demos :

View More Examples of getScaleY()
   1: import java.awt.event.WindowEvent;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5: 
   6:     private AffineTransform iterate(double dx, double dy, AffineTransform T,
   7:                                     Figure f, Graphics2D g) {
   8:         ...
   9:         T = new AffineTransform();
  10:         T.setToScale(T.getScaleX(), T.getScaleY());
  11:         Rectangle2D r = null, A_r = null;
  12:         ...
  13:             }
  14:             T.setToScale(T.getScaleX(), T.getScaleY());

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     public AffineTransform getModelTransformation() {
   7:         return metadata.getModelTransformation();
   8:         ...
   9:             message.println("[" + modelPixelScales.getScaleX() + ","
  10:                     + modelPixelScales.getScaleY() + ","
  11:                     + modelPixelScales.getScaleZ() + "]");
  12:         ...
  13: 
  14:         AffineTransform modelTransformation = getModelTransformation();

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     public void primitivePaint(Graphics2D g2d) {
   6:         AffineTransform at = g2d.getTransform();
   7: 
   8:         ...
   9:         double scy = Math.sqrt(at.getShearX()*at.getShearX()+
  10:                                at.getScaleY()*at.getScaleY());
  11: 
  12:         ...
  13: 
  14:         AffineTransform nat = g2d.getTransform();

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12: 
  13:     public double getScaleY() { return theTransform.getScaleY(); }

View Full Code Here
   1: import javax.vecmath.GMatrix;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:     
   6:     public Matrix(final AffineTransform transform) {
   7:         super(3,3, new double[] {
   8:         ...
   9:             transform.getScaleX(), transform.getShearX(), transform.getTranslateX(),
  10:             transform.getShearY(), transform.getScaleY(), transform.getTranslateY(),
  11:             0,                     0,                         1
  12:         ...
  13:     
  14:     public final AffineTransform toAffineTransform2D() throws IllegalStateException {

View Full Code Here

getShearInstance

public static AffineTransform getShearInstance(double shx,
                                               double shy)
Returns a transform representing a shearing transformation. The matrix representing the returned transform is:
		[   1   shx   0   ]
		[  shy   1    0   ]
		[   0    0    1   ]
 
Parameters:
shx - the multiplier by which coordinates are shifted in the direction of the positive X axis as a factor of their Y coordinate
shy - the multiplier by which coordinates are shifted in the direction of the positive Y axis as a factor of their X coordinate
Returns:
an AffineTransform object that shears coordinates by the specified multipliers.
Usages and Demos :

View More Examples of getShearInstance(double shx,double shy)
   1: 
   2:     this.transforms = new AffineTransform[6];
   3:         ...
   4:     transforms[0] = new AffineTransform();  
   5:         ...
   6:     transforms[1] = AffineTransform.getScaleInstance(0.75, 0.75);
   7:         ...
   8:     transforms[2] = AffineTransform.getShearInstance(-0.4, 0.0);

View Full Code Here
   1: 
   2:     this.transforms = new AffineTransform[6];
   3:         ...
   4:     transforms[0] = new AffineTransform();  
   5:         ...
   6:     transforms[1] = AffineTransform.getScaleInstance(0.75, 0.75);
   7:         ...
   8:     transforms[2] = AffineTransform.getShearInstance(-0.4, 0.0);

View Full Code Here
   1: 
   2:         font.deriveFont(AffineTransform.getScaleInstance(30.0, 30.0));
   3:     GlyphVector gv = bigfont.createGlyphVector(g.getFontRenderContext(),
   4:         ...
   5: 
   6:     AffineTransform shadowTransform =
   7: 
   8:     g.translate(65, 270);

View Full Code Here
   1: 
   2:         font.deriveFont(AffineTransform.getScaleInstance(30.0, 30.0));
   3:     GlyphVector gv = bigfont.createGlyphVector(g.getFontRenderContext(),
   4:         ...
   5: 
   6:     AffineTransform shadowTransform =
   7: 
   8:     g.translate(65, 270);

View Full Code Here
   1: import java.awt.font.FontRenderContext;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.GeneralPath;
   4:         ...
   5: 
   6:     private Hashtable<AffineTransform, Integer> transformToId = new Hashtable<AffineTransform, Integer>();
   7: 
   8:         ...
   9:     public void shear(double shx, double shy) {
  10:         transform(AffineTransform.getShearInstance(shx, shy));
  11:     }

View Full Code Here

getShearX

public double getShearX()
Returns the X coordinate shearing element (m01) of the 3x3 affine transformation matrix.
Returns:
a double value that is the X coordinate of the shearing element of the affine transformation matrix.
Usages and Demos :

View More Examples of getShearX()
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     public AffineTransform getModelTransformation() {
   7:         return metadata.getModelTransformation();
   8:         ...
   9: 
  10:         AffineTransform modelTransformation = getModelTransformation();
  11:         if (modelTransformation != null) {
  12:         ...
  13:             message.print(" [" + modelTransformation.getScaleX());
  14:             message.print("," + modelTransformation.getShearX());

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12: 
  13:     public double getShearX() { return theTransform.getShearX(); }

View Full Code Here
   1: import javax.vecmath.GMatrix;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:     
   6:     public Matrix(final AffineTransform transform) {
   7:         super(3,3, new double[] {
   8:         ...
   9:             transform.getScaleX(), transform.getShearX(), transform.getTranslateX(),
  10:             transform.getShearY(), transform.getScaleY(), transform.getTranslateY(),
  11:         ...
  12:     
  13:     public final AffineTransform toAffineTransform2D() throws IllegalStateException {

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.util.List;
   4:         ...
   5:     public float getCurrentScale( ) {
   6:         AffineTransform scrnTrans = getSVGContext().getScreenTransform();
   7:         if (scrnTrans != null)
   8:         ...
   9:         SVGContext context = getSVGContext();
  10:         AffineTransform scrnTrans = context.getScreenTransform();
  11:         float scale = 1;
  12:         ...
  13:             (scrnTrans.getScaleX()*delta, scrnTrans.getShearY()*delta,
  14:              scrnTrans.getShearX()*delta, scrnTrans.getScaleY()*delta,

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6: public abstract class XAffineTransform extends AffineTransform {
   7: 
   8:         ...
   9: 
  10:     protected XAffineTransform(final AffineTransform tr) {
  11:         super(tr);
  12:         ...
  13:                Math.abs(tr.getScaleY() - 1) <= tolerance &&
  14:                Math.abs(tr.getShearX())     <= tolerance &&

View Full Code Here

getShearY

public double getShearY()
Returns the Y coordinate shearing element (m10) of the 3x3 affine transformation matrix.
Returns:
a double value that is the Y coordinate of the shearing element of the affine transformation matrix.
Usages and Demos :

View More Examples of getShearY()
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     public AffineTransform getModelTransformation() {
   7:         return metadata.getModelTransformation();
   8:         ...
   9: 
  10:         AffineTransform modelTransformation = getModelTransformation();
  11:         if (modelTransformation != null) {
  12:         ...
  13:             message.print("," + modelTransformation.getScaleY());
  14:             message.print("," + modelTransformation.getShearY());

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12: 
  13:     public double getShearY() { return theTransform.getShearY(); }

View Full Code Here
   1: import javax.vecmath.GMatrix;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:     
   6:     public Matrix(final AffineTransform transform) {
   7:         super(3,3, new double[] {
   8:         ...
   9:             transform.getScaleX(), transform.getShearX(), transform.getTranslateX(),
  10:             transform.getShearY(), transform.getScaleY(), transform.getTranslateY(),
  11:             0,                     0,                         1
  12:         ...
  13:     
  14:     public final AffineTransform toAffineTransform2D() throws IllegalStateException {

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6: public abstract class XAffineTransform extends AffineTransform {
   7: 
   8:         ...
   9: 
  10:     protected XAffineTransform(final AffineTransform tr) {
  11:         super(tr);
  12:         ...
  13:                Math.abs(tr.getShearX())     <= tolerance &&
  14:                Math.abs(tr.getShearY())     <= tolerance &&

View Full Code Here
   1: import java.awt.color.ColorSpace;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     protected final boolean isScaleTranslate(MathTransform transform) {
   6:         if(!(transform instanceof AffineTransform))
   7:             return false;
   8:         ...
   9:         AffineTransform at = (AffineTransform) transform;
  10:         ...
  11:         return at.getShearX() < EPS && at.getShearY() < EPS;

View Full Code Here

getTranslateInstance

public static AffineTransform getTranslateInstance(double tx,
                                                   double ty)
Returns a transform representing a translation transformation. The matrix representing the returned transform is:
		[   1    0    tx  ]
		[   0    1    ty  ]
		[   0    0    1   ]
 
Parameters:
tx - the distance by which coordinates are translated in the X axis direction
ty - the distance by which coordinates are translated in the Y axis direction
Returns:
an AffineTransform object that represents a translation transformation, created with the specified vector.
Usages and Demos :

View More Examples of getTranslateInstance(double tx,double ty)
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:                 int deltay = hotSpot.y - oldHotSpot.y;
   6:                 AffineTransform trans =
   7:         ...
   8:                     AffineTransform.getTranslateInstance(deltax, deltay);
   9:         ...
  10:                 AffineTransform af = canvas.getTransform();

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:                 int deltay = hotSpot.y - oldHotSpot.y;
   6:                 AffineTransform trans =
   7:         ...
   8:                 AffineTransform.getTranslateInstance(deltax, deltay);
   9:         ...
  10:                 AffineTransform af = canvas.getTransform();

View Full Code Here
   1: import java.awt.Color;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: 
   6:         ZTransformAnimation transformAnimation1 = new ZTransformAnimation(AffineTransform.getTranslateInstance(0, 0),
   7:         ...
   8:                                                                           AffineTransform.getTranslateInstance(300, 0));
   9: 
  10:         ...
  11: 
  12:         ZTransformAnimation transformAnimation2 = new ZTransformAnimation(AffineTransform.getTranslateInstance(0, 20),

View Full Code Here
   1: package edu.uky.mip.component.canvas;
   2: import java.awt.geom.AffineTransform;
   3: import java.io.File;
   4:         ...
   5:     private AffineImageCanvas instance;
   6:     private AffineTransform transform=new AffineTransform();
   7: 
   8:         ...
   9:         double select = -scrollBar.getSelection();
  10:         af.preConcatenate(AffineTransform.getTranslateInstance(select-tx,0));
  11:         setTransform(af);
  12:         ...
  13:         double select = -scrollBar.getSelection();
  14:         af.preConcatenate(AffineTransform.getTranslateInstance(0,select-ty));

View Full Code Here
   1:     if (narrowBorder) sf *= narrowBorderFactor;
   2:     AffineTransform tr = AffineTransform.getTranslateInstance((double)iw/2.0, (double)ih/2.0);
   3:         ...
   4:     tr.concatenate(AffineTransform.getScaleInstance(sf, sf));
   5:     g.setTransform(tr);
   6:         ...
   7:         tr.concatenate(AffineTransform.getScaleInstance(sf, sf));
   8:         tr.concatenate(AffineTransform.getTranslateInstance(0.0, valencePortraitCenterShiftY));
   9:         g.setTransform(tr);

View Full Code Here

getTranslateX

public double getTranslateX()
Returns the X coordinate of the translation element (m02) of the 3x3 affine transformation matrix.
Returns:
a double value that is the X coordinate of the translation element of the affine transformation matrix.
Usages and Demos :

View More Examples of getTranslateX()
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:     
   6:     private AffineTransform _transform = new AffineTransform();
   7:     
   8:         ...
   9:         return new Point2D.Double(
  10:                 _transform.getTranslateX(), _transform.getTranslateY());
  11:     }

View Full Code Here
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:     
   6:     private AffineTransform _transform = new AffineTransform();
   7:     
   8:         ...
   9:         return new Point2D.Double(
  10:                 _transform.getTranslateX(), _transform.getTranslateY());
  11:     }

View Full Code Here
   1: import javax.vecmath.Matrix3d;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: 
   6:     public Matrix3(final AffineTransform transform) {
   7:         setMatrix(transform);
   8:         ...
   9: 
  10:     public void setMatrix(final AffineTransform transform) {
  11:         ...
  12:         m00=transform.getScaleX(); m01=transform.getShearX(); m02=transform.getTranslateX();

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     public AffineTransform getModelTransformation() {
   7:         return metadata.getModelTransformation();
   8:         ...
   9: 
  10:         AffineTransform modelTransformation = getModelTransformation();
  11:         if (modelTransformation != null) {
  12:         ...
  13:             message.print("," + modelTransformation.getShearY());
  14:             message.print("," + modelTransformation.getTranslateX());

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12:     
  13:     public double getTranslateX() { return theTransform.getTranslateX(); }

View Full Code Here

getTranslateY

public double getTranslateY()
Returns the Y coordinate of the translation element (m12) of the 3x3 affine transformation matrix.
Returns:
a double value that is the Y coordinate of the translation element of the affine transformation matrix.
Usages and Demos :

View More Examples of getTranslateY()
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:     
   6:     private AffineTransform _transform = new AffineTransform();
   7:     
   8:         ...
   9:         return new Point2D.Double(
  10:                 _transform.getTranslateX(), _transform.getTranslateY());
  11:     }

View Full Code Here
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:     
   6:     private AffineTransform _transform = new AffineTransform();
   7:     
   8:         ...
   9:         return new Point2D.Double(
  10:                 _transform.getTranslateX(), _transform.getTranslateY());
  11:     }

View Full Code Here
   1: import javax.vecmath.Matrix3d;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: 
   6:     public Matrix3(final AffineTransform transform) {
   7:         setMatrix(transform);
   8:         ...
   9: 
  10:     public void setMatrix(final AffineTransform transform) {
  11:         m00=transform.getScaleX(); m01=transform.getShearX(); m02=transform.getTranslateX();
  12:         ...
  13:         m10=transform.getShearY(); m11=transform.getScaleY(); m12=transform.getTranslateY();

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     public AffineTransform getModelTransformation() {
   7:         return metadata.getModelTransformation();
   8:         ...
   9: 
  10:         AffineTransform modelTransformation = getModelTransformation();
  11:         if (modelTransformation != null) {
  12:         ...
  13:             message.print("," + modelTransformation.getTranslateX());
  14:             message.print("," + modelTransformation.getTranslateY() + "]");

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12:     
  13:     public double getTranslateY() { return theTransform.getTranslateY(); }

View Full Code Here

getType

public int getType()
Retrieves the flag bits describing the conversion properties of this transform. The return value is either one of the constants TYPE_IDENTITY or TYPE_GENERAL_TRANSFORM, or a combination of the appriopriate flag bits. A valid combination of flag bits is an exclusive OR operation that can combine the TYPE_TRANSLATION flag bit in addition to either of the TYPE_UNIFORM_SCALE or TYPE_GENERAL_SCALE flag bits as well as either of the TYPE_QUADRANT_ROTATION or TYPE_GENERAL_ROTATION flag bits.
Returns:
the OR combination of any of the indicated flags that apply to this transform
Usages and Demos :

View More Examples of getType()
   1:         assertEquals(2, gg.getGridToCoordinateSystem2D().getDimSource());
   2:         assertTrue(gg.getGridToCoordinateSystem2D() instanceof AffineTransform);
   3:     }
   4:         ...
   5:                                                   new Envelope(minimum, maximum), null);
   6:         final AffineTransform tr = (AffineTransform) gg.getGridToCoordinateSystem2D();
   7:         assertEquals(AffineTransform.TYPE_UNIFORM_SCALE |
   8:         ...
   9:                      AffineTransform.TYPE_TRANSLATION, tr.getType());

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         assertEquals(2, gg.getGridToCoordinateSystem2D().getSourceDimensions());
   6:         assertTrue(gg.getGridToCoordinateSystem2D() instanceof AffineTransform);
   7:     }
   8:         ...
   9:                                 new GeneralEnvelope(minimum, maximum), null, false);
  10:         final AffineTransform tr = (AffineTransform) gg.getGridToCoordinateSystem2D();
  11:         assertEquals(AffineTransform.TYPE_UNIFORM_SCALE |
  12:         ...
  13:                      AffineTransform.TYPE_TRANSLATION, tr.getType());

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import junit.framework.Test;
   4:         ...
   5: 
   6:     private static int getFlipFromType(final AffineTransform tr) {
   7:         ...
   8:         return (tr.getType() & AffineTransform.TYPE_FLIP) != 0 ? -1 : +1;
   9:     }
  10:         ...
  11:     private static void runTest(final int f) {
  12:         final AffineTransform tr = new AffineTransform();

View Full Code Here
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5:         assertNull (mapper.getReverseAxis());
   6:         final AffineTransform tr1 = mapper.createAffineTransform();
   7:         ...
   8:         assertEquals(AffineTransform.TYPE_GENERAL_SCALE |
   9:         ...
  10:                      AffineTransform.TYPE_TRANSLATION, tr1.getType());

View Full Code Here
   1: import java.awt.geom.RectangularShape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     public Shape getSelectedArea(final AffineTransform transform)
   7:                                  throws NoninvertibleTransformException {
   8:         ...
   9:     private static boolean canReshape(final RectangularShape shape,
  10:                                       final AffineTransform transform) {
  11:         ...
  12:         final int type=transform.getType();

View Full Code Here

hashCode

public int hashCode()
Returns the hashcode for this transform.
Overrides:
hashCode in interface Object
Returns:
a hash code for this transform.
Usages and Demos :

View More Examples of hashCode()
   1: 
   2: import jp.ujihara.java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: {
   6:   private AffineTransform affineTransform;
   7:   private boolean isAntiAliased;
   8:         ...
   9:   {
  10:     return affineTransform == null ? 0 : affineTransform.hashCode();
  11:   }

View Full Code Here
   1: import java.awt.geom.Point2D;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final AffineTransform global;
   7: 
   8:         ...
   9:     protected LocalizationGridTransform2D(final int width, final int height, final double[] grid,
  10:                                           final AffineTransform global) {
  11:         this.width  = width;
  12:         ...
  13:     public int hashCode() {
  14:         return super.hashCode() ^ global.hashCode();

View Full Code Here
   1: import java.awt.Point;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private final AffineTransform global;
   7: 
   8:         ...
   9:     protected LocalizationGridTransform2D(final int width, final int height, final double[] grid,
  10:                                           final AffineTransform global)
  11:     {
  12:         ...
  13:     public int hashCode() {
  14:         return (int)serialVersionUID ^ super.hashCode() ^ global.hashCode();

View Full Code Here

inverseTransform

public void inverseTransform(double[] srcPts,
                             int srcOff,
                             double[] dstPts,
                             int dstOff,
                             int numPts)
            throws NoninvertibleTransformException
Inverse transforms an array of double precision coordinates by this transform. The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the specified offset in the order [x0, y0, x1, y1, ..., xn, yn].
Parameters:
srcPts - the array containing the source point coordinates. Each point is stored as a pair of x, y coordinates.
srcOff - the offset to the first point to be transformed in the source array
dstPts - the array into which the transformed point coordinates are returned. Each point is stored as a pair of x, y coordinates.
dstOff - the offset to the location of the first transformed point that is stored in the destination array
numPts - the number of point objects to be transformed
Throws:
NoninvertibleTransformException - if the matrix cannot be inverted.
Usages and Demos :

View More Examples of inverseTransform(double[] srcPts,int srcOff,double[] dstPts,int dstOff,int numPts)
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12:             double[] dest   = new double[2];
  13:             theTransform.inverseTransform(source,0,dest,0,1);

View Full Code Here
   1: import jp.ujihara.java.awt.RenderingHints;
   2: import jp.ujihara.java.awt.geom.AffineTransform;
   3: import jp.ujihara.java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     private AffineTransform transform;
   7:     private RenderingHints hints;
   8:         ...
   9:     
  10:     public AffineTransformOp(AffineTransform xform, int interpolationType)
  11:     {
  12:         ...
  13:             try {
  14:               transform.inverseTransform(dpts, 0, pts, 0, dst.getWidth() * 2);

View Full Code Here
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5:           double data[];
   6:           AffineTransform at = new AffineTransform();
   7:           AffineTransform ctm = context.pencil.graphics.getTransform();
   8:         ...
   9:           try {
  10:             at.inverseTransform(data, 0, transformedData, 0, 1);
  11:           }
  12:         ...
  13:           try {
  14:             at.inverseTransform(numberdata, 0, transformedData, 0, 1);

View Full Code Here

inverseTransform

public Point2D inverseTransform(Point2D ptSrc,
                                Point2D ptDst)
            throws NoninvertibleTransformException
Inverse transforms the specified ptSrc and stores the result in ptDst. If ptDst is null, a new Point2D object is allocated and then the result of the transform is stored in this object. In either case, ptDst, which contains the transformed point, is returned for convenience. If ptSrc and ptDst are the same object, the input point is correctly overwritten with the transformed point.
Parameters:
ptSrc - the point to be inverse transformed
ptDst - the resulting transformed point
Returns:
ptDst, which contains the result of the inverse transform.
Throws:
NoninvertibleTransformException - if the matrix cannot be inverted.
Usages and Demos :

View More Examples of inverseTransform(Point2D ptSrc,Point2D ptDst)
   1: import java.awt.event.MouseEvent;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5:     private Glyph currentGlyph;
   6:     private AffineTransform transform;
   7:     private Point2D.Double pStart = new Point2D.Double();
   8:         ...
   9:     public Glyph currentGlyph() { return currentGlyph; }
  10:     public AffineTransform transform() { return transform; }
  11:     public boolean isStarted() { return started; }
  12:         ...
  13:     pStart.setLocation(e.getX(), e.getY());
  14:     try { transform.inverseTransform(pStart, pStart); }

View Full Code Here
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5: 
   6:     private AffineTransform trans = new AffineTransform();
   7: 
   8:         ...
   9:       try {
  10:         trans.inverseTransform(result, result);
  11:       } catch (Exception e)
  12:         ...
  13:       target.transform(parent(), trans);
  14:       try { trans.inverseTransform(result, result);  } catch (Exception e) { }

View Full Code Here
   1:     
   2:     private AffineTransform m_glyphTransform;
   3:     private Font m_menuFont;
   4:         ...
   5:         m_currentInclude = null;
   6:         AffineTransform trans = new AffineTransform();
   7:         m_graphics = (Graphics2D) g;
   8:         ...
   9:         try {
  10:             m_glyphTransform.inverseTransform(source, retval);
  11:         } catch (Exception e) {

View Full Code Here
   1:   public Point getScreenPosition(VideoPanel vidPanel) {
   2:     AffineTransform toScreen = vidPanel.getPixelTransform();
   3:     if (!vidPanel.isDrawingInImageSpace()) {
   4:         ...
   5:     screenPt.setLocation(x, y);
   6:     AffineTransform toScreen = vidPanel.getPixelTransform();
   7:     if (!vidPanel.isDrawingInImageSpace()) {
   8:         ...
   9:     try {
  10:       toScreen.inverseTransform(screenPt, worldPt);
  11:     } catch(NoninvertibleTransformException ex) {
  12:         ...
  13:     int n = getFrameNumber(vidPanel);
  14:     AffineTransform at = vidPanel.getCoords().getToWorldTransform(n);

View Full Code Here
   1: import java.awt.geom.RectangularShape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6:     public Shape getSelectedArea(final AffineTransform transform)
   7:                                  throws NoninvertibleTransformException {
   8:         ...
   9:                 final Point2D.Float pp = new Point2D.Float(px, py);
  10:                 transform.inverseTransform(po, po);
  11:         ...
  12:                 transform.inverseTransform(pp, pp);

View Full Code Here

isIdentity

public boolean isIdentity()
Returns true if this AffineTransform is an identity transform.
Returns:
true if this AffineTransform is an identity transform; false otherwise.
Usages and Demos :

View More Examples of isIdentity()
   1: 
   2: import jp.ujihara.java.awt.geom.AffineTransform;
   3: import java.io.Serializable;
   4:         ...
   5: 
   6:   private AffineTransform affineTransform;
   7:   
   8:         ...
   9:   {
  10:     return (affineTransform == null ? false : affineTransform.isIdentity());
  11:   }

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12:     
  13:     public boolean isIdentity() { return theTransform.isIdentity(); }

View Full Code Here
   1:         Font font = ((SVGStylableImpl)ownerElement).getFont(null);
   2:         GlyphVector glyphVector = font.createGlyphVector(new FontRenderContext(new AffineTransform(), true, true),"x");
   3:         Shape xshape = glyphVector.getGlyphOutline(0);
   4:         ...
   5:         Font font = ((SVGStylableImpl)ownerElement).getFont(null);
   6:         GlyphVector glyphVector = font.createGlyphVector(new FontRenderContext(new AffineTransform(), true, true),"x");
   7:         Shape xshape = glyphVector.getGlyphOutline(0);
   8:         ...
   9: 
  10:   float getTransformedLength(AffineTransform transform) {
  11: 
  12:         ...
  13:     if (unitType == SVG_LENGTHTYPE_NUMBER || transform == null
  14:       || (transform != null && transform.isIdentity())) {

View Full Code Here

preConcatenate

public void preConcatenate(AffineTransform Tx)
Concatenates an AffineTransform Tx to this AffineTransform Cx in a less commonly used way such that Tx modifies the coordinate transformation relative to the absolute pixel space rather than relative to the existing user space. Cx is updated to perform the combined transformation. Transforming a point p by the updated transform Cx' is equivalent to first transforming p by the original transform Cx and then transforming the result by Tx like this: Cx'(p) = Tx(Cx(p)) In matrix notation, if this transform Cx is represented by the matrix [this] and Tx is represented by the matrix [Tx] then this method does the following:
		[this] = [Tx] x [this]
 
Parameters:
Tx - the AffineTransform object to be concatenated with this AffineTransform object.
Usages and Demos :

View More Examples of preConcatenate(AffineTransform Tx)
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5: public class ImageFigure extends AbstractFigure {
   6:     private AffineTransform _xf = new AffineTransform();
   7: 
   8:         ...
   9:         repaint();
  10:         _xf.preConcatenate(t);
  11:         repaint();

View Full Code Here
   1: import org.eclipse.swt.events.MouseEvent;
   2: import java.awt.geom.AffineTransform;
   3: import org.eclipse.swt.graphics.Rectangle;
   4:         ...
   5: 
   6:                 AffineTransform af=canvas.getTransform();
   7:         ...
   8:                 AffineTransform scale=
   9:                 AffineTransform.getScaleInstance(1/scale_rate,1/scale_rate);
  10:         ...
  11: 
  12:                 af.preConcatenate(scale);

View Full Code Here
   1: import org.eclipse.swt.events.MouseEvent;
   2: import java.awt.geom.AffineTransform;
   3: import org.eclipse.swt.graphics.Rectangle;
   4:         ...
   5: 
   6:                 AffineTransform af=canvas.getTransform();
   7:         ...
   8:                 AffineTransform scale=
   9:                 AffineTransform.getScaleInstance(scale_rate,scale_rate);
  10:         ...
  11:     
  12:                 af.preConcatenate(scale);

View Full Code Here
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:     
   6:     private AffineTransform _transform = new AffineTransform();
   7:     
   8:         ...
   9:         repaint();
  10:         _transform.preConcatenate(at);
  11:     repaint();

View Full Code Here
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:     
   6:     private AffineTransform _transform = new AffineTransform();
   7:     
   8:         ...
   9:         repaint();
  10:         _transform.preConcatenate(at);
  11:     repaint();

View Full Code Here

rotate

public void rotate(double theta)
Concatenates this transform with a rotation transformation. This is equivalent to calling concatenate(R), where R is an AffineTransform represented by the following matrix:
		[   cos(theta)    -sin(theta)    0   ]
		[   sin(theta)     cos(theta)    0   ]
		[       0              0         1   ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta - the angle of rotation in radians
Usages and Demos :

View More Examples of rotate(double theta)
   1: import java.awt.event.MouseEvent;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:             
   6:             AffineTransform at = display.getTransform();
   7:         ...
   8:             at.rotate(angle);
   9:             try {

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:             return;
   6:         AffineTransform t = new AffineTransform();
   7:         ...
   8:         t.rotate(-Math.PI / 2);
   9:         super.draw(new Point(-location.getY() - size.getHeight(), location

View Full Code Here
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.GeneralPath;
   4:         ...
   5:     public Shape createStrokedShape(Shape p) {
   6:         AffineTransform t = new AffineTransform();
   7:         ...
   8:         t.rotate(angle);
   9:         t.scale(x / SCALE, y / SCALE);

View Full Code Here
   1: import java.awt.font.TextLayout;
   2: import java.awt.geom.AffineTransform;
   3: import java2d.AnimatingSurface;
   4:         ...
   5:         int mindim = Math.min(w, h);
   6:         AffineTransform at = new AffineTransform();
   7:         at.translate((w - mindim) / 2.0,
   8:         ...
   9:             at.setToTranslation(.75, 0);
  10:             at.rotate(-Math.PI / 2.0);
  11:             at.scale(-1.0, 1.0);

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.GeneralPath;
   4:         ...
   5:                         shaftTail, shaftTip), length / shaftLength), finTail);
   6:         AffineTransform affineTransform = new AffineTransform();
   7:         ...
   8:         affineTransform.rotate((angle * Math.PI) / 180, finTail.getX(),
   9:             finTail.getY());

View Full Code Here

rotate

public void rotate(double theta,
                   double x,
                   double y)
Concatenates this transform with a transform that rotates coordinates around an anchor point. This operation is equivalent to translating the coordinates so that the anchor point is at the origin (S1), then rotating them about the new origin (S2), and finally translating so that the intermediate origin is restored to the coordinates of the original anchor point (S3).

This operation is equivalent to the following sequence of calls:

		translate(x, y);	// S3: final translation
		rotate(theta);		// S2: rotate around anchor
		translate(-x, -y);	// S1: translate anchor to origin
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta - the angle of rotation in radians
Usages and Demos :

View More Examples of rotate(double theta,double x,double y)
   1: import java.awt.Image;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:     g2.translate(pt.getX(), pt.getY());
   6:     AffineTransform trans = new AffineTransform();
   7:     trans.translate(-width/2, -height/2);
   8:         ...
   9:     trans.rotate(-theta, width/2, height/2);
  10:     trans.scale(width/image.getWidth(null), height/image.getHeight(null));

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:     g2.translate(pt.getX(), pt.getY());
   6:     AffineTransform trans = new AffineTransform();
   7:     trans.translate(-width/2, -height/2);
   8:         ...
   9:     trans.rotate(-theta, width/2, height/2);
  10:     trans.scale(width/image.getWidth(null), height/image.getHeight(null));

View Full Code Here
   1:     for(int i=0; i<36;i++){
   2:       AffineTransform at = g2.getTransform();
   3:         ...
   4:       at.rotate(-i*2*Math.PI/36, i1, j1);
   5:       g2.setTransform(at);
   6:         ...
   7:       g2.draw(new Line2D.Double(i1+protractorRadius-5, j1, i1 + protractorRadius, j1));
   8:       at.rotate(+i*2*Math.PI/36, i1, j1);
   9:       g2.setTransform(at);
  10:         ...
  11:     if(showTheta)tauBox.draw(panel, g);
  12:     AffineTransform at = g2.getTransform();

View Full Code Here
   1: import java.awt.*;
   2: import java.awt.geom.AffineTransform;
   3: import org.opensourcephysics.controls.*;
   4:         ...
   5:   private Object3D[] objects = new Object3D[] {new Object3D(this, 0)};
   6:   private AffineTransform transform = new AffineTransform();
   7: 
   8:         ...
   9:       transform.setTransform(originalTransform);
  10:       transform.rotate(-angle, pixel[0], pixel[1]);
  11:       _g2.setTransform(transform);

View Full Code Here
   1: import org.opensourcephysics.controls.*;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:   private Object3D[] objects = new Object3D[] {new Object3D(this, 0)};
   6:   private AffineTransform transform = new AffineTransform(), originalTransform = null;
   7: 
   8:         ...
   9:       transform.setTransform(originalTransform);
  10:       transform.rotate(-angle, pixel[0], pixel[1]);
  11:       _g2.setTransform(transform);

View Full Code Here

scale

public void scale(double sx,
                  double sy)
Concatenates this transform with a scaling transformation. This is equivalent to calling concatenate(S), where S is an AffineTransform represented by the following matrix:
		[   sx   0    0   ]
		[   0    sy   0   ]
		[   0    0    1   ]
 
Parameters:
sx - the factor by which coordinates are scaled along the X axis direction
sy - the factor by which coordinates are scaled along the Y axis direction
Usages and Demos :

View More Examples of scale(double sx,double sy)
   1:             Graphics2D g2 = (Graphics2D) g;
   2:             AffineTransform flipTrans = new AffineTransform();
   3:             double widthD = (double) getWidth();
   4:         ...
   5:             flipTrans.setToTranslation (widthD, 0);
   6:             flipTrans.scale(-1.0, 1);
   7:             g2.transform (flipTrans);
   8:             super.paint(g);
   9:         } else {

View Full Code Here
   1:             Graphics2D g2 = (Graphics2D) g;
   2:             AffineTransform flipTrans = new AffineTransform();
   3:             double widthD = (double) getWidth();
   4:         ...
   5:             flipTrans.setToTranslation (widthD, 0);
   6:             flipTrans.scale(-1.0, 1);
   7:             g2.transform (flipTrans);
   8:             super.paint(g);
   9:         } else {

View Full Code Here
   1:         Graphics2D ig = image.createGraphics();
   2:         ig.scale(.5, .5);
   3:         ig.setPaint(new Color(128,0,0));
   4:         ...
   5:         
   6:         AffineTransform at = new AffineTransform();
   7:         ...
   8:         at.scale(.5, .3);
   9:         at.translate(5, 10);

View Full Code Here
   1: import java.awt.font.TextLayout;
   2: import java.awt.geom.AffineTransform;
   3: import java2d.AnimatingSurface;
   4:         ...
   5:         int mindim = Math.min(w, h);
   6:         AffineTransform at = new AffineTransform();
   7:         at.translate((w - mindim) / 2.0,
   8:         ...
   9:                      (h - mindim) / 2.0);
  10:         at.scale(mindim, mindim);
  11:         at.translate(0.5, 0.5);
  12:         ...
  13:         at.scale(0.3, 0.3);

View Full Code Here
   1: import java.awt.*;
   2: import java.awt.geom.AffineTransform;
   3: import javax.swing.ImageIcon;
   4:         ...
   5:         Graphics2D g = (Graphics2D)g1;
   6:         AffineTransform transform = new AffineTransform();
   7:         int width = screen.getFullScreenWindow().getWidth() -
   8:         ...
   9:             if (flip) {
  10:                 transform.scale(-1, 1);
  11:                 transform.translate(-image.getWidth(null), 0);

View Full Code Here

setToIdentity

public void setToIdentity()
Resets this transform to the Identity transform.
Usages and Demos :

View More Examples of setToIdentity()
   1: import java.awt.Graphics2D;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.image.BufferedImage;
   4:         ...
   5:             Graphics2D g = buf.createGraphics();
   6:             AffineTransform txf = new AffineTransform();
   7:             g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
   8:         ...
   9:             for (int j=0; j<20; j++) {
  10:                 txf.setToIdentity();
  11:                 txf.translate(-100, -100);

View Full Code Here
   1: import java.awt.event.MouseEvent;
   2: import java.awt.geom.AffineTransform;
   3: import java.util.logging.Logger;
   4:         ...
   5:     private Adapters adapters = Adapters.getDefault();
   6:     private AffineTransform at = new AffineTransform();
   7:     protected CoordinatePoint releasePoint;
   8:         ...
   9: 
  10:         at.setToIdentity();
  11:         at.translate(
  12:         ...
  13: 
  14:             at.setToIdentity();

View Full Code Here
   1: import java.awt.event.ComponentListener;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.image.BufferedImage;
   4:         ...
   5:     private Graphics2D big2d;
   6:     private AffineTransform currentTransform;
   7: 
   8:         ...
   9: 
  10:             currentTransform.setToIdentity();
  11:             currentTransform.scale(xscale, xscale);
  12:         ...
  13:         } catch (Exception ex) {
  14:             currentTransform = new AffineTransform();

View Full Code Here
   1: import java.awt.Rectangle;
   2: import java.awt.geom.AffineTransform;
   3: import java.util.ArrayList;
   4:         ...
   5: 
   6:     public AffineTransform transform(Glyph root, AffineTransform output)
   7:     {
   8:         ...
   9:       if (root == this || parent() == null)
  10:         output.setToIdentity();
  11:       else

View Full Code Here
   1:         Component mappedComponent = getMappedComponent();
   2:         AffineTransform at = getViewToMiniMapTransform(mappedComponent);
   3:         g2d.transform(at);
   4:         ...
   5:     protected void drawViewRectangle(Graphics2D g2d, Rectangle viewPortRectangle) {
   6:         AffineTransform at = new AffineTransform();
   7:         ...
   8:         at.setToIdentity();
   9:         g2d.setTransform(at);
  10:         ...
  11:         AffineTransform at = new AffineTransform();
  12:         at.setToIdentity();

View Full Code Here

setToRotation

public void setToRotation(double theta)
Sets this transform to a rotation transformation. The matrix representing this transform becomes:
		[   cos(theta)    -sin(theta)    0   ]
		[   sin(theta)     cos(theta)    0   ]
		[       0              0         1   ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta - the angle of rotation in radians
Usages and Demos :

View More Examples of setToRotation(double theta)
   1:     public void trans(double w, double h) {
   2:         AffineTransform at = new AffineTransform();
   3:         at.setToScale(w, h);
   4:         ...
   5:     public void trans(double r) {
   6:         AffineTransform at = new AffineTransform();
   7:         ...
   8:         at.setToRotation(r);
   9:         myFont.deriveFont(at);

View Full Code Here
   1:       square = new Rectangle2D.Double(-50, -50, 100, 100);
   2:       t = new AffineTransform();
   3:       setRotate();
   4:         ...
   5:    {  
   6:       t.setToRotation(Math.toRadians(30));
   7:       repaint();
   8:         ...
   9:    private Rectangle2D square;
  10:    private AffineTransform t;
  11: }

View Full Code Here
   1: import java.awt.font.TextLayout;
   2: import java.awt.geom.AffineTransform;
   3: import java2d.AnimatingSurface;
   4:         ...
   5:         int mindim = Math.min(w, h);
   6:         AffineTransform at = new AffineTransform();
   7:         at.translate((w - mindim) / 2.0,
   8:         ...
   9:             Graphics2D g2dt = (Graphics2D) g2d.create();
  10:             at.setToRotation(-Math.PI / 2.0);
  11:             g2dt.transform(at);

View Full Code Here
   1:         index = text.indexOf("fox");
   2:         AffineTransform fontAT = new AffineTransform();
   3:         fontAT.rotate(Math.toRadians(10));
   4:         ...
   5: 
   6:         fontAT.setToRotation(Math.toRadians(-4));
   7:         fx = font.deriveFont(fontAT);
   8:         index = text.indexOf("jumped");
   9:         as.addAttribute(TextAttribute.FONT, fx, index, index+6);

View Full Code Here
   1:     
   2:         AffineTransform at = new AffineTransform();
   3:         at.setToScale(((float)bounds.width)/400.0f,((float)bounds.height)/400.0f);
   4:         ...
   5:         g.setComposite(comp);
   6:         at.setToRotation(-Math.PI/4.0);
   7:         g.transform(at);
   8:         ...
   9:         }
  10:         gDisplay.drawImage(image, new AffineTransform(),this);
  11:     }

View Full Code Here

setToRotation

public void setToRotation(double theta,
                          double x,
                          double y)
Sets this transform to a translated rotation transformation. This operation is equivalent to translating the coordinates so that the anchor point is at the origin (S1), then rotating them about the new origin (S2), and finally translating so that the intermediate origin is restored to the coordinates of the original anchor point (S3).

This operation is equivalent to the following sequence of calls:

	    setToTranslation(x, y);	// S3: final translation
	    rotate(theta);		// S2: rotate around anchor
	    translate(-x, -y);		// S1: translate anchor to origin
 
The matrix representing this transform becomes:
		[   cos(theta)    -sin(theta)    x-x*cos+y*sin  ]
		[   sin(theta)     cos(theta)    y-x*sin-y*cos  ]
		[       0              0               1        ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta - the angle of rotation in radians
Usages and Demos :

View More Examples of setToRotation(double theta,double x,double y)
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Ellipse2D;
   4:         ...
   5:         p.setLocation(_originX + _length, _originY);
   6:         AffineTransform at = new AffineTransform();
   7:         ...
   8:         at.setToRotation(_normal, _originX, _originY);
   9:         at.transform(p,p);
  10:         ...
  11:         AffineTransform at = new AffineTransform();
  12:         at.setToRotation(_normal, _originX, _originY);

View Full Code Here
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Ellipse2D;
   4:         ...
   5:         }
   6:         AffineTransform at = new AffineTransform();
   7:         ...
   8:         at.setToRotation(_normal, _originX, _originY);
   9:         at.transform(p,p);
  10:         ...
  11:         AffineTransform at = new AffineTransform();
  12:         at.setToRotation(_normal, _originX, _originY);

View Full Code Here
   1:   protected int width = 4;
   2:   protected AffineTransform rotation = new AffineTransform();
   3:   protected TPoint tail = new LineEnd();
   4:         ...
   5:     double theta = Math.atan2(p2.y - p1.y, p2.x - p1.x);
   6:     rotation.setToRotation(theta, p1.x, p1.y);
   7:     rotation.translate(p1.x, p1.y);
   8:     float d = (float)p1.distance(p2);
   9:     path.reset();

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12:     {
  13:         theTransform.setToRotation(theta,x,y);

View Full Code Here

setToScale

public void setToScale(double sx,
                       double sy)
Sets this transform to a scaling transformation. The matrix representing this transform becomes:
		[   sx   0    0   ]
		[   0    sy   0   ]
		[   0    0    1   ]
 
Parameters:
sx - the factor by which coordinates are scaled along the X axis direction
sy - the factor by which coordinates are scaled along the Y axis direction
Usages and Demos :

View More Examples of setToScale(double sx,double sy)
   1:     public void trans(double w, double h) {
   2:         AffineTransform at = new AffineTransform();
   3:         ...
   4:         at.setToScale(w, h);
   5:         myFont.deriveFont(at);
   6:         ...
   7:     public void trans(double r) {
   8:         AffineTransform at = new AffineTransform();
   9:         at.setToRotation(r);

View Full Code Here
   1:       square = new Rectangle2D.Double(-50, -50, 100, 100);
   2:       t = new AffineTransform();
   3:       setRotate();
   4:         ...
   5:    {  
   6:       t.setToScale(2.0, 1.5);
   7:       repaint();
   8:         ...
   9:    private Rectangle2D square;
  10:    private AffineTransform t;
  11: }

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import junit.framework.Test;
   4:         ...
   5: 
   6:     private static int getFlipFromType(final AffineTransform tr) {
   7:         ...
   8:         return (tr.getType() & AffineTransform.TYPE_FLIP) != 0 ? -1 : +1;
   9:     }
  10:         ...
  11:         final AffineTransform tr = new AffineTransform();
  12:         tr.setToScale(1, f);

View Full Code Here
   1: 
   2:   private AffineTransform scaleTransform        = new AffineTransform(1.0,0.0,0.0,1.0,0.0,0.0);
   3:         ...
   4:   private AffineTransform viewportTransform     = new AffineTransform(1.0,0.0,0.0,1.0,0.0,0.0);
   5:           AffineTransform fullTransform         = new AffineTransform(1.0,0.0,0.0,1.0,0.0,0.0);
   6:         ...
   7:     
   8:     scaleTransform.setToScale(zFactor*scaleX,zFactor*scaleY);
   9:     fullTransform.preConcatenate(scaleTransform);

View Full Code Here
   1:     Graphics2D g2d = im.createGraphics();
   2:     AffineTransform t = new AffineTransform();
   3:     double x = Double.parseDouble(horizontal_stretch.getText());
   4:         ...
   5:     double y1 = Double.parseDouble(vertical_skew.getText());
   6:         t.setToScale(x/100,y/100);
   7: 
   8:         if (im.getWidth()* (x/100)*im.getHeight()* (y/100)>=3000000)
   9:         ok_action = false;

View Full Code Here

setToShear

public void setToShear(double shx,
                       double shy)
Sets this transform to a shearing transformation. The matrix representing this transform becomes:
		[   1   shx   0   ]
		[  shy   1    0   ]
		[   0    0    1   ]
 
Parameters:
shx - the multiplier by which coordinates are shifted in the direction of the positive X axis as a factor of their Y coordinate
shy - the multiplier by which coordinates are shifted in the direction of the positive Y axis as a factor of their X coordinate
Usages and Demos :

View More Examples of setToShear(double shx,double shy)
   1:       square = new Rectangle2D.Double(-50, -50, 100, 100);
   2:       t = new AffineTransform();
   3:       setRotate();
   4:         ...
   5:    {  
   6:       t.setToShear(-0.2, 0);
   7:       repaint();
   8:         ...
   9:    private Rectangle2D square;
  10:    private AffineTransform t;
  11: }

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12: 
  13:     public void setToShear(double shx,double shy) { theTransform.setToShear(shx,shy); }

View Full Code Here

setToTranslation

public void setToTranslation(double tx,
                             double ty)
Sets this transform to a translation transformation. The matrix representing this transform becomes:
		[   1    0    tx  ]
		[   0    1    ty  ]
		[   0    0    1   ]
 
Parameters:
tx - the distance by which coordinates are translated in the X axis direction
ty - the distance by which coordinates are translated in the Y axis direction
Usages and Demos :

View More Examples of setToTranslation(double tx,double ty)
   1:   public void paintIcon(Component _c, Graphics _g, int _x, int _y) {
   2:     AffineTransform at= new AffineTransform();
   3:         ...
   4:     at.setToTranslation(_x, _y);
   5:     at.translate(taille_ / 2, taille_ / 2);
   6:     at.rotate(s_.rotationZ * Math.PI / 180.);
   7:     at.scale(taille_, taille_);

View Full Code Here
   1: import java.awt.font.TextLayout;
   2: import java.awt.geom.AffineTransform;
   3: import javax.swing.JLabel;
   4:         ...
   5:         float sw = (float) tl.getBounds().getWidth();
   6:         AffineTransform transform = new AffineTransform();
   7:         ...
   8:         transform.setToTranslation(4, getFont().getSize()+4);
   9:         Shape shape = tl.getOutline(transform);

View Full Code Here
   1:       square = new Rectangle2D.Double(-50, -50, 100, 100);
   2:       t = new AffineTransform();
   3:       setRotate();
   4:         ...
   5:    {  
   6:       t.setToTranslation(20, 15);
   7:       repaint();
   8:         ...
   9:    private Rectangle2D square;
  10:    private AffineTransform t;
  11: }

View Full Code Here
   1: import java.awt.font.TextLayout;
   2: import java.awt.geom.AffineTransform;
   3: import java2d.AnimatingSurface;
   4:         ...
   5:         int mindim = Math.min(w, h);
   6:         AffineTransform at = new AffineTransform();
   7:         at.translate((w - mindim) / 2.0,
   8:         ...
   9:             AffineTransform at = new AffineTransform();
  10:             at.setToTranslation(Twidth, -0.1);
  11:             at.scale(0.6, 0.6);
  12:         ...
  13:             new TextLayout(theR.toString(),theFont, g2d.getFontRenderContext()).draw(g2d, 0.0f, 0.0f);
  14:             at.setToTranslation(Rwidth+0.75, 0);

View Full Code Here
   1:       
   2:       AffineTransform at = new AffineTransform();
   3:         ...
   4:       at.setToTranslation(0.0, base-rv.getValue());
   5:       at.scale(width / oBounds.getWidth(), rv.getValue() / oBounds.getHeight());
   6:       at.translate(-oBounds.getMinX(), -oBounds.getMinY());
   7:       outline = at.createTransformedShape(outline);

View Full Code Here

setTransform

public void setTransform(double m00,
                         double m10,
                         double m01,
                         double m11,
                         double m02,
                         double m12)
Sets this transform to the matrix specified by the 6 double precision values.
Parameters:
Usages and Demos :

View More Examples of setTransform(double m00,double m10,double m01,double m11,double m02,double m12)
   1: 
   2: import java.awt.geom.AffineTransform;
   3: public final class GrMorphisme {
   4:         ...
   5: 
   6:   public void creeAffineTransorm2D(AffineTransform _mToModify){
   7:         ...
   8:     _mToModify.setTransform(a[0][0], a[0][1], a[1][0], a[1][1], a[3][0], a[3][1]);
   9:   }
  10:         ...
  11: 
  12:   public AffineTransform creeAffineTransorm2D(){

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import junit.framework.Test;
   4:         ...
   5: 
   6:     private static int getFlipFromType(final AffineTransform tr) {
   7:         ...
   8:         return (tr.getType() & AffineTransform.TYPE_FLIP) != 0 ? -1 : +1;
   9:     }
  10:         ...
  11:         r = Math.toRadians(-90 * f);
  12:         tr.setTransform(0, 1, f, 0, 0, 0);

View Full Code Here
   1: import java.awt.Stroke;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:     protected Point2D     m_tmpPoint = new Point2D.Double();
   6:     protected AffineTransform m_transform = new AffineTransform();
   7: 
   8:         ...
   9:             
  10:             m_transform.setTransform(is,0,0,is,x,y);
  11:             g.drawImage(img, m_transform, null);

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.NoninvertibleTransformException;
   4:         ...
   5: 
   6: public abstract class XAffineTransform extends AffineTransform {
   7: 
   8:         ...
   9: 
  10:     protected XAffineTransform(final AffineTransform tr) {
  11:         super(tr);
  12:         ...
  13:         checkPermission();
  14:         super.setTransform(m00, m10, m01, m11, m02, m12);

View Full Code Here
   1: 
   2:   public AffineTransform getToImageTransform(int n) {
   3:     if (n >= length) setLength(n + 1);
   4:         ...
   5:     return (AffineTransform)toImage.get(n).clone();
   6:   }
   7:         ...
   8: 
   9:   public AffineTransform getToWorldTransform(int n) {
  10:     if (n >= length) setLength(n + 1);
  11:         ...
  12:     double sin = sine.get(n);
  13:     at.setTransform(sx*cos, -sy*sin, -sx*sin, -sy*cos, tx, ty);

View Full Code Here

setTransform

public void setTransform(AffineTransform Tx)
Sets this transform to a copy of the transform in the specified AffineTransform object.
Parameters:
Tx - the AffineTransform object from which to copy the transform
Usages and Demos :

View More Examples of setTransform(AffineTransform Tx)
   1: import java.awt.Rectangle;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5: {
   6:     public abstract AffineTransform transform();
   7: 
   8:         ...
   9:     public AffineTransform transform(Glyph root, AffineTransform output)
  10:     {
  11:         ...
  12:       if (root == this || parent() == null)
  13:         output.setTransform(transform());

View Full Code Here
   1: import java.awt.*;
   2: import java.awt.geom.AffineTransform;
   3: import org.opensourcephysics.controls.*;
   4:         ...
   5:   private Object3D[] objects = new Object3D[] {new Object3D(this, 0)};
   6:   private AffineTransform transform = new AffineTransform();
   7: 
   8:         ...
   9:       AffineTransform originalTransform = _g2.getTransform();
  10:       transform.setTransform(originalTransform);
  11:       transform.rotate(-angle, pixel[0], pixel[1]);
  12:         ...
  13:       _g2.setTransform(transform);

View Full Code Here
   1: import org.opensourcephysics.controls.*;
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:   private Object3D[] objects = new Object3D[] {new Object3D(this, 0)};
   6:   private AffineTransform transform = new AffineTransform(), originalTransform = null;
   7: 
   8:         ...
   9:       originalTransform = _g2.getTransform();
  10:       transform.setTransform(originalTransform);
  11:       transform.rotate(-angle, pixel[0], pixel[1]);
  12:         ...
  13:       _g2.setTransform(transform);

View Full Code Here
   1: import java.awt.*;
   2: import java.awt.geom.AffineTransform;
   3: import org.opensourcephysics.controls.*;
   4:         ...
   5:   private Object3D[] objects = new Object3D[] {new Object3D(this, 0)};
   6:   private AffineTransform transform = new AffineTransform();
   7:   private TextLine textLine = new TextLine();
   8:         ...
   9:       AffineTransform originalTransform = _g2.getTransform();
  10:       transform.setTransform(originalTransform);
  11:       transform.rotate(angle, pixel[0], pixel[1]);
  12:         ...
  13:       _g2.setTransform(transform);

View Full Code Here
   1:   protected Object3D[] objects    = new Object3D[] { new Object3D(this,0) };
   2:   protected AffineTransform transform = new AffineTransform();
   3: 
   4:         ...
   5:     RectangularShape shape = (RectangularShape) style.displayObject;
   6:     AffineTransform originalTransform = _g2.getTransform();
   7:         ...
   8:     transform.setTransform(originalTransform);
   9:     transform.rotate(-style.angle,pixelOrigin[0],pixelOrigin[1]);
  10:         ...
  11:     _g2.setTransform(transform);

View Full Code Here

shear

public void shear(double shx,
                  double shy)
Concatenates this transform with a shearing transformation. This is equivalent to calling concatenate(SH), where SH is an AffineTransform represented by the following matrix:
		[   1   shx   0   ]
		[  shy   1    0   ]
		[   0    0    1   ]
 
Parameters:
shx - the multiplier by which coordinates are shifted in the direction of the positive X axis as a factor of their Y coordinate
shy - the multiplier by which coordinates are shifted in the direction of the positive Y axis as a factor of their X coordinate
Usages and Demos :

View More Examples of shear(double shx,double shy)
   1: import java.awt.event.*;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.font.TextAttribute;
   4:         ...
   5:         float sh = (float) tl.getBounds().getHeight();
   6:         Shape sha = tl.getOutline(AffineTransform.getTranslateInstance(w/2-sw/2, h*0.2+sh/2));
   7:         g2.setColor(Color.blue);
   8:         ...
   9:         sh = (float) tl.getBounds().getHeight();
  10:         sha = tl.getOutline(AffineTransform.getTranslateInstance(w/2-sw/2,h*0.5+sh/2));
  11:         g2.setColor(Color.black);
  12:         ...
  13:         AffineTransform fontAT = new AffineTransform();
  14:         fontAT.shear(-0.2, 0.0);

View Full Code Here
   1: import java.awt.event.*;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.font.TextAttribute;
   4:         ...
   5:         float sh = (float) tl.getBounds().getHeight();
   6:         Shape sha = tl.getOutline(AffineTransform.getTranslateInstance(w/2-sw/2, h*0.2+sh/2));
   7:         g2.setColor(Color.blue);
   8:         ...
   9:         sh = (float) tl.getBounds().getHeight();
  10:         sha = tl.getOutline(AffineTransform.getTranslateInstance(w/2-sw/2,h*0.5+sh/2));
  11:         g2.setColor(Color.black);
  12:         ...
  13:         AffineTransform fontAT = new AffineTransform();
  14:         fontAT.shear(-0.2, 0.0);

View Full Code Here
   1:         CanvasPane pane = canvas.getCanvasPane();
   2:         AffineTransform t = new AffineTransform();
   3: 
   4:         ...
   5:         t.translate(200,150);
   6:         t.shear(xshear/100.0, yshear/100.0);
   7:         t.scale(scale/100.0, scale/100.0);
   8:         ...
   9:     public void setCanvas(JCanvas canvas) {
  10:         AffineTransform t = null;
  11:         if (this.canvas != null) {

View Full Code Here
   1:         CanvasPane pane = canvas.getCanvasPane();
   2:         AffineTransform t = new AffineTransform();
   3: 
   4:         ...
   5:         t.translate(200,150);
   6:         t.shear(xshear/100.0, yshear/100.0);
   7:         t.rotate(rotation/100.0 * java.lang.Math.PI);
   8:         ...
   9:     public void setCanvas(JCanvas canvas) {
  10:         AffineTransform t = null;
  11:         if (this.canvas != null) {

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12:     
  13:     public void shear(double shx,double shy) { theTransform.shear(shx,shy); }

View Full Code Here

toString

public String toString()
Returns a String that represents the value of this Object.
Overrides:
toString in interface Object
Returns:
a String representing the value of this Object.
Usages and Demos :

View More Examples of toString()
   1: 
   2: import java.awt.geom.AffineTransform;
   3: 
   4:         ...
   5:         
   6:     private AffineTransform theTransform = null;
   7:     
   8:         ...
   9:     public Transform2D() { theTransform = new AffineTransform(); }
  10: 
  11:         ...
  12:     {
  13:         return "Transform2D: " + theTransform.toString();

View Full Code Here
   1: 
   2:   AffineTransform viewboxToViewportTransform;
   3: 
   4:         ...
   5:     super.setAttribute("height", "600");
   6:     super.setAttribute("preserveAspectRatio", ((SVGPreserveAspectRatioImpl)getPreserveAspectRatio().getBaseVal()).toString());
   7: 
   8:         ...
   9: 
  10:   public AffineTransform getViewboxToViewportTransform() {
  11:     return viewboxToViewportTransform;
  12:         ...
  13: 
  14:     viewboxToViewportTransform = new AffineTransform();

View Full Code Here

transform

public void transform(double[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Transforms an array of double precision coordinates by this transform. The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the indicated offset in the order [x0, y0, x1, y1, ..., xn, yn].
Parameters:
srcPts - the array containing the source point coordinates. Each point is stored as a pair of x, y coordinates.
srcOff - the offset to the first point to be transformed in the source array
dstPts - the array into which the transformed point coordinates are returned. Each point is stored as a pair of x, y coordinates.
dstOff - the offset to the location of the first transformed point that is stored in the destination array
numPts - the number of point objects to be transformed
Usages and Demos :

View More Examples of transform(double[] srcPts,int srcOff,double[] dstPts,int dstOff,int numPts)
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5:     PathIterator iter;
   6:     AffineTransform transform;
   7: 
   8:         ...
   9:     public TransformPathIterator(PathIterator iter, AffineTransform transform) {
  10:         this.iter = iter;
  11:         ...
  12:         case SEG_LINETO:
  13:             transform.transform(coords, 0, coords, 0, 1);

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PolylineIterator (Polyline2D pl, AffineTransform at) {
   7:         int count = pl.getVertexCount() * 2;
   8:         ...
   9:             } else {
  10:                 at.transform(f._coords, 0, _coords, 0, count/2);
  11:             }
  12:         ...
  13:             } else {
  14:                 at.transform(d._coords, 0, _coords, 0, count/2);

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PathIterator getPathIterator(final AffineTransform at) {
   7:         return new PathIterator() {
   8:         ...
   9:                     if (at != null) {
  10:                         at.transform(coords, 0, coords, 0, 1);
  11:                     }
  12:         ...
  13:                     if (at != null) {
  14:                         at.transform(coords, 0, coords, 0, 1);

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     
   6:     public void transform(AffineTransform at) {
   7:         ...
   8:         at.transform(clip,0,tmp,0,4);
   9:         double[] s = tmp;

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PolygonIterator (Polygon2D pl, AffineTransform at) {
   7:         int count = pl.getVertexCount() * 2;
   8:         ...
   9:             } else {
  10:                 at.transform(f._coords, 0, _coords, 0, count/2);
  11:             }
  12:         ...
  13:             } else {
  14:                 at.transform(d._coords, 0, _coords, 0, count/2);

View Full Code Here

transform

public void transform(double[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Transforms an array of double precision coordinates by this transform and stores the results into an array of floats. The coordinates are stored in the arrays starting at the specified offset in the order [x0, y0, x1, y1, ..., xn, yn].
Parameters:
srcPts - the array containing the source point coordinates. Each point is stored as a pair of x, y coordinates.
srcOff - the offset to the first point to be transformed in the source array
dstPts - the array into which the transformed point coordinates are returned. Each point is stored as a pair of x, y coordinates.
dstOff - the offset to the location of the first transformed point that is stored in the destination array
numPts - the number of point objects to be transformed
Usages and Demos :

View More Examples of transform(double[] srcPts,int srcOff,float[] dstPts,int dstOff,int numPts)
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5:     PathIterator iter;
   6:     AffineTransform transform;
   7: 
   8:         ...
   9:     public TransformPathIterator(PathIterator iter, AffineTransform transform) {
  10:         this.iter = iter;
  11:         ...
  12:         case SEG_LINETO:
  13:             transform.transform(coords, 0, coords, 0, 1);

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PolylineIterator (Polyline2D pl, AffineTransform at) {
   7:         int count = pl.getVertexCount() * 2;
   8:         ...
   9:             } else {
  10:                 at.transform(f._coords, 0, _coords, 0, count/2);
  11:             }
  12:         ...
  13:             } else {
  14:                 at.transform(d._coords, 0, _coords, 0, count/2);

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PathIterator getPathIterator(final AffineTransform at) {
   7:         return new PathIterator() {
   8:         ...
   9:                     if (at != null) {
  10:                         at.transform(coords, 0, coords, 0, 1);
  11:                     }
  12:         ...
  13:                     if (at != null) {
  14:                         at.transform(coords, 0, coords, 0, 1);

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     
   6:     public void transform(AffineTransform at) {
   7:         ...
   8:         at.transform(clip,0,tmp,0,4);
   9:         double[] s = tmp;

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PolygonIterator (Polygon2D pl, AffineTransform at) {
   7:         int count = pl.getVertexCount() * 2;
   8:         ...
   9:             } else {
  10:                 at.transform(f._coords, 0, _coords, 0, count/2);
  11:             }
  12:         ...
  13:             } else {
  14:                 at.transform(d._coords, 0, _coords, 0, count/2);

View Full Code Here

transform

public void transform(float[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Transforms an array of floating point coordinates by this transform and stores the results into an array of doubles. The coordinates are stored in the arrays starting at the specified offset in the order [x0, y0, x1, y1, ..., xn, yn].
Parameters:
srcPts - the array containing the source point coordinates. Each point is stored as a pair of x, y coordinates.
srcOff - the offset to the first point to be transformed in the source array
dstPts - the array into which the transformed point coordinates are returned. Each point is stored as a pair of x, y coordinates.
dstOff - the offset to the location of the first transformed point that is stored in the destination array
numPts - the number of points to be transformed
Usages and Demos :

View More Examples of transform(float[] srcPts,int srcOff,double[] dstPts,int dstOff,int numPts)
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5:     PathIterator iter;
   6:     AffineTransform transform;
   7: 
   8:         ...
   9:     public TransformPathIterator(PathIterator iter, AffineTransform transform) {
  10:         this.iter = iter;
  11:         ...
  12:         case SEG_LINETO:
  13:             transform.transform(coords, 0, coords, 0, 1);

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PolylineIterator (Polyline2D pl, AffineTransform at) {
   7:         int count = pl.getVertexCount() * 2;
   8:         ...
   9:             } else {
  10:                 at.transform(f._coords, 0, _coords, 0, count/2);
  11:             }
  12:         ...
  13:             } else {
  14:                 at.transform(d._coords, 0, _coords, 0, count/2);

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PathIterator getPathIterator(final AffineTransform at) {
   7:         return new PathIterator() {
   8:         ...
   9:                     if (at != null) {
  10:                         at.transform(coords, 0, coords, 0, 1);
  11:                     }
  12:         ...
  13:                     if (at != null) {
  14:                         at.transform(coords, 0, coords, 0, 1);

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     
   6:     public void transform(AffineTransform at) {
   7:         ...
   8:         at.transform(clip,0,tmp,0,4);
   9:         double[] s = tmp;

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PolygonIterator (Polygon2D pl, AffineTransform at) {
   7:         int count = pl.getVertexCount() * 2;
   8:         ...
   9:             } else {
  10:                 at.transform(f._coords, 0, _coords, 0, count/2);
  11:             }
  12:         ...
  13:             } else {
  14:                 at.transform(d._coords, 0, _coords, 0, count/2);

View Full Code Here

transform

public void transform(float[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Transforms an array of floating point coordinates by this transform. The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the specified offset in the order [x0, y0, x1, y1, ..., xn, yn].
Parameters:
srcPts - the array containing the source point coordinates. Each point is stored as a pair of x, y coordinates.
srcOff - the offset to the first point to be transformed in the source array
dstPts - the array into which the transformed point coordinates are returned. Each point is stored as a pair of x, y coordinates.
dstOff - the offset to the location of the first transformed point that is stored in the destination array
numPts - the number of points to be transformed
Usages and Demos :

View More Examples of transform(float[] srcPts,int srcOff,float[] dstPts,int dstOff,int numPts)
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5:     PathIterator iter;
   6:     AffineTransform transform;
   7: 
   8:         ...
   9:     public TransformPathIterator(PathIterator iter, AffineTransform transform) {
  10:         this.iter = iter;
  11:         ...
  12:         case SEG_LINETO:
  13:             transform.transform(coords, 0, coords, 0, 1);

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PolylineIterator (Polyline2D pl, AffineTransform at) {
   7:         int count = pl.getVertexCount() * 2;
   8:         ...
   9:             } else {
  10:                 at.transform(f._coords, 0, _coords, 0, count/2);
  11:             }
  12:         ...
  13:             } else {
  14:                 at.transform(d._coords, 0, _coords, 0, count/2);

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PathIterator getPathIterator(final AffineTransform at) {
   7:         return new PathIterator() {
   8:         ...
   9:                     if (at != null) {
  10:                         at.transform(coords, 0, coords, 0, 1);
  11:                     }
  12:         ...
  13:                     if (at != null) {
  14:                         at.transform(coords, 0, coords, 0, 1);

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     
   6:     public void transform(AffineTransform at) {
   7:         ...
   8:         at.transform(clip,0,tmp,0,4);
   9:         double[] s = tmp;

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PolygonIterator (Polygon2D pl, AffineTransform at) {
   7:         int count = pl.getVertexCount() * 2;
   8:         ...
   9:             } else {
  10:                 at.transform(f._coords, 0, _coords, 0, count/2);
  11:             }
  12:         ...
  13:             } else {
  14:                 at.transform(d._coords, 0, _coords, 0, count/2);

View Full Code Here

transform

public Point2D transform(Point2D ptSrc,
                         Point2D ptDst)
Transforms the specified ptSrc and stores the result in ptDst. If ptDst is null, a new Point2D object is allocated and then the result of the transformation is stored in this object. In either case, ptDst, which contains the transformed point, is returned for convenience. If ptSrc and ptDst are the same object, the input point is correctly overwritten with the transformed point.
Parameters:
ptSrc - the specified Point2D to be transformed
ptDst - the specified Point2D that stores the result of transforming ptSrc
Returns:
the ptDst after transforming ptSrc and stroring the result in ptDst.
Usages and Demos :

View More Examples of transform(Point2D ptSrc,Point2D ptDst)
   1: import org.w3c.dom.DOMException;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5: 
   6:     AffineTransform transform = ((SVGMatrixImpl)matrix).getAffineTransform();
   7: 
   8:         ...
   9:     Point2D dstPoint = new Point2D.Double();
  10:     transform.transform(srcPoint, dstPoint);

View Full Code Here
   1: 
   2:     static Shape toShape(XPoint2d a_point, AffineTransform a_trans) {
   3:         double x = a_point.getX();
   4:         ...
   5:         dest = new Point2D.Double();
   6:         dest = a_trans.transform(source, dest);
   7:         x = dest.getX();
   8:         ...
   9: 
  10:     public static boolean hit(GlyphObject a_object, Rectangle2D a_rect, AffineTransform a_trans) {
  11:         int ppem = EObject.getDisplay().getPpem();
  12:         ...
  13:     
  14:     public static XPoint2d createTransform(XPoint2d a_point, AffineTransform a_trans) {

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.GeneralPath;
   4:         ...
   5:                         shaftTail, shaftTip), length / shaftLength), finTail);
   6:         AffineTransform affineTransform = new AffineTransform();
   7:         affineTransform.rotate((angle * Math.PI) / 180, finTail.getX(),
   8:         ...
   9: 
  10:         return affineTransform.transform(finTip, null);
  11:     }

View Full Code Here
   1: 
   2:     public void draw(Graphics g, AffineTransform trans)
   3:     {
   4:         ...
   5:         trans.transform(p, P);
   6:         ((Graphics2D) g).drawString(label, (float) P.getX(), (float) P.getY());
   7:         ...
   8: 
   9:     public static void setFont(AffineTransform trans) {
  10:     font = masterFont.deriveFont(trans);
  11:         ...
  12:     
  13:     public void draw(Color color, Graphics g, AffineTransform trans) {

View Full Code Here
   1: import java.awt.*;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:       Point2D dest = new Point2D.Double(0, 0);
   6:       AffineTransform t = modele_.getRasterTransform();
   7:       if (t != null) {
   8:         ...
   9:         t.transform(d, dest);
  10:         r.ajuste(dest.getX(), dest.getY(), 0);
  11:         ...
  12:         d.setLocation(modele_.getImage().getWidth(this), modele_.getImage().getHeight(this));
  13:         t.transform(d, dest);

View Full Code Here

transform

public void transform(Point2D[] ptSrc,
                      int srcOff,
                      Point2D[] ptDst,
                      int dstOff,
                      int numPts)
Transforms an array of point objects by this transform. If any element of the ptDst array is null, a new Point2D object is allocated and stored into that element before storing the results of the transformation.

Note that this method does not take any precautions to avoid problems caused by storing results into Point2D objects that will be used as the source for calculations further down the source array. This method does guarantee that if a specified Point2D object is both the source and destination for the same single point transform operation then the results will not be stored until the calculations are complete to avoid storing the results on top of the operands. If, however, the destination Point2D object for one operation is the same object as the source Point2D object for another operation further down the source array then the original coordinates in that point are overwritten before they can be converted.

Parameters:
ptSrc - the array containing the source point objects
srcOff - the offset to the first point object to be transformed in the source array
ptDst - the array into which the transform point objects are returned
dstOff - the offset to the location of the first transformed point object that is stored in the destination array
numPts - the number of point objects to be transformed
Usages and Demos :

View More Examples of transform(Point2D[] ptSrc,int srcOff,Point2D[] ptDst,int dstOff,int numPts)
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5:     PathIterator iter;
   6:     AffineTransform transform;
   7: 
   8:         ...
   9:     public TransformPathIterator(PathIterator iter, AffineTransform transform) {
  10:         this.iter = iter;
  11:         ...
  12:         case SEG_LINETO:
  13:             transform.transform(coords, 0, coords, 0, 1);

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PolylineIterator (Polyline2D pl, AffineTransform at) {
   7:         int count = pl.getVertexCount() * 2;
   8:         ...
   9:             } else {
  10:                 at.transform(f._coords, 0, _coords, 0, count/2);
  11:             }
  12:         ...
  13:             } else {
  14:                 at.transform(d._coords, 0, _coords, 0, count/2);

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PathIterator getPathIterator(final AffineTransform at) {
   7:         return new PathIterator() {
   8:         ...
   9:                     if (at != null) {
  10:                         at.transform(coords, 0, coords, 0, 1);
  11:                     }
  12:         ...
  13:                     if (at != null) {
  14:                         at.transform(coords, 0, coords, 0, 1);

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:     
   6:     public void transform(AffineTransform at) {
   7:         ...
   8:         at.transform(clip,0,tmp,0,4);
   9:         double[] s = tmp;

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.PathIterator;
   4:         ...
   5: 
   6:     public PolygonIterator (Polygon2D pl, AffineTransform at) {
   7:         int count = pl.getVertexCount() * 2;
   8:         ...
   9:             } else {
  10:                 at.transform(f._coords, 0, _coords, 0, count/2);
  11:             }
  12:         ...
  13:             } else {
  14:                 at.transform(d._coords, 0, _coords, 0, count/2);

View Full Code Here

translate

public void translate(double tx,
                      double ty)
Concatenates this transform with a translation transformation. This is equivalent to calling concatenate(T), where T is an AffineTransform represented by the following matrix:
		[   1    0    tx  ]
		[   0    1    ty  ]
		[   0    0    1   ]
 
Parameters:
tx - the distance by which coordinates are translated in the X axis direction
ty - the distance by which coordinates are translated in the Y axis direction
Usages and Demos :

View More Examples of translate(double tx,double ty)
   1:   public void paintIcon(Component _c, Graphics _g, int _x, int _y) {
   2:     AffineTransform at= new AffineTransform();
   3:     at.setToTranslation(_x, _y);
   4:         ...
   5:     at.translate(taille_ / 2, taille_ / 2);
   6:     at.rotate(s_.rotationZ * Math.PI / 180.);
   7:         ...
   8:     at.scale(taille_, taille_);
   9:     at.translate(-.5, -.5);
  10:     Shape sh= at.createTransformedShape(s_.trace);

View Full Code Here
   1: import java.awt.font.TextLayout;
   2: import java.awt.geom.AffineTransform;
   3: import java2d.AnimatingSurface;
   4:         ...
   5:         int mindim = Math.min(w, h);
   6:         AffineTransform at = new AffineTransform();
   7:         at.translate((w - mindim) / 2.0,
   8:         ...
   9:         at.scale(mindim, mindim);
  10:         at.translate(0.5, 0.5);
  11:         at.scale(0.3, 0.3);
  12:         ...
  13:             at.scale(-1.0, 1.0);
  14:             at.translate(-Twidth, 0);

View Full Code Here
   1: import java.awt.Shape;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.geom.GeneralPath;
   4:         ...
   5: 
   6:         AffineTransform at = new AffineTransform();
   7:         at.rotate(Math.PI / 4.0);
   8:         ...
   9:         at = new AffineTransform();
  10:         at.translate(-.5, -.5);
  11:         star.transform(at);
  12:         ...
  13: 
  14:         at.translate(0, -.25);

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.image.BufferedImage;
   4:         ...
   5:             Graphics2D g = buf.createGraphics();
   6:             AffineTransform txf = new AffineTransform();
   7:             g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
   8:         ...
   9:                 txf.setToIdentity();
  10:                 txf.translate(-100, -100);
  11:                 txf.rotate(j*Math.PI/100);
  12:         ...
  13:                 txf.translate(100, 100);

View Full Code Here
   1: 
   2: import java.awt.geom.AffineTransform;
   3: import java.awt.image.RenderedImage;
   4:         ...
   5: 
   6:         final AffineTransform gridToWorld = new AffineTransform(
   7:                 (AffineTransform) coverage.gridGeometry.getGridToCRS());
   8:         ...
   9:         gridToWorld.translate(-0.5, -0.5);
  10:         final MathTransform worldToGrid = ProjectiveTransform.create(gridToWorld).inverse();

View Full Code Here