Class GridLayout

java.lang.Object
com.blackrook.gui.layout.GridLayout
All Implemented Interfaces:
GUILayout

public class GridLayout extends Object implements GUILayout
A border layout for GUIObjects similar to GridLayout.
Author:
Matthew Tropiano
  • Field Details

    • rows

      protected int rows
      Number of discrete rows in the layout.
    • columns

      protected int columns
      Number of discrete columns in the layout.
    • padding

      protected float padding
      Padding in units between object.
    • orientation

      protected GridLayout.Orientation orientation
      Orientation of object placement.
  • Constructor Details

    • GridLayout

      public GridLayout(int rows, int columns)
      Creates a new GridLayout.
      Parameters:
      rows - the rows in this grid layout. A value of 0 or less means that the rows do not have a concrete limit.
      columns - the columns in this grid layout. A value of 0 or less means that the columns do not have a concrete limit.
    • GridLayout

      public GridLayout(int rows, int columns, float padding)
      Creates a new GridLayout.
      Parameters:
      rows - the rows in this grid layout. A value of 0 or less means that the rows do not have a concrete limit.
      columns - the columns in this grid layout. A value of 0 or less means that the columns do not have a concrete limit.
      padding - the amount of padding in units between objects.
    • GridLayout

      public GridLayout(int rows, int columns, GridLayout.Orientation orientation)
      Creates a new GridLayout.
      Parameters:
      rows - the rows in this grid layout. A value of 0 or less means that the rows do not have a concrete limit.
      columns - the columns in this grid layout. A value of 0 or less means that the columns do not have a concrete limit.
      orientation - the orientation of the objects in the grid.
    • GridLayout

      public GridLayout(int rows, int columns, float padding, GridLayout.Orientation orientation)
      Creates a new GridLayout.
      Parameters:
      rows - the rows in this grid layout. A value of 0 or less means that the rows do not have a concrete limit.
      columns - the columns in this grid layout. A value of 0 or less means that the columns do not have a concrete limit.
      padding - the amount of padding in units between objects.
      orientation - the orientation of the objects in the grid.
  • Method Details

    • resizeChild

      public void resizeChild(GUIObject object, int index, int childTotal)
      Description copied from interface: GUILayout
      Called when a child object needs resizing. DO NOT RESIZE THE PARENT OBJECT IN THIS METHOD, AS IT MAY CAUSE AN INFINITE LOOP TO OCCUR.
      Specified by:
      resizeChild in interface GUILayout
      Parameters:
      object - the object to resize.
      index - the child index while traversing through the list of children.
      childTotal - the total number of children.