| Modifier and Type | Field and Description |
|---|---|
| private int | height
Rectangle's bounds |
| pack-priv static final long | |
| private int | width
Rectangle's bounds |
| private int | x
Rectangle's bounds |
| private int | y
Rectangle's bounds |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(int
the x coordinates of the new point newx, int the y coordinates of the new point newy)Adds a point, specified by the integer arguments |
| public void | add(ReadablePoint
the new pt)Point to add to this
RectangleAdds the specified |
| public void | |
| public boolean | Returns: true if the Point
(x, y) is inside this
Rectangle;
false otherwise.the p)Point to testChecks whether or not this |
| public boolean | Returns: true if the point
(x, y) is inside this
Rectangle;
false otherwise.the specified x coordinate X, int the specified y coordinate Y)Checks whether or not this |
| public boolean | Returns: true if the Rectangle
is contained entirely inside this Rectangle;
false otherwise.the specified r)RectangleChecks whether or not this |
| public boolean | Returns: true if the Rectangle specified by
(X, Y, W, H)
is entirely enclosed inside this Rectangle;
false otherwise.the specified x coordinate X, int the specified y coordinate Y, int the width of the W, int Rectanglethe height of the H)RectangleChecks whether this |
| public boolean | Returns: true if the objects are equal;
false otherwise.the obj)Object to compare with
this RectangleOverrides java. |
| public void | getBounds(WritableRectangle
The destination Rectangle, or null, to create a new Rectangle dest)Implements org. |
| public int | Returns: Returns a intImplements org. |
| public void | getLocation(WritablePoint
The destination Point, or null, to create a new Point dest)Implements org. |
| public void | getSize(WritableDimension
The destination dest)Implements org. |
| public int | Returns: Returns a intImplements org. |
| public int | |
| public int | |
| public void | grow(int
the horizontal expansion h, int the vertical expansion v)Resizes the |
| public Rectangle | Returns: the largestRectangle contained in both the
specified Rectangle and in
this Rectangle; or if the rectangles
do not intersect, an empty rectangle.the specified r, Rectangle dest)RectangleComputes the intersection of this |
| public boolean | Returns: true if the specified Rectangle
and this Rectangle intersect;
false otherwise.the specified r)RectangleDetermines whether or not this |
| public boolean | Returns: true if this Rectangle is empty;
false otherwise.Determines whether or not this |
| public void | setBounds(int
Position of rectangle on x axis x, int Position of rectangle on y axis y, int Width of rectangle w, int Height of rectangle h)Implements org. |
| public void | setBounds(ReadablePoint p, ReadableDimension d)
Implements org. |
| public void | setBounds(ReadableRectangle r)
Implements org. |
| public void | setHeight(int
The height to set height)Implements org. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setWidth(int
The width to set width)Implements org. |
| public void | |
| public void | |
| public String | |
| public void | translate(int
The translation amount on the x axis x, int The translation amount on the y axis y)Translate the rectangle by an amount. |
| public void | |
| public WritableRectangle | Returns: the smallestRectangle containing both
the specified Rectangle and this
Rectangle.the specified r, WritableRectangle dest)RectangleComputes the union of this |
| public void |
| height | back to summary |
|---|---|
| private int height Rectangle's bounds | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| width | back to summary |
|---|---|
| private int width Rectangle's bounds | |
| x | back to summary |
|---|---|
| private int x Rectangle's bounds | |
| y | back to summary |
|---|---|
| private int y Rectangle's bounds | |
| Rectangle | back to summary |
|---|---|
| public Rectangle() Constructor for Rectangle. | |
| Rectangle | back to summary |
|---|---|
| public Rectangle(int x, int y, int w, int h) Constructor for Rectangle. | |
| Rectangle | back to summary |
|---|---|
| public Rectangle(ReadablePoint p, ReadableDimension d) Constructor for Rectangle. | |
| Rectangle | back to summary |
|---|---|
| public Rectangle(ReadableRectangle r) Constructor for Rectangle. | |
| add | back to summary |
|---|---|
| public void add(int newx, int newy) Adds a point, specified by the integer arguments
After adding a point, a call to
| |
| add | back to summary |
|---|---|
| public void add(ReadablePoint pt) Adds the specified
After adding a
| |
| add | back to summary |
|---|---|
| public void add(ReadableRectangle r) Adds a
| |
| contains | back to summary |
|---|---|
| public boolean contains(ReadablePoint p) Checks whether or not this
| |
| contains | back to summary |
|---|---|
| public boolean contains(int X, int Y) Checks whether or not this
| |
| contains | back to summary |
|---|---|
| public boolean contains(ReadableRectangle r) Checks whether or not this
| |
| contains | back to summary |
|---|---|
| public boolean contains(int X, int Y, int W, int H) Checks whether this
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Checks whether two rectangles are equal.
The result is
| |
| getBounds | back to summary |
|---|---|
| public void getBounds(WritableRectangle dest) Implements org. Doc from org. Copy this readable rectangle's bounds into a destination Rectangle
| |
| getHeight | back to summary |
|---|---|
| public int getHeight() Implements org. Gets the height.
| |
| getLocation | back to summary |
|---|---|
| public void getLocation(WritablePoint dest) Implements org. Doc from org. Copy this ReadablePoint into a destination Point
| |
| getSize | back to summary |
|---|---|
| public void getSize(WritableDimension dest) Implements org. Doc from org. Copy this ReadableDimension into a destination Dimension
| |
| getWidth | back to summary |
|---|---|
| public int getWidth() Implements org. Gets the width.
| |
| getX | back to summary |
|---|---|
| public int getX() Implements org. Gets the x.
| |
| getY | back to summary |
|---|---|
| public int getY() Implements org. Gets the y.
| |
| grow | back to summary |
|---|---|
| public void grow(int h, int v) Resizes the
This method modifies the
The new
If negative values are supplied for
| |
| intersection | back to summary |
|---|---|
| public Rectangle intersection(ReadableRectangle r, Rectangle dest) Computes the intersection of this
| |
| intersects | back to summary |
|---|---|
| public boolean intersects(ReadableRectangle r) Determines whether or not this
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Determines whether or not this
| |
| setBounds | back to summary |
|---|---|
| public void setBounds(int x, int y, int w, int h) Implements org. Doc from org. Sets the bounds of the rectangle
| |
| setBounds | back to summary |
|---|---|
| public void setBounds(ReadablePoint p, ReadableDimension d) Implements org. Doc from org. Sets the bounds of the rectangle | |
| setBounds | back to summary |
|---|---|
| public void setBounds(ReadableRectangle r) Implements org. Doc from org. Sets the bounds of the rectangle | |
| setHeight | back to summary |
|---|---|
| public void setHeight(int height) Implements org. Sets the height.
| |
| setLocation | back to summary |
|---|---|
| public void setLocation(int x, int y) Implements org. | |
| setLocation | back to summary |
|---|---|
| public void setLocation(ReadablePoint p) Implements org. | |
| setSize | back to summary |
|---|---|
| public void setSize(int w, int h) Implements org. | |
| setSize | back to summary |
|---|---|
| public void setSize(ReadableDimension d) Implements org. | |
| setWidth | back to summary |
|---|---|
| public void setWidth(int width) Implements org. Sets the width.
| |
| setX | back to summary |
|---|---|
| public void setX(int x) Implements org. Sets the x.
| |
| setY | back to summary |
|---|---|
| public void setY(int y) Implements org. Sets the y.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Debugging
| |
| translate | back to summary |
|---|---|
| public void translate(int x, int y) Translate the rectangle by an amount.
| |
| translate | back to summary |
|---|---|
| public void translate(ReadablePoint point) Translate the rectangle by an amount.
| |
| union | back to summary |
|---|---|
| public WritableRectangle union(ReadableRectangle r, WritableRectangle dest) Computes the union of this
| |
| untranslate | back to summary |
|---|---|
| public void untranslate(ReadablePoint point) Un-translate the rectangle by an amount.
| |