Class GridLayout

java.lang.Object
com.ardor3d.extension.ui.layout.UILayout
com.ardor3d.extension.ui.layout.GridLayout

public class GridLayout extends UILayout
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

    Constructors
    Constructor
    Description
    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(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 Type
    Method
    Description
    void
    Perform the actual layout of the contents in the given container.
    void
    Update the minimum size of this container, based on the contents of the provided container and this layout.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 spacing
      interCellSpacingVertical - the inter cell vertical spacing
      leftMargin - the left margin
      topMargin - the top margin
      rightMargin - the right margin
      bottomMargin - 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 spacing
      interCellSpacingVertical - the inter cell vertical spacing
      leftMargin - the left margin
      topMargin - the top margin
      rightMargin - the right margin
      bottomMargin - the bottom margin
      fillVerticalSpace - 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 spacing
      interCellSpacingVertical - the inter cell vertical spacing
      leftMargin - the left margin
      topMargin - the top margin
      rightMargin - the right margin
      bottomMargin - the bottom margin
      verticalAlignment - 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 spacing
      interCellSpacingVertical - the inter cell vertical spacing
      leftMargin - the left margin
      topMargin - the top margin
      rightMargin - the right margin
      bottomMargin - the bottom margin
      verticalAlignment - only TOP, MIDDLE and BOTTOM are meaningful
      fillVerticalSpace - true if it fills the vertical space
  • Method Details

    • layoutContents

      public void layoutContents(UIContainer container)
      Description copied from class: UILayout
      Perform the actual layout of the contents in the given container.
      Specified by:
      layoutContents in class UILayout
      Parameters:
      container - the container to layout
    • updateMinimumSizeFromContents

      public void updateMinimumSizeFromContents(UIContainer container)
      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 class UILayout
      Parameters:
      container - the container to update