|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Float
ilog.views.IlvRect
public class IlvRect
The IlvRect class describes a rectangle
defined by a location (x, y) and dimension
(width x height).
This class is a serializable subclass of the Java class
Rectangle2D.Float.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D |
|---|
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float |
| Field Summary |
|---|
| Fields inherited from class java.awt.geom.Rectangle2D.Float |
|---|
height, width, x, y |
| Fields inherited from class java.awt.geom.Rectangle2D |
|---|
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
| Constructor Summary | |
|---|---|
IlvRect()
Constructs a new IlvRect, initialized to
location (0.0, 0.0) and size (0.0, 0.0). |
|
IlvRect(float x,
float y,
float width,
float height)
Constructs and initializes an IlvRect
from the specified coordinates. |
|
IlvRect(IlvRect rect)
Creates a new IlvRect by copying the specified one. |
|
| Method Summary | |
|---|---|
void |
add(float px,
float py)
Adds a point, specified by the arguments px and py, to this
IlvRect. |
void |
add(IlvRect rect)
Adds a IlvRect object to this
IlvRect. |
boolean |
contains(IlvRect rect)
Tests if the rectangle contains the specified one. |
void |
expand(float delta)
Expands current rectangle by delta in x and y. |
void |
expand(float dx,
float dy)
Expands current rectangle by dx in x and dy in y. |
void |
floor()
Modifies the rectangle so that the values becomes mathematical integers. |
int |
heightFloor()
Returns the height of the rectangle as a mathematical integer. |
boolean |
inside(float x,
float y)
Tests if a particular point lies inside the rectangle. |
void |
intersection(IlvRect rect)
Computes the intersection of the rectangle with the specified rectangle. |
boolean |
intersects(IlvRect rect)
Tests if the rectangle intersects another one. |
void |
move(float x,
float y)
Changes the position of the rectangle. |
void |
reshape(float x,
float y,
float width,
float height)
Reshapes the rectangle. |
void |
resize(float width,
float height)
Changes the width and height of the rectangle. |
java.lang.String |
toString()
Returns a String that represents the value
of this IlvRect. |
void |
translate(float dx,
float dy)
Translates the rectangle. |
int |
widthFloor()
Returns the width of the rectangle as a mathematical integer. |
int |
xFloor()
Returns the x coordinate of the rectangle as a mathematical integer. |
int |
yFloor()
Returns the y coordinate of the rectangle as a mathematical integer. |
| Methods inherited from class java.awt.geom.Rectangle2D.Float |
|---|
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRect, setRect |
| Methods inherited from class java.awt.geom.Rectangle2D |
|---|
add, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union |
| Methods inherited from class java.awt.geom.RectangularShape |
|---|
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IlvRect()
IlvRect, initialized to
location (0.0, 0.0) and size (0.0, 0.0).
public IlvRect(float x,
float y,
float width,
float height)
IlvRect
from the specified coordinates.
x - the x coordinate of the
upper left corner of the newly constructed
IlvRecty - the y coordinate of the
upper left corner of the newly constructed
IlvRectwidth - the width of the newly constructed
IlvRectheight - the height of the newly constructed
IlvRectpublic IlvRect(IlvRect rect)
IlvRect by copying the specified one.
rect - The copied rectangle.| Method Detail |
|---|
public final void add(float px,
float py)
px and py, to this
IlvRect. The resulting IlvRect
is the smallest IlvRect that
contains both the original IlvRect and the
specified point.
public final void add(IlvRect rect)
IlvRect object to this
IlvRect. The resulting IlvRect
is the union of the two IlvRect objects.
rect - the IlvRect to add to this
IlvRect.
public final boolean inside(float x,
float y)
public final void move(float x,
float y)
public final void translate(float dx,
float dy)
public final void resize(float width,
float height)
public final void reshape(float x,
float y,
float width,
float height)
public final void expand(float delta)
delta in x and y.
If delta is negative, and 2*delta is bigger than the
current width, the new width is set to 0.
If delta is negative, and 2*delta is bigger than the
current height, the new height is set to 0.
public final void expand(float dx,
float dy)
dx in x and dy in y.
If dx is negative, and 2*dx is bigger than the
current width, the new width is set to 0.
If dy is negative, and 2*dy is bigger than the
current height, the new height is set to 0.
public final boolean contains(IlvRect rect)
public final boolean intersects(IlvRect rect)
public final void intersection(IlvRect rect)
this, the
rectangle passed as a parameter is not modified.
public final void floor()
xFloor(),
yFloor(),
widthFloor(),
heightFloor(),
IlvTransformer.applyFloor(ilog.views.IlvRect)public final int xFloor()
floor(),
yFloor(),
widthFloor(),
heightFloor(),
IlvTransformer.applyFloor(ilog.views.IlvRect)public final int yFloor()
floor(),
xFloor(),
widthFloor(),
heightFloor(),
IlvTransformer.applyFloor(ilog.views.IlvRect)public final int widthFloor()
floor(),
xFloor(),
yFloor(),
heightFloor(),
IlvTransformer.applyFloor(ilog.views.IlvRect)public final int heightFloor()
floor(),
xFloor(),
widthFloor(),
yFloor(),
IlvTransformer.applyFloor(ilog.views.IlvRect)public java.lang.String toString()
String that represents the value
of this IlvRect.
toString in class java.awt.geom.Rectangle2D.FloatIlvRect.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||