diva.sketch.parser2d
Class WidthRatioRelation
java.lang.Object
|
+--diva.sketch.parser2d.DirectedRelation
|
+--diva.sketch.parser2d.WidthRatioRelation
- public class WidthRatioRelation
- extends DirectedRelation
Calculate the ratio of widths of the input rectangles
with the specified "whichNumerator" constructor argument
as the numerator of the ratio.
- Version:
- $Revision: 1.1 $
Constructor Summary |
WidthRatioRelation(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 java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
WidthRatioRelation
public WidthRatioRelation(int whichNumerator)
- Use the specified "whichNumerator" (DirectedRelation.FIRST_RECT
or DirectedRelation.SECOND_RECT) as the numerator of the
ratio calculation.
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