|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Rect
A integer based rectangle. The strange name is to avoid name clash with java.awt.Rectangle.
Rect and Box represents the same concept, but their different definition makes them suitable for use in different situations.
Field Summary | |
int |
height
|
int |
width
|
int |
x
|
int |
y
|
Constructor Summary | |
Rect()
Create a default rectangle. |
|
Rect(Box box)
Create a rectnagle based on specified box. |
|
Rect(int x,
int y,
int width,
int height)
Create a rectangle. |
|
Rect(Rect rectangle)
Create a rectangle as a copy of the specified rectangle. |
Method Summary | |
Object |
clone()
Clone this rectangle |
void |
copy(Rect rectangle)
Copy the specified rectangle. |
boolean |
equals(Object object)
Check if this rectangle equals the specified object. |
void |
expand(int dx,
int dy)
Expand this rectangle the specified amount in each direction. |
int |
getCenterX()
Return X coordinate of center of this rectangle. |
int |
getCenterY()
Return Y coordinate of center of this rectangle. |
boolean |
isEmpty()
Return true if this rectangle is empty. |
void |
set(int[] xArray,
int[] yArray)
Set this rectangle as extent of specified polyline. |
void |
set(int x,
int y,
int width,
int height)
Set the parameters for this rectangle. |
String |
toString()
Return a string representation of this rectangle. |
Methods inherited from class Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int x
public int y
public int height
public int width
Constructor Detail |
public Rect(int x, int y, int width, int height)
x
- X coordinate of upper left corner.y
- Y coordinate of upper left corner.width
- Width of rectangle.height
- Height of rectangle.public Rect()
public Rect(Rect rectangle)
rectangle
- public Rect(Box box)
box
- Box to create rectangle from.Method Detail |
public void copy(Rect rectangle)
rectangle
- Rectangle to copy.public Object clone()
public boolean equals(Object object)
object
- Object to chack.
public boolean isEmpty()
public void expand(int dx, int dy)
dx
- Amount to expand to left and right.dy
- Amount to expand on top and botton.public void set(int x, int y, int width, int height)
x
- X coordinate of upper left corner.y
- Y coordinate of upper left corner.width
- Width of rectangle.height
- Height of rectangle.public void set(int[] xArray, int[] yArray)
xArray
- X coordinates of polyline.yArray
- Y coordinates of polyline.public int getCenterX()
public int getCenterY()
public String toString()
|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |