org.xith3d.ui.hud.layout
Class GridLayout

java.lang.Object
  extended by org.xith3d.ui.hud.layout.LayoutManagerBase
      extended by org.xith3d.ui.hud.layout.BorderSettableLayoutManagerBase
          extended by org.xith3d.ui.hud.layout.GridLayout
All Implemented Interfaces:
BorderSettableLayoutManager, LayoutManager

public class GridLayout
extends BorderSettableLayoutManagerBase

The GridLayout arranges the contained Widgets in a Grid.
You can define borders and gaps and even column- and row-weights.

the widgets' original size is overwritten by the calculated size. If the rows-count is 0, then the widget's original height is respected and only the width is calculated. The same applies for columns-count.

If columns-count is greater than 0, one row is filled after the other in the order, the widgets are added. If columns-count is 0, the fields are filled by column-first.


Field Summary
 
Fields inherited from interface org.xith3d.ui.hud.layout.LayoutManager
IGNORED_BY_LAYOUT
 
Constructor Summary
GridLayout(int rows, int cols)
           
GridLayout(int rows, int cols, float hgap, float vgap)
           
GridLayout(int rows, int cols, float borderBottom, float borderRight, float borderTop, float borderLeft)
           
GridLayout(int rows, int cols, float hgap, float vgap, float borderBottom, float borderRight, float borderTop, float borderLeft)
           
 
Method Summary
protected  void doLayout(float left0, float top0, float containerResX, float containerResY)
          
 int getCols()
           
 float[] getColWeights()
           
 float getHGap()
           
 int getRows()
           
 float[] getRowWeights()
           
 float getVGap()
           
 void setCols(int cols)
           
 void setColWeights(float... weights)
           
 void setHGap(float hgap)
           
 void setRows(int rows)
           
 void setRowWeights(float... weights)
           
 void setVGap(float vgap)
           
 
Methods inherited from class org.xith3d.ui.hud.layout.BorderSettableLayoutManagerBase
getBorderBottom, getBorderLeft, getBorderRight, getBorderTop, setBorderBottom, setBorderLeft, setBorderRight, setBorderTop
 
Methods inherited from class org.xith3d.ui.hud.layout.LayoutManagerBase
addWidget, clear, doLayout, getInvisibleWidgetsHidden, getWidgets, removeWidget, setInvisibleWidgetsHidden
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridLayout

public GridLayout(int rows,
                  int cols,
                  float hgap,
                  float vgap,
                  float borderBottom,
                  float borderRight,
                  float borderTop,
                  float borderLeft)

GridLayout

public GridLayout(int rows,
                  int cols,
                  float hgap,
                  float vgap)

GridLayout

public GridLayout(int rows,
                  int cols,
                  float borderBottom,
                  float borderRight,
                  float borderTop,
                  float borderLeft)

GridLayout

public GridLayout(int rows,
                  int cols)
Method Detail

setRows

public void setRows(int rows)

getRows

public final int getRows()

setCols

public void setCols(int cols)

getCols

public final int getCols()

setHGap

public void setHGap(float hgap)

getHGap

public final float getHGap()

setVGap

public void setVGap(float vgap)

getVGap

public final float getVGap()

setColWeights

public void setColWeights(float... weights)

getColWeights

public final float[] getColWeights()

setRowWeights

public void setRowWeights(float... weights)

getRowWeights

public final float[] getRowWeights()

doLayout

protected void doLayout(float left0,
                        float top0,
                        float containerResX,
                        float containerResY)

Specified by:
doLayout in class LayoutManagerBase