Class ShapeWrapper
java.lang.Object
org.apache.sis.internal.referencing.j2d.AbstractShape
org.apache.sis.internal.feature.j2d.ShapeWrapper
- All Implemented Interfaces:
Shape,Serializable
- Direct Known Subclasses:
DecimatedShape
A wrapper that delegate all
Shape methods to a source shape.
Subclasses should override at least one method for making this class useful.- Since:
- 1.2
- Version:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longFor cross-version compatibility.protected final ShapeThe source of coordinate values. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedShapeWrapper(Shape source) Creates a new wrapper for the given shape. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(double x, double y) Tests if the specified coordinates are inside the boundary of this shape.booleancontains(double x, double y, double w, double h) Tests if the interior of thisShapeentirely contains the interior of a specified rectangular area.booleanTests if the point is inside the boundary of this shape.booleanTests if the interior of thisShapeentirely contains the interior of a specified rectangular area.Returns a rectangle that completely encloses thisShape.Returns a rectangle that completely encloses thisShape.Returns an iterator over the coordinates of this shape.getPathIterator(AffineTransform at, double flatness) Returns an iterator over the coordinates of this shape, approximated by line segments.booleanintersects(double x, double y, double w, double h) Tests if the interior of thisShapeintersects the interior of a specified rectangular area.booleanTests if the interior of thisShapeintersects the interior of a specified rectangular area.protected booleanisFloat()Returnstrueif this shape backed by primitivefloatvalues.Methods inherited from class org.apache.sis.internal.referencing.j2d.AbstractShape
isFloat
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
source
The source of coordinate values.
-
-
Constructor Details
-
ShapeWrapper
Creates a new wrapper for the given shape.- Parameters:
source- the source of coordinate values.
-
-
Method Details
-
isFloat
protected boolean isFloat()Returnstrueif this shape backed by primitivefloatvalues.- Overrides:
isFloatin classAbstractShape- Returns:
trueif this shape is backed byfloatcoordinate values.
-
getBounds
Returns a rectangle that completely encloses thisShape. This is not necessarily the smallest bounding box if an accurate computation would be too expansive. -
getBounds2D
Returns a rectangle that completely encloses thisShape. This is not necessarily the smallest bounding box if an accurate computation would be too expansive.- Specified by:
getBounds2Din interfaceShape- Returns:
- a rectangle that completely encloses this
Shape.
-
contains
public boolean contains(double x, double y) Tests if the specified coordinates are inside the boundary of this shape. -
contains
Tests if the point is inside the boundary of this shape. -
intersects
public boolean intersects(double x, double y, double w, double h) Tests if the interior of thisShapeintersects the interior of a specified rectangular area. This method may conservatively returntrueif an accurate computation would be too expansive.- Specified by:
intersectsin interfaceShape- Parameters:
x- minimal x coordinate of the rectangle.y- minimal y coordinate of the rectangle.w- width of the rectangle.h- height of the rectangle.- Returns:
- whether the specified rectangle intersects the interior of this shape.
-
intersects
Tests if the interior of thisShapeintersects the interior of a specified rectangular area. This method may conservatively returntrueif an accurate computation would be too expansive.- Specified by:
intersectsin interfaceShape- Parameters:
r- the rectangular area to test.- Returns:
- whether the specified rectangle intersects the interior of this shape.
-
contains
public boolean contains(double x, double y, double w, double h) Tests if the interior of thisShapeentirely contains the interior of a specified rectangular area. This method may conservatively returnfalseif an accurate computation would be too expansive. -
contains
Tests if the interior of thisShapeentirely contains the interior of a specified rectangular area. This method may conservatively returnfalseif an accurate computation would be too expansive. -
getPathIterator
Returns an iterator over the coordinates of this shape.- Specified by:
getPathIteratorin interfaceShape- Parameters:
at- an optional transform to be applied on coordinate values, ornullif none.- Returns:
- iterator over the coordinate values of this shape.
-
getPathIterator
Returns an iterator over the coordinates of this shape, approximated by line segments.- Specified by:
getPathIteratorin interfaceShape- Parameters:
at- an optional transform to be applied on coordinate values, ornullif none.flatness- maximum distance between line segments approximations and the curve segments.- Returns:
- iterator over the coordinate values of line segments approximating this shape.
-