|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--diva.sketch.parser2d.RelationUtilities
A set of static utilties for dealing with relationships between rectangles, specifying important sites on rectangles, or angular directions.
Field Summary | |
static int |
ADJACENT
Positional constraint: is B adjacent to A? |
static int |
CENTER
The center direction constant. |
static int |
CONTAINS
Positional constraint: does A contain B? |
static int |
EAST
The east direction constant. |
static int |
INTERSECTS
Positional constraint: does A intersect B? |
static int |
NO_SIZE_RATIO
No size constant. |
static int |
NORTH
The north direction constant. |
static int |
NORTH_EAST
The north-east direction constant. |
static int |
NORTH_WEST
The north-west direction constant. |
static int |
SOUTH
The south direction constant. |
static int |
SOUTH_EAST
The south-east direction constant. |
static int |
SOUTH_WEST
The south-west direction constant. |
static int |
WEST
The west direction constant. |
Method Summary | |
static void |
checkSite(int site)
Check the given site's validity; throw an illegal argument exception if it is not valid. |
static double |
directionToAngle(int direction)
Return the angle in radians corresponding to the given direction constant (EAST is 0 radians). |
static int |
parseDirection(java.lang.String dir)
Return a direction constant given a string. |
static int |
parseOverlap(java.lang.String overlap)
Return a position constant given a string. |
static java.lang.String |
printDirection(int direction)
Return a string given a direction constant. |
static java.lang.String |
printOverlap(int overlap)
Return a string given a position constant. |
static double |
siteX(java.awt.geom.Rectangle2D r,
int site)
Return the X coordinate of the given site for the given rectangle. |
static double |
siteY(java.awt.geom.Rectangle2D r,
int site)
Return the Y coordinate of the given site for the given rectangle. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int INTERSECTS
public static final int CONTAINS
public static final int ADJACENT
public static final int NORTH_EAST
public static final int NORTH
public static final int NORTH_WEST
public static final int NO_SIZE_RATIO
public static final int WEST
public static final int SOUTH_WEST
public static final int SOUTH
public static final int SOUTH_EAST
public static final int EAST
public static final int CENTER
Method Detail |
public static void checkSite(int site)
public static double directionToAngle(int direction)
public static int parseDirection(java.lang.String dir)
public static int parseOverlap(java.lang.String overlap)
public static java.lang.String printOverlap(int overlap)
public static java.lang.String printDirection(int direction)
public static double siteX(java.awt.geom.Rectangle2D r, int site)
public static double siteY(java.awt.geom.Rectangle2D r, int site)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |