org.geotools.renderer.j2d
Class TransformedShape

java.lang.Object
  extended byjava.awt.geom.AffineTransform
      extended byorg.geotools.renderer.j2d.TransformedShape
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, java.awt.Shape

public final class TransformedShape
extends java.awt.geom.AffineTransform
implements java.awt.Shape

Apply an arbitrary AffineTransform on a Shape. This class is used internally by RenderedMarks. It is designed for reuse with many different affine transforms and shapes. This class is not thread-safe.

Version:
$Id: TransformedShape.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Field Summary
 java.awt.Shape shape
          The wrapped shape.
 
Fields inherited from class java.awt.geom.AffineTransform
TYPE_FLIP, TYPE_GENERAL_ROTATION, TYPE_GENERAL_SCALE, TYPE_GENERAL_TRANSFORM, TYPE_IDENTITY, TYPE_MASK_ROTATION, TYPE_MASK_SCALE, TYPE_QUADRANT_ROTATION, TYPE_TRANSLATION, TYPE_UNIFORM_SCALE
 
Constructor Summary
TransformedShape()
          Construct a transformed shape initialized to the identity transform.
 
Method Summary
 boolean contains(double x, double y)
          Tests if the specified coordinates are inside the boundary of the Shape.
 boolean contains(double x, double y, double width, double height)
          Tests if the interior of the Shape entirely contains the specified rectangular area.
 boolean contains(java.awt.geom.Point2D p)
          Tests if a specified Point2D is inside the boundary of the Shape.
 boolean contains(java.awt.geom.Rectangle2D r)
          Tests if the interior of the Shape entirely contains the specified Rectangle2D.
 java.awt.Rectangle getBounds()
          Returns an integer Rectangle that completely encloses the Shape.
 java.awt.geom.Rectangle2D getBounds2D()
          Returns a high precision and more accurate bounding box of the Shape than the getBounds method.
 void getMatrix(float[] matrix, int offset)
          Returns the 6 coefficients values.
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
          Returns an iterator object that iterates along the Shape boundary and provides access to the geometry of the Shape outline.
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
          Returns an iterator object that iterates along the Shape boundary and provides access to a flattened view of the Shape outline geometry.
 boolean intersects(double x, double y, double width, double height)
          Tests if the interior of the Shape intersects the interior of a specified rectangular area.
 boolean intersects(java.awt.geom.Rectangle2D r)
          Tests if the interior of the Shape intersects the interior of a specified Rectangle2D.
 void scale(double s)
          Apply a uniform scale.
 void setTransform(double[] matrix)
          Set the transform from a flat matrix.
 void setTransform(float[] matrix, int offset)
          Set the transform from a flat matrix.
 
Methods inherited from class java.awt.geom.AffineTransform
clone, concatenate, createInverse, createTransformedShape, deltaTransform, deltaTransform, equals, getDeterminant, getMatrix, getRotateInstance, getRotateInstance, getScaleInstance, getScaleX, getScaleY, getShearInstance, getShearX, getShearY, getTranslateInstance, getTranslateX, getTranslateY, getType, hashCode, inverseTransform, inverseTransform, isIdentity, preConcatenate, rotate, rotate, scale, setToIdentity, setToRotation, setToRotation, setToScale, setToShear, setToTranslation, setTransform, setTransform, shear, toString, transform, transform, transform, transform, transform, transform, translate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

shape

public java.awt.Shape shape
The wrapped shape.

Constructor Detail

TransformedShape

public TransformedShape()
Construct a transformed shape initialized to the identity transform.

Method Detail

getMatrix

public void getMatrix(float[] matrix,
                      int offset)
Returns the 6 coefficients values.


setTransform

public void setTransform(float[] matrix,
                         int offset)
Set the transform from a flat matrix.

Parameters:
matrix - The flat matrix.
offset - The index of the first element to use in matrix.

setTransform

public void setTransform(double[] matrix)
Set the transform from a flat matrix.

Parameters:
matrix - The flat matrix.

scale

public void scale(double s)
Apply a uniform scale.


contains

public boolean contains(double x,
                        double y)
Tests if the specified coordinates are inside the boundary of the Shape.

Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(java.awt.geom.Point2D p)
Tests if a specified Point2D is inside the boundary of the Shape.

Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(double x,
                        double y,
                        double width,
                        double height)
Tests if the interior of the Shape entirely contains the specified rectangular area.

Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(java.awt.geom.Rectangle2D r)
Tests if the interior of the Shape entirely contains the specified Rectangle2D. This method might conservatively return false.

Specified by:
contains in interface java.awt.Shape

intersects

public boolean intersects(double x,
                          double y,
                          double width,
                          double height)
Tests if the interior of the Shape intersects the interior of a specified rectangular area.

Specified by:
intersects in interface java.awt.Shape

intersects

public boolean intersects(java.awt.geom.Rectangle2D r)
Tests if the interior of the Shape intersects the interior of a specified Rectangle2D. This method might conservatively return true.

Specified by:
intersects in interface java.awt.Shape

getBounds

public java.awt.Rectangle getBounds()
Returns an integer Rectangle that completely encloses the Shape.

Specified by:
getBounds in interface java.awt.Shape

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()
Returns a high precision and more accurate bounding box of the Shape than the getBounds method.

Specified by:
getBounds2D in interface java.awt.Shape

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
Returns an iterator object that iterates along the Shape boundary and provides access to the geometry of the Shape outline.

Specified by:
getPathIterator in interface java.awt.Shape

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at,
                                                  double flatness)
Returns an iterator object that iterates along the Shape boundary and provides access to a flattened view of the Shape outline geometry.

Specified by:
getPathIterator in interface java.awt.Shape


Copyright © GeoTools. All Rights Reserved.