|
Oxygen XML Editor 12.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ro.sync.exml.view.graphics.Rectangle
public class Rectangle
Rectangle.
Field Summary | |
---|---|
int |
height
The height. |
int |
width
The width. |
int |
x
The x. |
int |
y
The y. |
Constructor Summary | |
---|---|
Rectangle(int x,
int y,
int width,
int height)
Constructor. |
|
Rectangle(Rectangle r)
Copy constructor. |
Method Summary | |
---|---|
boolean |
adjacent(Rectangle r)
|
boolean |
contains(int x,
int y)
Checks whether or not this Rectangle contains the
point at the specified location
(x, y). |
boolean |
contains(Rectangle r)
Checks whether or not this Rectangle entirely contains the specified
Rectangle . |
boolean |
equals(java.lang.Object obj)
Checks whether two rectangles are equal. |
Rectangle |
getBounds()
|
int |
getHeight()
|
int |
getWidth()
|
int |
getX()
|
int |
getY()
|
int |
hashCode()
|
Rectangle |
intersection(Rectangle r)
Computes the intersection of this Rectangle with the
specified Rectangle . |
boolean |
intersects(int rX,
int rY,
int rW,
int rH)
Determines whether or not this Rectangle and the specified
Rectangle intersect. |
boolean |
intersects(Rectangle r)
Determines whether or not this Rectangle and the specified
Rectangle intersect. |
static void |
main(java.lang.String[] args)
TC main. |
java.lang.String |
toString()
Returns a String representing this
Rectangle and its values. |
Shape |
translate(int tx,
int ty)
Translate the shape into another one. |
Rectangle |
union(Rectangle r)
Computes the union of this Rectangle with the
specified Rectangle . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int width
public int height
public int x
public int y
Constructor Detail |
---|
public Rectangle(int x, int y, int width, int height)
x
- The x coordinate.y
- The y coordinate.width
- The width.height
- The height.public Rectangle(Rectangle r)
r
- The other rectangle to be used.Method Detail |
---|
public final boolean intersects(Rectangle r)
Rectangle
and the specified
Rectangle
intersect. Two rectangles intersect if their intersection is nonempty.
r
- the specified Rectangle
true
if the specified Rectangle
and this
Rectangle
intersect; false
otherwise.public final boolean intersects(int rX, int rY, int rW, int rH)
Rectangle
and the specified
Rectangle
intersect. Two rectangles intersect if their intersection is nonempty.
rX
- X of rectrY
- Y of rectrW
- Width of rectrH
- Height of rect
true
if the specified Rectangle
and this
Rectangle
intersect; false
otherwise.public boolean contains(Rectangle r)
Rectangle
entirely contains the specified
Rectangle
.
r
- the specified Rectangle
true
if the Rectangle
is contained entirely inside this
Rectangle
;false
otherwise.public boolean contains(int x, int y)
Rectangle
contains the
point at the specified location
(x, y).
x
- the specified x coordinatey
- the specified y coordinate
true
if the point
(x, y) is inside this
Rectangle
;
false
otherwise.public java.lang.String toString()
String
representing this
Rectangle
and its values.
toString
in class java.lang.Object
String
representing this
Rectangle
object's coordinate and size values.public boolean equals(java.lang.Object obj)
The result is true
if and only if the argument is not
null
and is a Rectangle
object that has the
same top-left corner, width, and height as this Rectangle
.
equals
in class java.lang.Object
obj
- the Object
to compare with
this Rectangle
true
if the objects are equal;
false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public Rectangle union(Rectangle r)
Rectangle
with the
specified Rectangle
. Returns a new
Rectangle
that
represents the union of the two rectangles
r
- the specified Rectangle
Rectangle
containing both
the specified Rectangle
and this
Rectangle
.public int getHeight()
public int getWidth()
public int getX()
public int getY()
public boolean adjacent(Rectangle r)
r
- The rectangle to check for adjacency.
public Rectangle intersection(Rectangle r)
Rectangle
with the
specified Rectangle
. Returns a new Rectangle
that represents the intersection of the two rectangles.
If the two rectangles do not intersect, the result will be
an empty rectangle.
r
- the specified Rectangle
Rectangle
contained in both the
specified Rectangle
and in
this Rectangle
; or if the rectangles
do not intersect, an empty rectangle.public static void main(java.lang.String[] args)
args
- Main argspublic Rectangle getBounds()
getBounds
in interface Shape
Shape.getBounds()
public Shape translate(int tx, int ty)
Shape
translate
in interface Shape
tx
- the distance by which coordinates are translated in the
X axis directionty
- the distance by which coordinates are translated in the
Y axis direction
Shape.translate(int, int)
|
Oxygen XML Editor 12.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |