com.sun.lwuit.layouts
Class GridLayout

java.lang.Object
  extended by com.sun.lwuit.layouts.Layout
      extended by com.sun.lwuit.layouts.GridLayout

public class GridLayout
extends Layout

Components are arranged in an equally sized grid based on available space


Constructor Summary
GridLayout(int rows, int columns)
          Creates a new instance of GridLayout with the given rows and columns
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getColumns()
           
 Dimension getPreferredSize(Container parent)
          Returns the container preferred size
 int getRows()
           
 boolean isAutoFit()
          Auto fits columns/rows to available screen space
 boolean isFillLastRow()
          When set to true makes the grid layout fill the last row of the layout entirely if the number of elements in that row is bigger.
 void layoutContainer(Container parent)
          Layout the given parent container children
 void setAutoFit(boolean autoFit)
          Auto fits columns/rows to available screen space
 void setFillLastRow(boolean fillLastRow)
          When set to true makes the grid layout fill the last row of the layout entirely if the number of elements in that row is bigger.
 java.lang.String toString()
           
 
Methods inherited from class com.sun.lwuit.layouts.Layout
addLayoutComponent, getComponentConstraint, hashCode, isOverlapSupported, removeLayoutComponent
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridLayout

public GridLayout(int rows,
                  int columns)
Creates a new instance of GridLayout with the given rows and columns

Parameters:
rows - - number of rows.
columns - - number of columns.
Throws:
java.lang.IllegalArgumentException - if rows < 1 or columns < 1
Method Detail

layoutContainer

public void layoutContainer(Container parent)
Description copied from class: Layout
Layout the given parent container children

Specified by:
layoutContainer in class Layout
Parameters:
parent - the given parent container

getPreferredSize

public Dimension getPreferredSize(Container parent)
Description copied from class: Layout
Returns the container preferred size

Specified by:
getPreferredSize in class Layout
Parameters:
parent - the parent container
Returns:
the container preferred size

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getRows

public int getRows()
Returns:
the rows

getColumns

public int getColumns()
Returns:
the columns

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class Layout

isFillLastRow

public boolean isFillLastRow()
When set to true makes the grid layout fill the last row of the layout entirely if the number of elements in that row is bigger.

Returns:
the fillLastRow

setFillLastRow

public void setFillLastRow(boolean fillLastRow)
When set to true makes the grid layout fill the last row of the layout entirely if the number of elements in that row is bigger.

Parameters:
fillLastRow - the fillLastRow to set

isAutoFit

public boolean isAutoFit()
Auto fits columns/rows to available screen space

Returns:
the autoFit

setAutoFit

public void setAutoFit(boolean autoFit)
Auto fits columns/rows to available screen space

Parameters:
autoFit - the autoFit to set


Copyright 2011 Oracle Corporation. All rights reserved. Use is subject to license terms.