Package groovy.swing.impl
Class TableLayoutCell
java.lang.Object
groovy.swing.impl.TableLayoutCell
Represents a cell in a table layout.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTableLayoutCell(TableLayoutRow parent) Creates a table cell associated with the supplied row. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(Component component) Adds the component rendered by this table cell and registers the cell with its parent row.protected GridBagConstraintsCreates the grid bag constraints that represent this cell in the table layout.protected intintReturns the number of columns spanned by this cell.Returns the component currently rendered by this cell.intReturns the number of rows spanned by this cell.booleanReturns the colfill.booleanReturns the rowfill.voidSets the horizontal alignment to a case insensitive value of {LEFT, CENTER, RIGHT}voidsetColfill(boolean colfill) Sets whether or not this column should allow its component to stretch to fill the space availablevoidsetColspan(int colspan) Sets the number of columns that this cell should span.voidsetRowfill(boolean rowfill) Sets whether or not this row should allow its component to stretch to fill the space availablevoidsetRowspan(int rowspan) Sets the number of rows that this cell should span.voidSets the vertical alignment to a case insensitive value of {TOP, MIDDLE, BOTTOM}
-
Field Details
-
LOG
Logger used to report invalid cell usage.
-
-
Constructor Details
-
TableLayoutCell
Creates a table cell associated with the supplied row.- Parameters:
parent- the owning row
-
-
Method Details
-
getColspan
public int getColspan()Returns the number of columns spanned by this cell.- Returns:
- the column span
-
getRowspan
public int getRowspan()Returns the number of rows spanned by this cell.- Returns:
- the row span
-
addComponent
Adds the component rendered by this table cell and registers the cell with its parent row.- Parameters:
component- the component to render in the cell
-
getComponent
Returns the component currently rendered by this cell.- Returns:
- the cell component, or
null
-
setAlign
Sets the horizontal alignment to a case insensitive value of {LEFT, CENTER, RIGHT}- Parameters:
align- one of 'left', 'center', or 'right'
-
setValign
Sets the vertical alignment to a case insensitive value of {TOP, MIDDLE, BOTTOM}- Parameters:
valign- one of 'top', 'middle', 'bottom'
-
setColspan
public void setColspan(int colspan) Sets the number of columns that this cell should span. The default value is 1- Parameters:
colspan- The default is 1
-
setRowspan
public void setRowspan(int rowspan) Sets the number of rows that this cell should span. The default value is 1- Parameters:
rowspan- The default is 1
-
isColfill
public boolean isColfill()Returns the colfill.- Returns:
- boolean
-
isRowfill
public boolean isRowfill()Returns the rowfill.- Returns:
- boolean
-
setColfill
public void setColfill(boolean colfill) Sets whether or not this column should allow its component to stretch to fill the space available- Parameters:
colfill- The default is false
-
setRowfill
public void setRowfill(boolean rowfill) Sets whether or not this row should allow its component to stretch to fill the space available- Parameters:
rowfill- The default is false
-
getConstraints
- Returns:
- the constraints of this cell
-
createConstraints
Creates the grid bag constraints that represent this cell in the table layout.- Returns:
- the constraints for this cell
-
getAnchor
protected int getAnchor()- Returns:
- the GridBagConstraints enumeration for anchor
-