|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.v3x.graphics.DoubleRectangle
public class DoubleRectangle
A rectangle in whole-number space. Because whole numbers are part of this nutritious breakfast.
| Field Summary | |
|---|---|
double |
east
|
static double |
EPSILON
|
double |
north
|
double |
south
|
double |
west
|
| Constructor Summary | |
|---|---|
DoubleRectangle()
Create a new DoubleRectangle. |
|
DoubleRectangle(double west,
double south,
double east,
double north)
Create a new DoubleRectangle with given west, south, east and north. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
boolean |
contains(double x,
double y)
Returns true if this rectangle contains the given point. |
boolean |
covers(DoubleRectangle nother)
Returns true if this rectangle covers the given one. |
static DoubleRectangle |
createStartingRectangleForExtents()
Gives a rectangle with reversed infinite extents, useful in conjunction with stretchToInclude() when generating extents boxes. |
double |
getArea()
Area (width * height) |
Coord3D |
getCenter()
Returns the center of the given rectangle |
double |
getEast()
Maximum x coordinate (east edge) |
double |
getHeight()
Height |
double |
getNorth()
Maximum y coordinate (north edge) |
double |
getSouth()
Minimum y coordinate (southern edge) |
double |
getWest()
Minimum x coordinate (western edge) |
double |
getWidth()
Width |
double |
getX()
Minimum x (same as west) |
double |
getY()
Minimum y (same as south) |
DoubleRectangle |
intersection(DoubleRectangle nother)
Returns the intersection of the given rectangle with this (returns null if there is none) |
boolean |
intersects(DoubleRectangle nother)
Returns true if the given rectangle intersects this one. |
boolean |
isDegenerate()
True if rectangle is degenerate (has either no height or no width) |
void |
setEast(double newEast)
Maximum x coordinate (east edge) |
void |
setNorth(double newNorth)
Maximum y coordinate (north edge) |
void |
setSouth(double newSouth)
Minimum y coordinate (southern edge) |
void |
setWest(double newWest)
Minimum x coordinate (western edge) |
void |
stretchToInclude(Coord2D coord)
Stretches the rectangle to include the given point. |
void |
stretchToInclude(double x,
double y)
Stretches the rectangle to include the given point. |
java.lang.String |
toString()
|
java.util.ArrayList |
trimmings(DoubleRectangle nother)
Returns a list of rectangles formed when the given rectangle is cropped by this one. |
DoubleRectangle |
union(DoubleRectangle nother)
Returns the union of the given rectangle with this. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final double EPSILON
public double west
public double south
public double east
public double north
| Constructor Detail |
|---|
public DoubleRectangle()
public DoubleRectangle(double west,
double south,
double east,
double north)
| Method Detail |
|---|
public static DoubleRectangle createStartingRectangleForExtents()
public boolean contains(double x,
double y)
public boolean intersects(DoubleRectangle nother)
public boolean covers(DoubleRectangle nother)
public DoubleRectangle union(DoubleRectangle nother)
public void stretchToInclude(Coord2D coord)
public void stretchToInclude(double x,
double y)
public DoubleRectangle intersection(DoubleRectangle nother)
public java.util.ArrayList trimmings(DoubleRectangle nother)
public java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic double getWest()
public void setWest(double newWest)
public double getSouth()
public void setSouth(double newSouth)
public double getEast()
public void setEast(double newEast)
public double getNorth()
public void setNorth(double newNorth)
public double getArea()
public double getX()
public double getY()
public double getWidth()
public double getHeight()
public Coord3D getCenter()
public boolean isDegenerate()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||