|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.brunchboy.util.swing.relativelayout.AttributeConstraint
A Constraint that represents a fixed offset from an attribute of another component (or list of components). In the case of a list, the attribute is treated as coming from the bounding box of all components in the list. This is an immutable class, and so it can be freely copied and shared in a multithreaded environment.
| Field Summary | |
protected String |
anchorList
Tracks the comma-delimited list of components relative to which this constraint will be computed. |
static String |
VERSION
Provides access to the CVS version of this class. |
| Constructor Summary | |
AttributeConstraint(String anchorList,
AttributeType attribute)
Simplified constructor usable when offset is zero. |
|
AttributeConstraint(String anchorList,
AttributeType attribute,
int offset)
Constructor sets the immutable fields. |
|
| 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. |
String |
toString()
Provide a textual representation of the constraint for debugging purposes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String VERSION
protected final String anchorList
| Constructor Detail |
public AttributeConstraint(String anchorList,
AttributeType attribute,
int offset)
anchorList - a comma-delimited list of the names the component(s)
relative to which this constraint is computed.attribute - the attribute of the anchor component(s) which is the
source of this constraint's value. When multiple components are
combined, the attribute is treated as coming from their bounding
box.offset - the offset, in pixels, to be added to the anchor
attribute value to compute this constraint's value.
public AttributeConstraint(String anchorList,
AttributeType attribute)
anchorList - a comma-delimited list of the names the component(s)
relative to which this constraint is computed.attribute - the attribute of the anchor component(s) which is the
source of this constraint's value. When multiple components are
combined, the attribute is treated as coming from their bounding
box.| Method Detail |
public List getDependencies()
getDependencies in interface ConstraintAttributes which must be resolved before this
constraint can be evaluated.public int getValue(AttributeSource attributes)
getValue in interface Constraintattributes - provides read access to all existing component
attributes, for use in evaluating this constraint..
IllegalStateException - if any dependencies are not yet resolved.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||