public final class TransformedShape extends AffineTransform implements Shape
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.Modifier and Type | Field and Description |
---|---|
Shape |
shape
The wrapped shape.
|
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 and Description |
---|
TransformedShape()
Construct a transformed shape initialized to the identity transform.
|
TransformedShape(Shape shape,
AffineTransform at)
Construct a transformed shape
|
Modifier and Type | Method and Description |
---|---|
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(Point2D p)
Tests if a specified
Point2D is inside the boundary of the Shape . |
boolean |
contains(Rectangle2D r)
Tests if the interior of the
Shape entirely contains the specified
Rectangle2D . |
Rectangle |
getBounds()
Returns an integer
Rectangle that completely encloses the Shape . |
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.
|
PathIterator |
getPathIterator(AffineTransform at)
Returns an iterator object that iterates along the
Shape boundary and provides
access to the geometry of the Shape outline. |
PathIterator |
getPathIterator(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(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.
|
clone, concatenate, createInverse, createTransformedShape, deltaTransform, deltaTransform, equals, getDeterminant, getMatrix, getQuadrantRotateInstance, getQuadrantRotateInstance, getRotateInstance, getRotateInstance, getRotateInstance, getRotateInstance, getScaleInstance, getScaleX, getScaleY, getShearInstance, getShearX, getShearY, getTranslateInstance, getTranslateX, getTranslateY, getType, hashCode, inverseTransform, inverseTransform, invert, isIdentity, preConcatenate, quadrantRotate, quadrantRotate, rotate, rotate, rotate, rotate, scale, setToIdentity, setToQuadrantRotation, setToQuadrantRotation, setToRotation, setToRotation, setToRotation, setToRotation, setToScale, setToShear, setToTranslation, setTransform, setTransform, shear, toString, transform, transform, transform, transform, transform, transform, translate
public Shape shape
public TransformedShape()
public TransformedShape(Shape shape, AffineTransform at)
public void getMatrix(float[] matrix, int offset)
public void setTransform(float[] matrix, int offset)
matrix
- The flat matrix.offset
- The index of the first element to use in matrix
.public void setTransform(double[] matrix)
matrix
- The flat matrix.public void scale(double s)
public boolean contains(double x, double y)
Shape
.public boolean contains(Point2D p)
Point2D
is inside the boundary of the Shape
.public boolean contains(double x, double y, double width, double height)
Shape
entirely contains the specified rectangular
area.public boolean contains(Rectangle2D r)
Shape
entirely contains the specified
Rectangle2D
. This method might conservatively return false
.public boolean intersects(double x, double y, double width, double height)
Shape
intersects the interior of a specified
rectangular area.intersects
in interface Shape
public boolean intersects(Rectangle2D r)
Shape
intersects the interior of a specified
Rectangle2D
. This method might conservatively return true
.intersects
in interface Shape
public Rectangle getBounds()
Rectangle
that completely encloses the Shape
.public Rectangle2D getBounds2D()
Shape
than the
getBounds
method.getBounds2D
in interface Shape
public PathIterator getPathIterator(AffineTransform at)
Shape
boundary and provides
access to the geometry of the Shape
outline.getPathIterator
in interface Shape
public PathIterator getPathIterator(AffineTransform at, double flatness)
Shape
boundary and provides
access to a flattened view of the Shape
outline geometry.getPathIterator
in interface Shape
Copyright © 1996–2019 Geotools. All rights reserved.