|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lizardtech.djvubean.SimpleArea
public class SimpleArea
SimpleArea is a wrapper class to java.awt.geom.Area using Java java.lang.reflect to access the class methods at runtime. Should the java.awt.geom.Area class be unavailable, then the methods will use java.awt.Rectangle to simulate the Area class.
Constructor Summary | |
---|---|
SimpleArea()
Creates a new AreaRelection object. |
|
SimpleArea(java.awt.Shape shape)
Creates a new SimpleArea object. |
Method Summary | |
---|---|
boolean |
contains(double x,
double y)
Test if a point is contained within this Area. |
boolean |
contains(double x,
double y,
double w,
double h)
Test if the specified rectangle is contained within the Area. |
boolean |
contains(java.awt.Rectangle r)
Test if the specified rectangle is contained in the Area. |
java.awt.Rectangle |
getBounds()
Get the bounds of the area or rectangle. |
java.awt.Shape |
getShape()
Return direct access to the wrapped Area or Rectangle object. |
void |
intersect(SimpleArea rhs)
Set this area to the intersection of with the specified area. |
boolean |
intersects(double x,
double y,
double w,
double h)
Tests if the specified rectangle intersects the Area. |
boolean |
intersects(java.awt.Rectangle r)
Tests if the specified rectangle intersects the Area. |
boolean |
isEmpty()
Test if the area or rectangle is empty. |
static boolean |
isFake()
Method to test if this is really using java.awt.geom.Area. |
void |
reset()
Clears this area to a zero volume. |
void |
setShape(java.awt.Shape area)
Set the shape of the current area. |
void |
subtract(SimpleArea rhs)
Subtract the specified area from this area. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleArea()
public SimpleArea(java.awt.Shape shape)
shape
- to construct from.Method Detail |
---|
public static boolean isFake()
public java.awt.Rectangle getBounds()
public boolean isEmpty()
public void setShape(java.awt.Shape area)
area
- to use.public java.awt.Shape getShape()
public boolean contains(double x, double y)
x
- coordinatey
- coordinate
public boolean contains(double x, double y, double w, double h)
x
- coordinate of upper left.y
- coordinate of upper left.w
- width of the rectangle.h
- height of the rectangle.
public boolean contains(java.awt.Rectangle r)
r
- the rectangle to test.
public void intersect(SimpleArea rhs)
rhs
- Second area to compare with.public boolean intersects(double x, double y, double w, double h)
x
- coordinate of upper left.y
- coordinate of upper left.w
- width of the rectangle.h
- height of the rectangle.
public boolean intersects(java.awt.Rectangle r)
r
- the rectangle to test.
public void reset()
public void subtract(SimpleArea rhs)
rhs
- area to subtract.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |