Class 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 type PercentData. 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 Detail

      • PercentLayout

        public PercentLayout​(int cols,
                             int rows)
        Creates a new instance of PercentLayout and sets the layout's dimensions. The constraints for the cells are set to default values.
        Parameters:
        cols - the number of columns
        rows - the number of rows
      • PercentLayout

        public 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.
        Parameters:
        colConstr - a collection with column constraints
        rowConstr - a collection with row constraints
      • PercentLayout

        public 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. 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: " ,;".
        Parameters:
        colConstr - a string defining column constraints
        rowConstr - 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 class PercentLayoutBase
        Parameters:
        adapter - the platform adapter