All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.geom.Rectangle2D
java.lang.Object
|
+----java.awt.geom.RectangularShape
|
+----java.awt.geom.Rectangle2D
- public abstract class Rectangle2D
- extends RectangularShape
A rectangle defined by a location (x, y) and dimension (w x h).
This class is only the abstract superclass for all objects which
store a 2D rectangle.
The actual storage representation of the coordinates is left to
the subclass.
Rectangle2D.Double- A rectangle specified in double coordinates.
Rectangle2D.Float- A rectangle specified in float coordinates.
OUT_BOTTOM- The bitmask which indicates that a point lies below
this Rectangle.
OUT_LEFT- The bitmask which indicates that a point lies to the left of
this Rectangle.
OUT_RIGHT- The bitmask which indicates that a point lies to the right of
this Rectangle.
OUT_TOP- The bitmask which indicates that a point lies above
this Rectangle.
Rectangle2D()
-
contains(double, double)
- Test if a given coordinate is inside the boundary of the shape.
contains(double, double, double, double)
- Test if the interior of the Shape entirely contains the given
set of rectangular coordinates.
getBounds2D()
- Return the high precision bounding box of the shape.
getPathIterator(AffineTransform)
- Return an iteration object that defines the boundary of the
shape.
getPathIterator(AffineTransform, double)
- Return an iteration object that defines the boundary of the
flattened shape.
intersects(double, double, double, double)
- Test if the interior of the Shape intersects the interior of a given
set of rectangular coordinates.
intersectsLine(double, double, double, double)
- Tests if the given line segment intersects the interior of this
Rectangle.
intersectsLine(Line2D)
- Tests if the given line segment intersects the interior of this
Rectangle.
outcode(double, double)
- Determines where the specified coordinates lie with respect
to this Rectangle.
outcode(Point2D)
- Determines where the specified point lies with respect to this
Rectangle.
setBounds(double, double, double, double)
- Sets the location and size of the outer bounds of this shape
to the specified rectangular values.
setRect(double, double, double, double)
- Sets the location and size of this rectangle to the specified
double values.
setRect(Rectangle2D)
- Sets this rectangle to be the same as the specified Rectangle.
OUT_LEFT
public static final int OUT_LEFT
- The bitmask which indicates that a point lies to the left of
this Rectangle.
OUT_TOP
public static final int OUT_TOP
- The bitmask which indicates that a point lies above
this Rectangle.
OUT_RIGHT
public static final int OUT_RIGHT
- The bitmask which indicates that a point lies to the right of
this Rectangle.
OUT_BOTTOM
public static final int OUT_BOTTOM
- The bitmask which indicates that a point lies below
this Rectangle.
Rectangle2D
protected Rectangle2D()
setRect
public abstract void setRect(double x,
double y,
double w,
double h)
- Sets the location and size of this rectangle to the specified
double values.
setRect
public void setRect(Rectangle2D r)
- Sets this rectangle to be the same as the specified Rectangle.
intersectsLine
public boolean intersectsLine(double x1,
double y1,
double x2,
double y2)
- Tests if the given line segment intersects the interior of this
Rectangle.
intersectsLine
public boolean intersectsLine(Line2D l)
- Tests if the given line segment intersects the interior of this
Rectangle.
outcode
public abstract int outcode(double x,
double y)
- Determines where the specified coordinates lie with respect
to this Rectangle.
This method computes a binary OR of the appropriate mask values
indicating which sides of the rectangle the given point is
outside of.
- Returns:
- the logical OR of all appropriate out codes
- See Also:
- OUT_LEFT, OUT_TOP, OUT_RIGHT, OUT_BOTTOM
outcode
public int outcode(Point2D p)
- Determines where the specified point lies with respect to this
Rectangle.
This method computes a binary OR of the appropriate mask values
indicating which sides of the rectangle the given point is
outside of.
- Returns:
- the logical OR of all appropriate out codes
- See Also:
- OUT_LEFT, OUT_TOP, OUT_RIGHT, OUT_BOTTOM
setBounds
public 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.
- Overrides:
- setBounds in class RectangularShape
getBounds2D
public Rectangle2D getBounds2D()
- Return the high precision bounding box of the shape.
contains
public boolean contains(double x,
double y)
- Test if a given coordinate is inside the boundary of the shape.
intersects
public boolean intersects(double x,
double y,
double w,
double h)
- Test if the interior of the Shape intersects the interior of a given
set of rectangular coordinates.
contains
public boolean contains(double x,
double y,
double w,
double h)
- Test if the interior of the Shape entirely contains the given
set of rectangular coordinates.
getPathIterator
public PathIterator getPathIterator(AffineTransform at)
- Return an iteration object that defines the boundary of the
shape.
getPathIterator
public PathIterator getPathIterator(AffineTransform at,
double flatness)
- Return an iteration object that defines the boundary of the
flattened shape.
- Overrides:
- getPathIterator in class RectangularShape
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature