|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Box
A rectangle defined by its upper left (included) and lower right (not included) corners.
1############## ############### ############### 2This corresponds to a Rect of width = x2 - x1 and height = y2 - y1.
Rect and Box represents the same concept, but their different definition makes them suitable for use in different situations.
Field Summary | |
int |
x1
|
int |
x2
|
int |
y1
|
int |
y2
|
Constructor Summary | |
Box()
Create an empty box. |
|
Box(Box box)
Create a new box as a copy of the specified box. |
|
Box(int x1,
int y1,
int x2,
int y2)
Create a new box with specified coordinates. |
|
Box(Rect rectangle)
Create a new box based on the specified rectangle. |
Method Summary | |
Object |
clone()
Clone this box. |
void |
copy(Box box)
Copy the specified box. |
boolean |
isInside(int x,
int y)
Check if the specified point is ionside this box. |
boolean |
isInsideOf(Box box)
Return true if this box is inside the specified box. |
boolean |
isOverlapping(Box box)
Return true if this box overlaps the specified box. |
boolean |
isOverlapping(Rect rectangle)
Return true if this box overlaps the specified rectangle. |
void |
offset(int dx,
int dy)
Offset this box a specified distance in x and y direction. |
void |
set(int x1,
int y1,
int x2,
int y2)
Set the parameters of this box. |
String |
toString()
Return a string representation of this box. |
Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int x1
public int x2
public int y1
public int y2
Constructor Detail |
public Box()
public Box(Box box)
box
- Box to copy.public Box(int x1, int y1, int x2, int y2)
x1
- X of upper left corner (inclusive).y1
- Y of upper left corner (inclusive).x2
- X of lower right corner (not inclusive)y2
- Y of lower right corner (not inclusive).public Box(Rect rectangle)
rectangle
- Rectangle to copy.Method Detail |
public void copy(Box box)
box
- Box to copy.public Object clone()
public void set(int x1, int y1, int x2, int y2)
x1
- X coordinate of upper left corner of box.y1
- Y coordinate of upper left corner of box.x2
- X coordinate of lower right corner of box.y2
- Y coordinate of lower right corner of box.public boolean isInside(int x, int y)
x
- X coordinate of point to check.y
- Y coordinate of point to check.
public boolean isInsideOf(Box box)
box
- Box to check if this is inside of.
public boolean isOverlapping(Box box)
box
- Box to check if this is inside of.
public boolean isOverlapping(Rect rectangle)
rectangle
- Rectnagle to check if this is inside of.
public void offset(int dx, int dy)
dx
- Offset in x direction.dy
- Offset in y direction.public String toString()
|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |