java.lang.Object | +--java.awt.geom.RectangularShape | +--java.awt.geom.Rectangle2D | +--java.awt.Rectangle
A
Rectangle specifies an area in a coordinate space that is
enclosed by the Rectangle object's top-left point
(x, y)
in the coordinate space, its width, and its height.
A Rectangle object's width and
height are public fields. The constructors
that create a Rectangle, and the methods that can modify
one, do not prevent setting a negative value for width or height.
A Rectangle whose width or height is negative is considered
empty. If the Rectangle is empty, then the
isEmpty method returns true. No point can be
contained by or inside an empty Rectangle. The
values of width and height, however, are still
valid. An empty Rectangle still has a location in the
coordinate space, and methods that change its size or location remain
valid. The behavior of methods that operate on more than one
Rectangle is undefined if any of the participating
Rectangle objects has a negative
width or height. These methods include
intersects, intersection, and
union.
| Inner classes inherited from class java.awt.geom.Rectangle2D |
Rectangle2D.Double, Rectangle2D.Float |
| Field Summary | |
int |
height
copy-> height
|
int |
width
copy-> width
|
int |
x
copy-> x
|
int |
y
copy-> y
|
| Fields inherited from class java.awt.geom.Rectangle2D |
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
| Constructor Summary | |
Rectangle
copy-> new Rectangle()copy-> <Rectangle var> = new Rectangle();
|
|
Rectangle
copy-> new Rectangle( )copy-> <Rectangle var> = new Rectangle(<Dimension d>);
|
|
Rectangle
copy-> new Rectangle(, )copy-> <Rectangle var> = new Rectangle(<int width>, <int height>);
|
|
Rectangle
copy-> new Rectangle(, , , )copy-> <Rectangle var> = new Rectangle(<int x>, <int y>, <int width>, <int height>);
|
|
Rectangle
copy-> new Rectangle( )copy-> <Rectangle var> = new Rectangle(<Point p>);
|
|
Rectangle
copy-> new Rectangle(, )copy-> <Rectangle var> = new Rectangle(<Point p>, <Dimension d>); |
|
Rectangle
copy-> new Rectangle( )copy-> <Rectangle var> = new Rectangle(<Rectangle r>);
|
|
| Method Summary | |
void |
add(int newx,
int newy)
copy-> .add(, )copy-> <Rectangle>.add(<int newx>, <int newy>);
|
void |
add(Point pt)
copy-> .add( )copy-> <Rectangle>.add(<Point pt>);
|
void |
add(Rectangle r)
copy-> .add( )copy-> <Rectangle>.add(<Rectangle r>);
|
boolean |
contains(int x,
int y)
copy-> .contains(, )copy-> <boolean var>=<Rectangle>.contains(<int x>, <int y>);
|
boolean |
contains(int X,
int Y,
int W,
int H)
copy-> .contains(, , , )copy-> <boolean var>=<Rectangle>.contains(<int X>, <int Y>, <int W>, <int H>);
|
boolean |
contains(Point p)
copy-> .contains( )copy-> <boolean var>=<Rectangle>.contains(<Point p>);
|
boolean |
contains(Rectangle r)
copy-> .contains( )copy-> <boolean var>=<Rectangle>.contains(<Rectangle r>);
|
Rectangle2D |
createIntersection(Rectangle2D r)
copy-> .createIntersection( )copy-> <Rectangle2D var>=<Rectangle>.createIntersection(<Rectangle2D r>);
|
Rectangle2D |
createUnion(Rectangle2D r)
copy-> .createUnion( )copy-> <Rectangle2D var>=<Rectangle>.createUnion(<Rectangle2D r>);
|
boolean |
equals(Object obj)
copy-> .equals( )copy-> <boolean var>=<Rectangle>.equals(<Object obj>);
|
Rectangle |
getBounds()
copy-> .getBounds()copy-> <Rectangle var>=<Rectangle>.getBounds();
|
Rectangle2D |
getBounds2D()
copy-> .getBounds2D()copy-> <Rectangle2D var>=<Rectangle>.getBounds2D();
|
double |
getHeight()
copy-> .getHeight()copy-> <double var>=<Rectangle>.getHeight();
|
Point |
getLocation()
copy-> .getLocation()copy-> <Point var>=<Rectangle>.getLocation();
|
Dimension |
getSize()
copy-> .getSize()copy-> <Dimension var>=<Rectangle>.getSize();
|
double |
getWidth()
copy-> .getWidth()copy-> <double var>=<Rectangle>.getWidth();
|
double |
getX()
copy-> .getX()copy-> <double var>=<Rectangle>.getX();
|
double |
getY()
copy-> .getY()copy-> <double var>=<Rectangle>.getY();
|
void |
grow(int h,
int v)
copy-> .grow(, )copy-> <Rectangle>.grow(<int h>, <int v>);
|
boolean |
inside(int x,
int y)
copy-> .inside(, )copy-> <boolean var>=<Rectangle>.inside(<int x>, <int y>);
|
Rectangle |
intersection(Rectangle r)
copy-> .intersection( )copy-> <Rectangle var>=<Rectangle>.intersection(<Rectangle r>);
|
boolean |
intersects(Rectangle r)
copy-> .intersects( )copy-> <boolean var>=<Rectangle>.intersects(<Rectangle r>);
|
boolean |
isEmpty()
copy-> .isEmpty()copy-> <boolean var>=<Rectangle>.isEmpty();
|
void |
move(int x,
int y)
copy-> .move(, )copy-> <Rectangle>.move(<int x>, <int y>);
|
int |
outcode(double x,
double y)
copy-> .outcode(, )copy-> <int var>=<Rectangle>.outcode(<double x>, <double y>);
|
void |
reshape(int x,
int y,
int width,
int height)
copy-> .reshape(, , , )copy-> <Rectangle>.reshape(<int x>, <int y>, <int width>, <int height>);
|
void |
resize(int width,
int height)
copy-> .resize(, )copy-> <Rectangle>.resize(<int width>, <int height>);
|
void |
setBounds(int x,
int y,
int width,
int height)
copy-> .setBounds(, , , )copy-> <Rectangle>.setBounds(<int x>, <int y>, <int width>, <int height>);
|
void |
setBounds(Rectangle r)
copy-> .setBounds( )copy-> <Rectangle>.setBounds(<Rectangle r>);
|
void |
setLocation(int x,
int y)
copy-> .setLocation(, )copy-> <Rectangle>.setLocation(<int x>, <int y>);
|
void |
setLocation(Point p)
copy-> .setLocation( )copy-> <Rectangle>.setLocation(<Point p>);
|
void |
setRect(double x,
double y,
double width,
double height)
copy-> .setRect(, , , )copy-> <Rectangle>.setRect(<double x>, <double y>, <double width>, <double height>);
|
void |
setSize(Dimension d)
copy-> .setSize( )copy-> <Rectangle>.setSize(<Dimension d>);
|
void |
setSize(int width,
|