|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--diva.sketch.parser2d.DirectedRelation
A directed relation is a relation where the value being calculated is relative to one of the rectangles in particular. The DirectedRelation abstract class provides constants by which the user can specify which rectangle the relation is relative to. An example of a directed relation is the angle between two rectangles: calculating relative to one rectangle might produce 30 degrees; relative to the other would be 210 degrees.
The significance of the "which" rectangle is totally dependent on the implementation of the relation and should be documented in the subclass documentation.
Field Summary | |
static int |
FIRST_RECT
Specify the first rectangle of the relational query. |
static int |
SECOND_RECT
Specify the second rectangle of the relational query. |
Constructor Summary | |
DirectedRelation(int which)
Construct the relation query whose ratio is determined by the "which" argument as either the FIRST_RECT or SECOND_RECT. |
Method Summary | |
abstract double |
apply(java.awt.geom.Rectangle2D r1,
java.awt.geom.Rectangle2D r2)
Apply the directed relation. |
abstract java.lang.String |
getName()
The name of this relation. |
int |
getWhich()
Return which rectangle the calculation is relative to. |
static int |
parseWhich(java.lang.String which)
Parse the string constants FIRST_RECT or SECOND_RECT to their integer constant equivalents. |
static java.lang.String |
printWhich(int which)
Convert the integer constant FIRST_RECT or SECOND_RECT to a string for printing. |
void |
setWhich(int which)
Set which rectangle the calculation is relative to. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static int FIRST_RECT
public static int SECOND_RECT
Constructor Detail |
public DirectedRelation(int which)
setWhich(int)
Method Detail |
public abstract double apply(java.awt.geom.Rectangle2D r1, java.awt.geom.Rectangle2D r2)
public abstract java.lang.String getName()
public int getWhich()
setWhich(int)
public void setWhich(int which)
public static java.lang.String printWhich(int which)
public static int parseWhich(java.lang.String which)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |