public class Rectangle extends Point
Modifier and Type | Field and Description |
---|---|
private int |
height |
private static long |
serialVersionUID
UID for serialization.
|
private int |
width |
Modifier | Constructor and Description |
---|---|
protected |
Rectangle()
The constructor for de-serialization in GWT.
|
|
Rectangle(int x,
int y,
int width,
int height)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
Rectangle |
clipTo(Rectangle clippingArea,
boolean move)
This method calculates a clipped variant from this
Rectangle that fits inside the given
clippingArea . |
boolean |
equals(Object obj) |
int |
getHeight() |
int |
getWidth() |
int |
getX2() |
int |
getY2() |
int |
hashCode() |
Rectangle |
moveBy(int dx,
int dy)
Creates a new
Rectangle of this moved from its current position relatively by the to the given
dx and dy coordinate offsets. |
Rectangle |
moveBy(Point p)
|
Rectangle |
moveTo(int newX,
int newY)
|
Rectangle |
moveTo(Point p)
|
Rectangle |
resize(int dx,
int dy,
Direction direction,
int minWidth,
int minHeight)
|
private static final long serialVersionUID
private int width
getWidth()
private int height
getHeight()
protected Rectangle()
public Rectangle(int x, int y, int width, int height)
x
- is the x-position
.y
- is the y-position
.width
- is the width
.height
- is the height
.public Rectangle moveTo(int newX, int newY)
newX
- is the new x-position
.newY
- is the new y-position
.Rectangle
with the same size and located at the given point.public Rectangle moveBy(int dx, int dy)
Rectangle
of this moved from its current position relatively by the to the given
dx
and dy
coordinate offsets.dx
- is the value to add to the x-position
. May be negative to move left.dy
- is the value to add to the y-position
. May be negative to move up.Rectangle
with the same size and moved by the given offset.public Rectangle clipTo(Rectangle clippingArea, boolean move)
Rectangle
that fits inside the given
clippingArea
.public Rectangle resize(int dx, int dy, Direction direction, int minWidth, int minHeight)
dx
- is the delta offset for the x-position
.dy
- is the delta offset for the y-position
.direction
- is the Direction
where to resize.minWidth
- is the minimum width
.minHeight
- is the minimum height
.Rectangle
.public int getX2()
Rectangle
.public int getY2()
Rectangle
.Copyright © 2001–2016 mmm-Team. All rights reserved.