Package com.ardor3d.extension.ui.layout
Class GridLayout
java.lang.Object
com.ardor3d.extension.ui.layout.UILayout
com.ardor3d.extension.ui.layout.GridLayout
A UI Layout that puts content in rows and columns where the row and column cells are set to the minimal size of its
content plus some inter-cell spacing. The components should be added from top to down and left to right. Set the
layout data of the last component in a row to wrap, e.g. by setLayoutData(GridLayoutData.Wrap); You can specify a
horizontal span bigger than one to specify that a component should use multiple cells in the current row.
XXX: Note that this class does not currently support layout of rotated components.
-
Constructor Summary
ConstructorDescriptionCreate a GridLayout with the following defaults: 15 pixels horizontal cell spacing, 5 vertical cell spacing, 10 pixels left, top and right margin, 0 bottom margin, vertical alignment is top and the vertical space won't be distributed between rowsGridLayout
(int interCellSpacingHorizontal, int interCellSpacingVertical, int leftMargin, int topMargin, int rightMargin, int bottomMargin) Create a GridLayout with the specified parameters and a vertical alignment to top and no distribution of vertical space.GridLayout
(int interCellSpacingHorizontal, int interCellSpacingVertical, int leftMargin, int topMargin, int rightMargin, int bottomMargin, boolean fillVerticalSpace) Create a Gridlayout with the specified parameters.GridLayout
(int interCellSpacingHorizontal, int interCellSpacingVertical, int leftMargin, int topMargin, int rightMargin, int bottomMargin, Alignment verticalAlignment) Create a GridLayout with the specified parameters.GridLayout
(int interCellSpacingHorizontal, int interCellSpacingVertical, int leftMargin, int topMargin, int rightMargin, int bottomMargin, Alignment verticalAlignment, boolean fillVerticalSpace) Create a GridLayout with the specified parameters. -
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
-
GridLayout
public GridLayout()Create a GridLayout with the following defaults: 15 pixels horizontal cell spacing, 5 vertical cell spacing, 10 pixels left, top and right margin, 0 bottom margin, vertical alignment is top and the vertical space won't be distributed between rows -
GridLayout
public GridLayout(int interCellSpacingHorizontal, int interCellSpacingVertical, int leftMargin, int topMargin, int rightMargin, int bottomMargin) Create a GridLayout with the specified parameters and a vertical alignment to top and no distribution of vertical space.- Parameters:
interCellSpacingHorizontal
- the inter cell horizontal spacinginterCellSpacingVertical
- the inter cell vertical spacingleftMargin
- the left margintopMargin
- the top marginrightMargin
- the right marginbottomMargin
- the bottom margin
-
GridLayout
public GridLayout(int interCellSpacingHorizontal, int interCellSpacingVertical, int leftMargin, int topMargin, int rightMargin, int bottomMargin, boolean fillVerticalSpace) Create a Gridlayout with the specified parameters. If vertical space is distributed the vertical alignment does not matter.- Parameters:
interCellSpacingHorizontal
- the inter cell horizontal spacinginterCellSpacingVertical
- the inter cell vertical spacingleftMargin
- the left margintopMargin
- the top marginrightMargin
- the right marginbottomMargin
- the bottom marginfillVerticalSpace
-true
if it fills the vertical space
-
GridLayout
public GridLayout(int interCellSpacingHorizontal, int interCellSpacingVertical, int leftMargin, int topMargin, int rightMargin, int bottomMargin, Alignment verticalAlignment) Create a GridLayout with the specified parameters. Any additional vertical space won't be distributed between rows.- Parameters:
interCellSpacingHorizontal
- the inter cell horizontal spacinginterCellSpacingVertical
- the inter cell vertical spacingleftMargin
- the left margintopMargin
- the top marginrightMargin
- the right marginbottomMargin
- the bottom marginverticalAlignment
- only TOP, MIDDLE and BOTTOM are meaningful
-
GridLayout
public GridLayout(int interCellSpacingHorizontal, int interCellSpacingVertical, int leftMargin, int topMargin, int rightMargin, int bottomMargin, Alignment verticalAlignment, boolean fillVerticalSpace) Create a GridLayout with the specified parameters. Note that the vertical alignment does not matter if you choose to distribute any additional space between rows.- Parameters:
interCellSpacingHorizontal
- the inter cell horizontal spacinginterCellSpacingVertical
- the inter cell vertical spacingleftMargin
- the left margintopMargin
- the top marginrightMargin
- the right marginbottomMargin
- the bottom marginverticalAlignment
- only TOP, MIDDLE and BOTTOM are meaningfulfillVerticalSpace
-true
if it fills the vertical space
-
-
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
-