Class GridLayout
java.lang.Object
com.blackrook.gui.layout.GridLayout
- All Implemented Interfaces:
GUILayout
A border layout for GUIObjects similar to
GridLayout.- Author:
- Matthew Tropiano
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe orientation type of how to place the objects as they are added. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intNumber of discrete columns in the layout.protected GridLayout.OrientationOrientation of object placement.protected floatPadding in units between object.protected intNumber of discrete rows in the layout. -
Constructor Summary
ConstructorsConstructorDescriptionGridLayout(int rows, int columns) Creates a new GridLayout.GridLayout(int rows, int columns, float padding) Creates a new GridLayout.GridLayout(int rows, int columns, float padding, GridLayout.Orientation orientation) Creates a new GridLayout.GridLayout(int rows, int columns, GridLayout.Orientation orientation) Creates a new GridLayout. -
Method Summary
Modifier and TypeMethodDescriptionvoidresizeChild(GUIObject object, int index, int childTotal) Called when a child object needs resizing.
-
Field Details
-
rows
protected int rowsNumber of discrete rows in the layout. -
columns
protected int columnsNumber of discrete columns in the layout. -
padding
protected float paddingPadding in units between object. -
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
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
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
Description copied from interface:GUILayoutCalled 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:
resizeChildin interfaceGUILayout- Parameters:
object- the object to resize.index- the child index while traversing through the list of children.childTotal- the total number of children.
-