diva.sketch.parser2d
Class DeltaYRelation

java.lang.Object
  extended by diva.sketch.parser2d.DeltaYRelation
All Implemented Interfaces:
Relation

public class DeltaYRelation
extends Object
implements Relation

Calculate the euclidean distance between given sites on pairs of input rectangles.

Version:
$Revision: 1.2 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)

Field Summary
static String NAME
          The name that this relation goes by in text form.
 
Constructor Summary
DeltaYRelation(int site1, int site2)
          Calculate the delta Y between the given sites on two input elements (e1.y - e2.y).
 
Method Summary
 double apply(SceneElement e1, SceneElement e2)
          Return the distance between the constructor-specified sites on r1 and r2, respectively.
static void debug(String s)
          Debugging output.
 String getName()
          The name of this relation.
 int getSite1()
          Get the site for the first rectangle.
 int getSite2()
          Get the site for the second rectangle.
 void setSite1(int site1)
          Set the site for the first rectangle.
 void setSite2(int site2)
          Set the site for the second rectangle.
 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

NAME

public static String NAME
The name that this relation goes by in text form.

Constructor Detail

DeltaYRelation

public DeltaYRelation(int site1,
                      int site2)
Calculate the delta Y between the given sites on two input elements (e1.y - e2.y). The sites should be one of CENTER, NORTH_WEST, NORTH, etc.

Method Detail

apply

public double apply(SceneElement e1,
                    SceneElement e2)
Return the distance between the constructor-specified sites on r1 and r2, respectively.

Specified by:
apply in interface Relation

debug

public static void debug(String s)
Debugging output.


getName

public String getName()
The name of this relation.

Specified by:
getName in interface Relation

getSite1

public int getSite1()
Get the site for the first rectangle.


getSite2

public int getSite2()
Get the site for the second rectangle.


setSite1

public void setSite1(int site1)
Set the site for the first rectangle.


setSite2

public void setSite2(int site2)
Set the site for the second rectangle.


toString

public String toString(String e1Name,
                       String e2Name)
Pretty print the relation in the grammar format.

Specified by:
toString in interface Relation

toString

public String toString()
Print out the contents of this relation.

Overrides:
toString in class Object


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.