|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.sketch.parser2d.OverlapRelation
public class OverlapRelation
Calculate the percentage of one of the rectangles that overlaps the other. Divide the area of the intersection by the area of the "which" rectangle specified in the constructor.
Field Summary | |
---|---|
static String |
NAME
The name that this relation goes by in text form. |
Constructor Summary | |
---|---|
OverlapRelation()
|
Method Summary | |
---|---|
double |
apply(SceneElement e1,
SceneElement e2)
Return the ratio of the area of the intersection of the given elements to the area of the first rectangle. |
String |
getName()
The name of this relation. |
String |
toString()
Print out the contents of this relation. |
String |
toString(String e1Name,
String e2Name)
Pretty print the relation in the grammar format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static String NAME
Constructor Detail |
---|
public OverlapRelation()
Method Detail |
---|
public double apply(SceneElement e1, SceneElement e2)
apply
in interface Relation
public String getName()
getName
in interface Relation
public String toString(String e1Name, String e2Name)
toString
in interface Relation
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |