Package net.sf.jguiraffe.gui.layout
Class PercentLayout
- java.lang.Object
-
- net.sf.jguiraffe.gui.layout.PercentLayoutBase
-
- net.sf.jguiraffe.gui.layout.PercentLayout
-
- All Implemented Interfaces:
Serializable
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 typePercentData
. It will then initialize all cells of the layout correctly.- Version:
- $Id: PercentLayout.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PercentLayout(int cols, int rows)
Creates a new instance ofPercentLayout
and sets the layout's dimensions.PercentLayout(String colConstr, String rowConstr)
Creates a new instance ofPercentLayout
and initializes it from the given string with specifications for the column and row constraints.PercentLayout(Collection<? extends CellConstraints> colConstr, Collection<? extends CellConstraints> rowConstr)
Creates a new instance ofPercentLayout
and initializes it from the specified collections withCellConstraints
objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
initCells(PercentLayoutPlatformAdapter adapter)
Performs initialization of this layout.-
Methods inherited from class net.sf.jguiraffe.gui.layout.PercentLayoutBase
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
-
-
-
-
Constructor Detail
-
PercentLayout
public PercentLayout(int cols, int rows)
Creates a new instance ofPercentLayout
and sets the layout's dimensions. The constraints for the cells are set to default values.- Parameters:
cols
- the number of columnsrows
- the number of rows
-
PercentLayout
public PercentLayout(Collection<? extends CellConstraints> colConstr, Collection<? extends CellConstraints> rowConstr)
Creates a new instance ofPercentLayout
and initializes it from the specified collections withCellConstraints
objects.- Parameters:
colConstr
- a collection with column constraintsrowConstr
- a collection with row constraints
-
PercentLayout
public PercentLayout(String colConstr, String rowConstr)
Creates a new instance ofPercentLayout
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 ofCellConstraints
. As separators between two cell definitions the following characters can be used: " ,;".- Parameters:
colConstr
- a string defining column constraintsrowConstr
- a string defining row constraints
-
-
Method Detail
-
initCells
protected void initCells(PercentLayoutPlatformAdapter adapter)
Performs initialization of this layout. Information about the dimensions and the column and row constraints has already been set directly through the constructors and the appropriate setter methods. The task of this method is to initialize the cell array with information about the contained components. Those are fetched from the passed in platform adapter.- Specified by:
initCells
in classPercentLayoutBase
- Parameters:
adapter
- the platform adapter
-
-