diva.sketch.parser2d
Class OrConstraint

java.lang.Object
  |
  +--diva.sketch.parser2d.OrConstraint

public class OrConstraint
extends java.lang.Object
implements RelationConstraint

A composite constraint that ORs together the results of its child constraint objects.

Version:
$Revision: 1.1 $

Constructor Summary
OrConstraint()
           
 
Method Summary
 void addConstraint(RelationConstraint r)
          Add another child constraint to the test.
 boolean test(java.awt.geom.Rectangle2D r1, java.awt.geom.Rectangle2D r2)
          Test the child constraints on the given rectangles; return true if any constraints are met or there are no constraints, false otherwise.
 java.lang.String toString()
          Print out the contents of this constraint.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OrConstraint

public OrConstraint()
Method Detail

test

public boolean test(java.awt.geom.Rectangle2D r1,
                    java.awt.geom.Rectangle2D r2)
Test the child constraints on the given rectangles; return true if any constraints are met or there are no constraints, false otherwise.
Specified by:
test in interface RelationConstraint

addConstraint

public void addConstraint(RelationConstraint r)
Add another child constraint to the test.

toString

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