Example usage for java.awt.geom AffineTransform AffineTransform

List of usage examples for java.awt.geom AffineTransform AffineTransform

Introduction

In this page you can find the example usage for java.awt.geom AffineTransform AffineTransform.

Prototype

public AffineTransform(double[] flatmatrix) 

Source Link

Document

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.

Usage

From source file:DefaultGraphics2D.java

/**
 * Sets the <code>Transform</code> in the <code>Graphics2D</code> context.
 * /*from w w  w.ja  v a2  s .  c  o  m*/
 * @param Tx
 *          the <code>AffineTransform</code> object to be used in the
 *          rendering process
 * @see #transform
 * @see AffineTransform
 */
public void setTransform(AffineTransform Tx) {
    transform = new AffineTransform(Tx);
    invalidateTransformStack();
    if (!Tx.isIdentity())
        transformStack.add(TransformStackElement.createGeneralTransformElement(Tx));
}

From source file:DefaultGraphics2D.java

/**
 * Returns a copy of the current <code>Transform</code> in the
 * <code>Graphics2D</code> context.
 * /*from   ww  w . ja  v a 2s .co  m*/
 * @return the current <code>AffineTransform</code> in the
 *         <code>Graphics2D</code> context.
 * @see #transform
 * @see #setTransform
 */
public AffineTransform getTransform() {
    return new AffineTransform(transform);
}

From source file:DefaultGraphics2D.java

/**
 * Multiplies two 2x3 matrices of double precision values
 *//*from  w ww . j  av  a  2 s. c  o m*/
private double[] matrixMultiply(double[] matrix1, double[] matrix2) {
    double[] product = new double[6];
    AffineTransform transform1 = new AffineTransform(matrix1);
    transform1.concatenate(new AffineTransform(matrix2));
    transform1.getMatrix(product);
    return product;
}