diva.sketch.parser2d
Class HeightRatioRelation

java.lang.Object
  |
  +--diva.sketch.parser2d.DirectedRelation
        |
        +--diva.sketch.parser2d.HeightRatioRelation

public class HeightRatioRelation
extends DirectedRelation

Calculate the ratio of heights of the input rectangles with the specified "whichNumerator" constructor argument as the numerator of the ratio.

Version:
$Revision: 1.1 $

Fields inherited from class diva.sketch.parser2d.DirectedRelation
FIRST_RECT, SECOND_RECT
 
Constructor Summary
HeightRatioRelation(int whichNumerator)
          Use the specified "whichNumerator" (DirectedRelation.FIRST_RECT or DirectedRelation.SECOND_RECT) as the numerator of the ratio calculation.
 
Method Summary
 double apply(java.awt.geom.Rectangle2D r1, java.awt.geom.Rectangle2D r2)
          Calculate the height ratio using the constructor-specified whichNumerator.
 java.lang.String getName()
          The name of this relation.
 java.lang.String toString()
          Print out the contents of this relation.
 
Methods inherited from class diva.sketch.parser2d.DirectedRelation
getWhich, parseWhich, printWhich, setWhich
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HeightRatioRelation

public HeightRatioRelation(int whichNumerator)
Use the specified "whichNumerator" (DirectedRelation.FIRST_RECT or DirectedRelation.SECOND_RECT) as the numerator of the ratio calculation.
Method Detail

apply

public double apply(java.awt.geom.Rectangle2D r1,
                    java.awt.geom.Rectangle2D r2)
Calculate the height ratio using the constructor-specified whichNumerator.
Overrides:
apply in class DirectedRelation

getName

public java.lang.String getName()
The name of this relation.
Overrides:
getName in class DirectedRelation

toString

public java.lang.String toString()
Print out the contents of this relation.
Overrides:
toString in class java.lang.Object