|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WRectF
public class WRectF
A value class that defines a rectangle.
The rectangle is defined by a top-left point and a width and height.
| Constructor Summary | |
|---|---|
WRectF()
Default constructor. |
|
WRectF(double x,
double y,
double width,
double height)
Creates a rectangle. |
|
WRectF(WPointF topLeft,
WPointF bottomRight)
Creates a rectangle. |
|
| Method Summary | |
|---|---|
WRectF |
assign(WRectF rhs)
Internal assign method. |
boolean |
contains(double x,
double y)
Tests if a rectangle contains a point. |
boolean |
contains(WPointF p)
Tests if a rectangle contains a point. |
boolean |
equals(WRectF rhs)
Indicates whether some other object is "equal to" this one. |
double |
getBottom()
Returns the bottom side offset. |
WPointF |
getBottomLeft()
Returns the bottom left point. |
WPointF |
getBottomRight()
Returns the bottom right point. |
WPointF |
getCenter()
Returns the center point. |
double |
getHeight()
Returns the height. |
double |
getLeft()
Returns the X position (left side offset). |
WRectF |
getNormalized()
Returns a normalized rectangle. |
double |
getRight()
Returns the the right side offset. |
double |
getTop()
Returns the Y position (top side offset). |
WPointF |
getTopLeft()
Returns the top left point. |
WPointF |
getTopRight()
Returns the top right point. |
double |
getWidth()
Returns the width. |
double |
getX()
Returns the X-position (left side offset). |
double |
getY()
Returns the Y-position (top side offset). |
boolean |
intersects(WRectF other)
Tests if two rectangles intersect. |
boolean |
isEmpty()
Determines whether or not this rectangle is empty. |
void |
setHeight(double height)
Sets the Y-position of the top side. |
void |
setWidth(double width)
Sets the width. |
void |
setX(double x)
Sets the X-position of the left side. |
void |
setY(double y)
Sets the Y-position of the top side. |
WRectF |
united(WRectF other)
Makes the union of to rectangles. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WRectF()
Constructs an empty rectangle at point (0, 0).
public WRectF(double x,
double y,
double width,
double height)
Constructs a rectangle with top left point (x,
y) and size width x height.
public WRectF(WPointF topLeft,
WPointF bottomRight)
Constructs a rectangle from the two points topLeft and
bottomRight.
If you want to create a rectangle from two arbitrary corner points, you
can use this constructor too, but should call
getNormalized() afterwords.
| Method Detail |
|---|
public WRectF assign(WRectF rhs)
public boolean equals(WRectF rhs)
public boolean isEmpty()
A rectangle is empty if its width and height are zero.
public void setX(double x)
The right side of the rectangle does not move, and as a result, the rectangle may be resized.
public void setY(double y)
The bottom side of the rectangle does not move, and as a result, the rectangle may be resized.
public void setWidth(double width)
The right side of the rectangle may move, but this does not affect the left side.
public void setHeight(double height)
The bottom side of the rectangle may move, but this does not affect the Y position of the top side.
public double getX()
This is equivalent to getLeft().
getY(),
getLeft()public double getY()
This is equivalent to getTop().
getX(),
getTop()public double getWidth()
getHeight()public double getHeight()
getWidth()public double getLeft()
getX(),
getRight()public double getTop()
getY(),
getBottom()public double getRight()
getLeft()public double getBottom()
getTop()public WPointF getTopLeft()
getLeft(),
getTop()public WPointF getTopRight()
getRight(),
getTop()public WPointF getCenter()
public WPointF getBottomLeft()
getLeft(),
getBottom()public WPointF getBottomRight()
getRight(),
getBottom()public boolean contains(WPointF p)
public boolean contains(double x,
double y)
public boolean intersects(WRectF other)
public WRectF united(WRectF other)
public WRectF getNormalized()
A normalized rectangle has a positive width and height.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||