Package com.brunchboy.util.swing.relativelayout

A constraint-based relative layout manager.

See:
          Description

Interface Summary
AttributeSource This interface is used in conjunction with Constraint so that constraint implementations can have read-only access to all component attributes when evaluating themselves.
Constraint Specifies the common features of a constraint, which defines a means of calculating an attribute of a component.
 

Class Summary
Attribute A simple, immutable class that represents a particular attribute within a RelativeLayout.
AttributeAxis A typesafe enumeration of the axes on which attributes exist within a RelativeLayout.
AttributeConstraint A Constraint that represents a fixed offset from an attribute of another component (or list of components).
AttributeType A typesafe enumeration of the types of attributes that can be associated with components within a RelativeLayout.
AxisConstraint A Constraint that represents a fractional position along an axis of another component.
ComponentSpecifications Keeps track of the specifications that have been provided for a particular component, and is able to determine how to derive the rest from these constraints.
DependencyManager Keeps track of all dependencies that have been declared or derived in setting up the component constraints in the RelativeLayout, and can sort them in the proper order for resolution when it's time to lay the components out.
RelativeLayout A layout manager that uses a dependency analyzer to support an arbitrary (but consistent and complete) set of relative constraints between its components.
XmlConstraintBuilder A helper class providing the ability to add constraints to a RelativeLayout by parsing XML definition files.
 

Exception Summary
XmlConstraintBuilder.ParseException An exception subclass with which we'll wrap any exceptions thrown in parsing the constraints specifications, to shield our clients from details about the libraries we use, unless they want to know about them.
 

Package com.brunchboy.util.swing.relativelayout Description

A constraint-based relative layout manager. The classes in this package jointly implement a layout manager which uses a dependency analyzer to support an arbitrary set of inter-component dependencies (as long as they are consistent, and sufficient to fully constrain the layout of the components).

The classes you'll interact with the most are the layout manager itself, RelativeLayout, and the two concrete Constraint implementations, AttributeConstraint and AxisConstraint.

To simplify the construction of a rich set of constraints, you can use an XML file parsed by XmlConstraintBuilder.

There is an introduction and tutorial for working with this package on O'Reilly's ONJava site.