All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.geom.RectangularShape
java.lang.Object
|
+----java.awt.geom.RectangularShape
- public abstract class RectangularShape
- extends Object
- implements Shape
The base class for a number of shapes which inscribe a rectangular
set of outer bounds. This class provides common manipulation
routines for operating on a shape by querying and modifying its
bounding rectangle.
RectangularShape()
-
contains(Point2D)
- Test if a given Point is inside the boundary of the shape.
contains(Rectangle2D)
- Test if the interior of the Shape entirely contains the given
Rectangle.
getBottom()
- Returns the Y coordinate of the bottom edge of the shape in
double precision.
getBounds()
- Return the bounding box of the shape.
getCenterX()
- Returns the X coordinate of the center of the shape in
double precision.
getCenterY()
- Returns the Y coordinate of the center of the shape in
double precision.
getHeight()
- Returns the height of the bounding rectangle in double precision.
getLeft()
- Returns the X coordinate of the left edge of the shape in
double precision.
getPathIterator(AffineTransform, double)
- Return an iterator object that iterates along the boundary of
the shape and provides access to a flattened view of the
geometry of the outline of the shape.
getRight()
- Returns the X coordinate of the right edge of the shape in
double precision.
getTop()
- Returns the Y coordinate of the top edge of the shape in
double precision.
getWidth()
- Returns the width of the bounding rectangle in double precision.
getX()
- Returns the X coordinate of the bounding rectangle in double precision.
getY()
- Returns the Y coordinate of the bounding rectangle in double precision.
intersects(Rectangle2D)
- Test if the interior of the Shape intersects the interior of a given
Rectangle.
isEmpty()
- Determines whether the rectangular shape is empty.
setBounds(double, double, double, double)
- Sets the location and size of the outer bounds of this shape
to the specified rectangular values.
setBounds(Point2D, Dimension2D)
- Sets the outer bounds of this shape to be the same as the specified
Point and Dimension objects.
setBounds(Rectangle2D)
- Sets the outer bounds of this shape to be the same as the specified
Rectangle.
setBoundsFromCenter(double, double, double, double)
- Sets the outer bounds of this shape based on a center point
and a corner point.
setBoundsFromCenter(Point2D, Point2D)
- Sets the outer bounds of this shape based on a center point
and a corner point.
setBoundsFromDiagonal(double, double, double, double)
- Sets the outer bounds of this shape based on two points along
one of its diagonals.
setBoundsFromDiagonal(Point2D, Point2D)
- Sets the outer bounds of this shape based on two Point objects
along one of its diagonals.
RectangularShape
protected RectangularShape()
getX
public abstract double getX()
- Returns the X coordinate of the bounding rectangle in double precision.
getY
public abstract double getY()
- Returns the Y coordinate of the bounding rectangle in double precision.
getWidth
public abstract double getWidth()
- Returns the width of the bounding rectangle in double precision.
getHeight
public abstract double getHeight()
- Returns the height of the bounding rectangle in double precision.
getLeft
public double getLeft()
- Returns the X coordinate of the left edge of the shape in
double precision.
getTop
public double getTop()
- Returns the Y coordinate of the top edge of the shape in
double precision.
getRight
public double getRight()
- Returns the X coordinate of the right edge of the shape in
double precision.
getBottom
public double getBottom()
- Returns the Y coordinate of the bottom edge of the shape in
double precision.
getCenterX
public double getCenterX()
- Returns the X coordinate of the center of the shape in
double precision.
getCenterY
public double getCenterY()
- Returns the Y coordinate of the center of the shape in
double precision.
isEmpty
public abstract boolean isEmpty()
- Determines whether the rectangular shape is empty.
setBounds
public abstract void setBounds(double x,
double y,
double w,
double h)
- Sets the location and size of the outer bounds of this shape
to the specified rectangular values.
setBounds
public void setBounds(Point2D loc,
Dimension2D size)
- Sets the outer bounds of this shape to be the same as the specified
Point and Dimension objects.
setBounds
public void setBounds(Rectangle2D r)
- Sets the outer bounds of this shape to be the same as the specified
Rectangle.
setBoundsFromDiagonal
public void setBoundsFromDiagonal(double x1,
double y1,
double x2,
double y2)
- Sets the outer bounds of this shape based on two points along
one of its diagonals.
setBoundsFromDiagonal
public void setBoundsFromDiagonal(Point2D p1,
Point2D p2)
- Sets the outer bounds of this shape based on two Point objects
along one of its diagonals.
setBoundsFromCenter
public void setBoundsFromCenter(double centerX,
double centerY,
double cornerX,
double cornerY)
- Sets the outer bounds of this shape based on a center point
and a corner point.
setBoundsFromCenter
public void setBoundsFromCenter(Point2D center,
Point2D corner)
- Sets the outer bounds of this shape based on a center point
and a corner point.
contains
public boolean contains(Point2D p)
- Test if a given Point is inside the boundary of the shape.
intersects
public boolean intersects(Rectangle2D r)
- Test if the interior of the Shape intersects the interior of a given
Rectangle.
contains
public boolean contains(Rectangle2D r)
- Test if the interior of the Shape entirely contains the given
Rectangle.
getBounds
public Rectangle getBounds()
- Return the bounding box of the shape.
getPathIterator
public PathIterator getPathIterator(AffineTransform at,
double flatness)
- Return an iterator object that iterates along the boundary of
the shape and provides access to a flattened view of the
geometry of the outline of the shape.
Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types will
be returned by the iterator.
The amount of subdivision of the curved segments is controlled
by the
flatness
parameter which specifies ?REMIND?.
An optional affine transform can be specified in which case
the coordinates returned in the iteration will be transformed
accordingly.
- Parameters:
- at - an optional AffineTransform to be applied to the
coordinates as they are returned in the iteration, or null
if the untransformed coordinates are desired.
- flatness - the maximum amount that the control points
for a given curve can vary from colinear before a subdivided
curve is replaced by a straight line connecting the endpoints.
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature