Constructor and Description |
---|
RectangleArea()
Constructs a new
RectangleAreaAdapter whose top-left corner is
(0, 0) and whose width and height are both zero. |
RectangleArea(int x,
int y,
int width,
int height)
Constructs a new
RectangleAreaAdapter whose top-left corner is
specified as (x, y) and whose width and height are specified by the
arguments of the same name. |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(double x,
double y)
Required by the
Shape I/F. |
boolean |
contains(double x,
double y,
double w,
double h)
Required by the
Shape I/F. |
boolean |
contains(java.awt.geom.Point2D p)
Required by the
Shape I/F. |
boolean |
contains(java.awt.geom.Rectangle2D r)
Required by the
Shape I/F. |
java.awt.Rectangle |
getBounds()
Required by the
Shape I/F. |
java.awt.geom.Rectangle2D |
getBounds2D()
Required by the
Shape I/F. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at)
Required by the
Shape I/F. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at,
double flatness)
Required by the
Shape I/F. |
PlanePoint[] |
getPoints()
Implemented as specified by the
PlaneArea I/F. |
boolean |
intersects(double x,
double y,
double w,
double h)
Required by the
Shape I/F. |
boolean |
intersects(java.awt.geom.Rectangle2D r)
Required by the
Shape I/F. |
boolean |
onBoundaries(double x,
double y)
Implemented as specified by the
PlaneArea I/F. |
void |
scale(double factor)
Implemented as specified by the
PlaneArea I/F. |
void |
setBounds(int x,
int y,
int width,
int height)
Implemented as specified by the
PlaneArea I/F. |
breakSharing, copy, getBody
public RectangleArea()
RectangleAreaAdapter
whose top-left corner is
(0, 0) and whose width and height are both zero.public RectangleArea(int x, int y, int width, int height)
RectangleAreaAdapter
whose top-left corner is
specified as (x, y) and whose width and height are specified by the
arguments of the same name.x
- The x-coordinate of the top-left corner.y
- The y-coordinate of the top-left corner.width
- The width of the rectangle.height
- The height of the rectangle.public void setBounds(int x, int y, int width, int height)
PlaneArea
I/F.setBounds
in interface PlaneArea
x
- The x-coordinate of the top-left corner.y
- The y-coordinate of the top-left corner.width
- The width of the area.height
- The height of the area.PlaneArea.setBounds(int, int, int, int)
public void scale(double factor)
PlaneArea
I/F.scale
in interface PlaneArea
factor
- The scaling factor.PlaneArea.scale(double)
public PlanePoint[] getPoints()
PlaneArea
I/F.getPoints
in interface PlaneArea
PlaneArea.getPoints()
public boolean onBoundaries(double x, double y)
PlaneArea
I/F.onBoundaries
in interface PlaneArea
x
- The x-coordinate of the point.y
- The y-coordinate of the point.true
if the point is on the boundary,
false
otherwise.PlaneArea.onBoundaries(double, double)
public boolean contains(double x, double y)
Shape
I/F.contains
in interface java.awt.Shape
Shape.contains(double, double)
public boolean contains(double x, double y, double w, double h)
Shape
I/F.contains
in interface java.awt.Shape
Shape.contains(double, double, double, double)
public boolean intersects(double x, double y, double w, double h)
Shape
I/F.intersects
in interface java.awt.Shape
Shape.intersects(double, double, double, double)
public java.awt.Rectangle getBounds()
Shape
I/F.getBounds
in interface java.awt.Shape
Shape.getBounds()
public boolean contains(java.awt.geom.Point2D p)
Shape
I/F.contains
in interface java.awt.Shape
Shape.contains(Point2D)
public java.awt.geom.Rectangle2D getBounds2D()
Shape
I/F.getBounds2D
in interface java.awt.Shape
Shape.getBounds2D()
public boolean contains(java.awt.geom.Rectangle2D r)
Shape
I/F.contains
in interface java.awt.Shape
Shape.contains(Rectangle2D)
public boolean intersects(java.awt.geom.Rectangle2D r)
Shape
I/F.intersects
in interface java.awt.Shape
Shape.intersects(Rectangle2D)
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
Shape
I/F.getPathIterator
in interface java.awt.Shape
Shape.getPathIterator(AffineTransform)
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
Shape
I/F.getPathIterator
in interface java.awt.Shape
Shape.getPathIterator(AffineTransform, double)