|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lizardtech.djvu.DjVuObject
com.lizardtech.djvu.GRect
public class GRect
A general class for rectange shapes. By convention DjVu images are in bottom up coordinates. Thus, ymax corresponds to the top of a rectangle and ymin to the bottom.
Field Summary | |
---|---|
int |
xmax
Left edge |
int |
xmin
Right edge |
int |
ymax
Top edge. |
int |
ymin
Bottom edge. |
Fields inherited from class com.lizardtech.djvu.DjVuObject |
---|
hasReferences |
Constructor Summary | |
---|---|
GRect()
Creates a new GRect object. |
|
GRect(int xmin,
int ymin,
int width,
int height)
Creates a new GRect object. |
Method Summary | |
---|---|
long |
area()
Compute the area of this rectangle. |
void |
clear()
Reset this rectange with all edges at the origin. |
java.lang.Object |
clone()
Create a clone of this rectangle. |
boolean |
contains(GRect rect)
Test if a rectangle is contained within this rectangle. |
boolean |
contains(int x,
int y)
Test if a point is contained in this rectangle. |
boolean |
equals(java.lang.Object ref)
Test if two rectangles are equal. |
int |
height()
Query the height of this rectangle. |
boolean |
inflate(int dx,
int dy)
Grow the size of this rectangle by moving all the edges outwards. |
boolean |
intersect(GRect rect1,
GRect rect2)
Set this rectangle as the intersection of two rectangles. |
boolean |
isEmpty()
Query if the rectange is empty. |
boolean |
recthull(GRect rect1,
GRect rect2)
Set this rectangle as the union of two rectangles. |
boolean |
translate(int dx,
int dy)
Shift this rectangle |
int |
width()
Compute the width of this rectangle. |
Methods inherited from class com.lizardtech.djvu.DjVuObject |
---|
checkLockTime, create, create, createSoftReference, createWeakReference, getDjVuOptions, getFromReference, invoke, setDjVuOptions |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int xmax
public int xmin
public int ymax
public int ymin
Constructor Detail |
---|
public GRect()
public GRect(int xmin, int ymin, int width, int height)
xmin
- left edgeymin
- bottom edgewidth
- horizontal lengthheight
- vertical lengthMethod Detail |
---|
public boolean isEmpty()
public long area()
public void clear()
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean contains(int x, int y)
x
- horizontal coordinatey
- vertical coordinate
public boolean contains(GRect rect)
rect
- rectangle to test
public boolean equals(java.lang.Object ref)
equals
in class java.lang.Object
ref
- reference rectangle to compare with
public int height()
public boolean inflate(int dx, int dy)
dx
- Amount to grow the horizontal edgesdy
- Amount to grow the vertical edges
public boolean intersect(GRect rect1, GRect rect2)
rect1
- rectangle to intersectrect2
- rectangle to intersect
public boolean recthull(GRect rect1, GRect rect2)
rect1
- rectangle to unionrect2
- rectangle to union
public boolean translate(int dx, int dy)
dx
- horizontal distance to shiftdy
- vertical distance to shift
public int width()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |