|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jfig.objects.FigBbox
manage bounding boxes for jfig objects.
FigBbox: a simple bounding box with x_left, y_top, x_right, y_bottom coordinates, better suited than the rectangle class provided in java.awt.
Constructor Summary | |
FigBbox(FigBbox src)
|
|
FigBbox(int xl,
int yt,
int xr,
int yb)
construct a FigBbox from two (x,y) pairs. |
|
FigBbox(java.awt.Point lt,
java.awt.Point rb)
construct a FigBbox from two Points. |
Method Summary | |
FigBbox |
get()
|
java.awt.Point |
getCenterPoint()
|
java.awt.Point |
getNearestCorner(java.awt.Point wp)
|
java.awt.Point |
getOppositeCorner(java.awt.Point wp)
|
java.awt.Rectangle |
getRectangle()
|
int |
getXl()
|
int |
getXr()
|
int |
getYb()
|
int |
getYt()
|
boolean |
inside(FigBbox region)
check whether this bounding box is completely inside region (this function is used for delete region and create compound by region in the jfig graphics editor) |
boolean |
inside(int x,
int y)
check whether coordinates (x,y) are inside this bbox |
boolean |
isInside(java.awt.Point WP)
check whether point PW lies inside this bounding box object. |
boolean |
isOnBorder(java.awt.Point wp,
int dist)
check whether the Point wp is on the border (that is, within distance dist) from the outline of this bounding box. |
boolean |
isVisible(FigBbox viewport)
check whether this bounding box is visible (lies inside) the parameter bounding box (e.g. |
double |
minDistance(java.awt.Point wp)
minDistance(): return the minimium distance of Point wp from the corners of this bounding box. |
double |
minDistanceInside(java.awt.Point wp)
return a distance between point wp and this FigBBox useful for object selection. |
double |
minDistanceInsideZero(java.awt.Point wp)
return the Manhattan distance of point wp to the nearest corner of this bounding box, or zero if point wp lies inside. |
void |
set(FigBbox bbox)
|
void |
set(int xl,
int yt,
int xr,
int yb)
|
java.lang.String |
toString()
toString(): print the bbox coordinates |
FigBbox |
union(FigBbox bbox2)
construct and return a FigBbox that represents the bounding box of the union of 'this' FigBbox and FigBbox bbox2 |
static FigBbox |
union(FigBbox bbox1,
FigBbox bbox2)
construct and return a FigBbox that represents the bounding box of the union of FigBbox'es bbox1 and bbox2 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FigBbox(int xl, int yt, int xr, int yb)
public FigBbox(java.awt.Point lt, java.awt.Point rb)
public FigBbox(FigBbox src)
Method Detail |
public final void set(int xl, int yt, int xr, int yb)
public final void set(FigBbox bbox)
public final FigBbox get()
public int getXl()
public int getYt()
public int getXr()
public int getYb()
public final boolean isInside(java.awt.Point WP)
public final boolean inside(int x, int y)
public final boolean inside(FigBbox region)
public final boolean isVisible(FigBbox viewport)
public final boolean isOnBorder(java.awt.Point wp, int dist)
public final FigBbox union(FigBbox bbox2)
public static final FigBbox union(FigBbox bbox1, FigBbox bbox2)
public final double minDistance(java.awt.Point wp)
public final double minDistanceInsideZero(java.awt.Point wp)
public final double minDistanceInside(java.awt.Point wp)
public final java.awt.Point getNearestCorner(java.awt.Point wp)
public final java.awt.Point getOppositeCorner(java.awt.Point wp)
public final java.awt.Point getCenterPoint()
public java.awt.Rectangle getRectangle()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |