|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.brunchboy.util.swing.relativelayout.AxisConstraint
A Constraint that represents a fractional position along an axis of another component. In other words, for a vertical attribute, it can range from the top of the component (0.0) to the bottom (1.0). For horizontal attributes, the range spans from the left to the right edges. It is possible to use values outside this range, to represent points outside the anchor component, but there aren't yet any envisioned uses for such constraints.
This is an immutable class, and so it can be freely copied and shared in a multithreaded environment.
| Field Summary | |
protected String |
anchorName
Tracks the component relative to which this constraint will be computed. |
static String |
VERSION
Provides access to the CVS version of this class. |
| Constructor Summary | |
AxisConstraint(String anchorName,
AttributeAxis axis,
double position)
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 anchorName
| Constructor Detail |
public AxisConstraint(String anchorName,
AttributeAxis axis,
double position)
anchorName - the component relative to which this constraint is
computed.axis - the axis along which we'll compute a fractional position.position - the fraction to be used to position ourselves within the
anchor component.| 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 | |||||||||