Package com.ardor3d.extension.ui.layout
Class AnchorLayout
java.lang.Object
com.ardor3d.extension.ui.layout.UILayout
com.ardor3d.extension.ui.layout.AnchorLayout
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 Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
layoutContents
(UIContainer container) Perform the actual layout of the contents in the given container.void
updateMinimumSizeFromContents
(UIContainer container) Update the minimum size of this container, based on the contents of the provided container and this layout.
-
Constructor Details
-
AnchorLayout
public AnchorLayout()
-
-
Method Details
-
layoutContents
Description copied from class:UILayout
Perform the actual layout of the contents in the given container.- Specified by:
layoutContents
in classUILayout
- Parameters:
container
- the container to layout
-
updateMinimumSizeFromContents
Description copied from class:UILayout
Update the minimum size of this container, based on the contents of the provided container and this layout.- Specified by:
updateMinimumSizeFromContents
in classUILayout
- Parameters:
container
- the container to update
-