public class PercentLayout extends PercentLayoutBase implements Serializable
The concrete percent layout implementation.
This class implements a basic percent layout as it is described in the documentation of the base class: a table-like layout with a set of properties for each column and row. Please refer to this documentation for a more complete description of all supported features.
Heart of this class is the implementation of the initCells()
method. This implementation expects that all components added to the layout
have been associated with valid constraints of type PercentData
. It
will then initialize all cells of the layout correctly.
Constructor and Description |
---|
PercentLayout(Collection<? extends CellConstraints> colConstr,
Collection<? extends CellConstraints> rowConstr)
Creates a new instance of
PercentLayout and initializes it
from the specified collections with CellConstraints objects. |
PercentLayout(int cols,
int rows)
Creates a new instance of
PercentLayout and sets the
layout's dimensions. |
PercentLayout(String colConstr,
String rowConstr)
Creates a new instance of
PercentLayout and initializes it
from the given string with specifications for the column and row
constraints. |
Modifier and Type | Method and Description |
---|---|
protected void |
initCells(PercentLayoutPlatformAdapter adapter)
Performs initialization of this layout.
|
addColumnGroup, addRowGroup, alignComponent, applyCellGroups, applyWeightFactors, applyWeightFactors, calcCellPositions, calcCellSize, calcCellSizes, calcCellSizesWithGroups, calcComponentSize, calcComponentSizes, calcMinimumLayoutSize, calcPreferredLayoutSize, calcSizes, calcTotalWeight, checkConstraints, clearCells, clearCells, constraintsFor, fetchPlatformAdapter, flushCache, getAllColumnConstraints, getAllRowConstraints, getColumnConstraints, getColumnCount, getColumnGroups, getComponent, getConstraintsBuilder, getInternalAllColumnConstraints, getInternalAllRowConstraints, getMinimumComponentSize, getOrientationValue, getPercentData, getPlatformAdapter, getPreferredComponentSize, getRowConstraints, getRowCount, getRowGroups, getSizeHandler, getTotalWeightX, getTotalWeightY, handleMultiSpans, initCell, initDimensions, initFromCollections, isCanShrink, performLayout, performLayout, removeComponent, setCanShrink, setColumnConstraints, setComponentBounds, setPlatformAdapter, setRowConstraints
public PercentLayout(int cols, int rows)
PercentLayout
and sets the
layout's dimensions. The constraints for the cells are set to default
values.cols
- the number of columnsrows
- the number of rowspublic PercentLayout(Collection<? extends CellConstraints> colConstr, Collection<? extends CellConstraints> rowConstr)
PercentLayout
and initializes it
from the specified collections with CellConstraints
objects.colConstr
- a collection with column constraintsrowConstr
- a collection with row constraintspublic PercentLayout(String colConstr, String rowConstr)
PercentLayout
and initializes it
from the given string with specifications for the column and row
constraints. These strings must contain valid specifications of cell
constraints as defined in the documentation of CellConstraints
.
As separators between two cell definitions the following characters can
be used: " ,;".colConstr
- a string defining column constraintsrowConstr
- a string defining row constraintsprotected void initCells(PercentLayoutPlatformAdapter adapter)
initCells
in class PercentLayoutBase
adapter
- the platform adapterCopyright © 2016 The JGUIraffe Team. All rights reserved.