com.brunchboy.util.swing.relativelayout
Interface Constraint

All Known Implementing Classes:
AttributeConstraint, AxisConstraint

public interface Constraint

Specifies the common features of a constraint, which defines a means of calculating an attribute of a component.

Version:
$Id: Constraint.java,v 1.1.1.1 2002/05/13 20:51:44 jim Exp $
Author:
James Elliott, jim@brunchboy.com

Method Summary
 List getDependencies()
          Return the attributes on which this constraint depends.
 int getValue(AttributeSource attributes)
          Compute the value of the constraint, given the specifications on on which it is based.
 

Method Detail

getDependencies

public List getDependencies()
Return the attributes on which this constraint depends.

Returns:
a list of Attributes which must be resolved before this constraint can be evaluated.

getValue

public int getValue(AttributeSource attributes)
Compute the value of the constraint, given the specifications on on which it is based. Any dependencies must have been resolved prior to calling this method, or the method will fail.

Parameters:
attributes - provides read access to all existing component attributes, for use in evaluating this constraint..
Returns:
the value represented by this constraint, assuming any attributes of the anchor components on which it depends have been resolved already.
Throws:
IllegalStateException - if any dependencies are not yet resolved.