|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.layouts.Layout com.sun.lwuit.table.TableLayout
public class TableLayout
Layout manager similar in spirit to HTML tables allowing rows and columns of varying width/height.
Nested Class Summary | |
---|---|
static class |
TableLayout.Constraint
Represents the layout constraint for an entry within the table indicating the desired position/behavior of the component. |
Constructor Summary | |
---|---|
TableLayout(int rows,
int columns)
A table must declare the amount of rows and columns in advance |
Method Summary | |
---|---|
void |
addLayoutComponent(java.lang.Object value,
Component comp,
Container c)
Some layouts can optionally track the addition of elements with meta-data that allows the user to "hint" on object positioning. |
TableLayout.Constraint |
createConstraint()
Creates a new Constraint instance to add to the layout |
TableLayout.Constraint |
createConstraint(int row,
int column)
Creates a new Constraint instance to add to the layout |
boolean |
equals(java.lang.Object o)
|
int |
getCellHorizontalSpan(int row,
int column)
Returns the spanning for the table cell at the given coordinate |
int |
getCellVerticalSpan(int row,
int column)
Returns the spanning for the table cell at the given coordinate |
int |
getColumnPosition(int col)
Returns the position of the given table column. |
int |
getColumns()
Get the number of columns |
Component |
getComponentAt(int row,
int column)
Returns the component at the given row/column |
java.lang.Object |
getComponentConstraint(Component comp)
Returns the optional component constraint |
static int |
getDefaultColumnWidth()
Indicates the default (in percentage) for the column width, -1 indicates automatic sizing |
static int |
getDefaultRowHeight()
Indicates the default (in percentage) for the row height, -1 indicates automatic sizing |
static int |
getMinimumSizePerColumn()
Indicates the minimum size for a column in the table, this is applicable for tables that are not scrollable on the X axis. |
int |
getNextColumn()
Returns the column where the next operation of add will appear |
int |
getNextRow()
Returns the row where the next operation of add will appear |
Dimension |
getPreferredSize(Container parent)
Returns the container preferred size |
int |
getRowPosition(int row)
Returns the position of the given table row. |
int |
getRows()
Get the number of rows |
boolean |
hasHorizontalSpanning()
Indicates whether there is spanning within this layout |
boolean |
hasVerticalSpanning()
Indicates whether there is spanning within this layout |
boolean |
isCellSpannedThroughHorizontally(int row,
int column)
Returns true if the cell at the given position is spanned through horizontally |
boolean |
isCellSpannedThroughVertically(int row,
int column)
Returns true if the cell at the given position is spanned through vertically |
void |
layoutContainer(Container parent)
Layout the given parent container children |
void |
removeLayoutComponent(Component comp)
Removes the component from the layout this operation is only useful if the layout maintains references to components within it |
static void |
setDefaultColumnWidth(int w)
Indicates the default (in percentage) for the column width, -1 indicates automatic sizing |
static void |
setDefaultRowHeight(int h)
Indicates the default (in percentage) for the row height, -1 indicates automatic sizing |
static void |
setMinimumSizePerColumn(int minimumSize)
Sets the minimum size for a column in the table, this is applicable for tables that are not scrollable on the X axis. |
java.lang.String |
toString()
|
Methods inherited from class com.sun.lwuit.layouts.Layout |
---|
hashCode, isOverlapSupported |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TableLayout(int rows, int columns)
rows
- rows of the tablecolumns
- columns of the tableMethod Detail |
---|
public int getRows()
public int getColumns()
public Component getComponentAt(int row, int column)
row
- the row of the componentcolumn
- the column of the component
public void layoutContainer(Container parent)
Layout
layoutContainer
in class Layout
parent
- the given parent containerpublic int getRowPosition(int row)
row
- the row in the table
public int getColumnPosition(int col)
col
- the column in the table
public Dimension getPreferredSize(Container parent)
Layout
getPreferredSize
in class Layout
parent
- the parent container
public int getNextRow()
public int getNextColumn()
public void addLayoutComponent(java.lang.Object value, Component comp, Container c)
Layout
addLayoutComponent
in class Layout
value
- optional meta data information, like alignment orientationcomp
- the added component to the layoutc
- the parent containerpublic int getCellHorizontalSpan(int row, int column)
row
- row in the tablecolumn
- column within the table
public int getCellVerticalSpan(int row, int column)
row
- row in the tablecolumn
- column within the table
public boolean isCellSpannedThroughVertically(int row, int column)
row
- cell rowcolumn
- cell column
public boolean isCellSpannedThroughHorizontally(int row, int column)
row
- cell rowcolumn
- cell column
public boolean hasVerticalSpanning()
public boolean hasHorizontalSpanning()
public void removeLayoutComponent(Component comp)
Layout
removeLayoutComponent
in class Layout
comp
- the removed component from layoutpublic java.lang.Object getComponentConstraint(Component comp)
Layout
getComponentConstraint
in class Layout
comp
- the component whose constraint should be returned
public TableLayout.Constraint createConstraint()
public TableLayout.Constraint createConstraint(int row, int column)
row
- the row for the table starting with 0column
- the column for the table starting with 0
public static void setMinimumSizePerColumn(int minimumSize)
minimumSize
- the minimum width of the columnpublic static int getMinimumSizePerColumn()
public static void setDefaultColumnWidth(int w)
w
- width in percentagepublic static int getDefaultColumnWidth()
public static void setDefaultRowHeight(int h)
h
- height in percentagepublic static int getDefaultRowHeight()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class Layout
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |