diva.sketch.parser2d
Class WidthRatioRelation

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

public class WidthRatioRelation
extends Object
implements Relation

Calculate the ratio of the width of the first input scene element to the width of the second.

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

Field Summary
static String NAME
          The name that this relation goes by in text form.
 
Constructor Summary
WidthRatioRelation()
           
 
Method Summary
 double apply(SceneElement e1, SceneElement e2)
          Calculate the ratio of the width of the first element to the width of the second.
 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

NAME

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

Constructor Detail

WidthRatioRelation

public WidthRatioRelation()
Method Detail

apply

public double apply(SceneElement e1,
                    SceneElement e2)
Calculate the ratio of the width of the first element to the width of the second.

Specified by:
apply in interface Relation

getName

public String getName()
The name of this relation.

Specified by:
getName in interface Relation

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.