This layout arranges components based on anchors - descriptions of hard connections between two components. These connections are specified per component, where each component may specify a dependent relationship with exactly one other component. Each relationship consists of the two dependent components, the alignment points on each, and optional x/y offsets.
As an example, the following would setup labelA in the top left corner of the container, 5 pixels from the top and 5 pixels from the bottom. Directly below that (5 pixels from the bottom of labelA) is labelB, left aligned to labelA:
UIContainer container; UILabel labelA, labelB ... container.setLayout(new AnchorLayout()); labelA.setLayoutData(new AnchorLayoutData(Alignment.TOP_LEFT, container, Alignment.TOP_LEFT, 5, -5)); labelB.setLayoutData(new AnchorLayoutData(Alignment.TOP_LEFT, labelA, Alignment.BOTTOM_LEFT, 0, -5));@see AnchorLayoutData
|
|
|
|
|
|
|
|