/** * Constructs a FormLayout using the given column and row specifications. * * @param colSpecs an array of column specifications. * @param rowSpecs an array of row specifications. * @throws NullPointerException if colSpecs or rowSpecs is {@code null} */ public FormLayout(ColumnSpec[] colSpecs, RowSpec[] rowSpecs) { if (colSpecs == null) throw new NullPointerException("The column specifications must not be null."); if (rowSpecs == null) throw new NullPointerException("The row specifications must not be null."); this.colSpecs = new ArrayList(Arrays.asList(colSpecs)); this.rowSpecs = new ArrayList(Arrays.asList(rowSpecs)); colGroupIndices = new int[][]{}; rowGroupIndices = new int[][]{}; int initialCapacity = colSpecs.length * rowSpecs.length / 4; constraintMap = new HashMap(initialCapacity); componentSizeCache = new ComponentSizeCache(initialCapacity); minimumWidthMeasure = new MinimumWidthMeasure(componentSizeCache); minimumHeightMeasure = new MinimumHeightMeasure(componentSizeCache); preferredWidthMeasure = new PreferredWidthMeasure(componentSizeCache); preferredHeightMeasure = new PreferredHeightMeasure(componentSizeCache); }
/** * Constructs an instance of <code>FormLayout</code> using the given * column and row specifications. * * @param colSpecs * an array of column specifications. * @param rowSpecs * an array of row specifications. * @throws NullPointerException * if colSpecs or rowSpecs is null */ public FormLayout(ColumnSpec[] colSpecs, RowSpec[] rowSpecs) { if (colSpecs == null) throw new NullPointerException("The column specifications must not be null."); if (rowSpecs == null) throw new NullPointerException("The row specifications must not be null."); this.colSpecs = new ArrayList(Arrays.asList(colSpecs)); this.rowSpecs = new ArrayList(Arrays.asList(rowSpecs)); colGroupIndices = new int[][] {}; rowGroupIndices = new int[][] {}; int initialCapacity = colSpecs.length * rowSpecs.length / 4; constraintMap = new HashMap(initialCapacity); componentSizeCache = new ComponentSizeCache(initialCapacity); minimumWidthMeasure = new MinimumWidthMeasure(componentSizeCache); minimumHeightMeasure = new MinimumHeightMeasure(componentSizeCache); preferredWidthMeasure = new PreferredWidthMeasure(componentSizeCache); preferredHeightMeasure = new PreferredHeightMeasure(componentSizeCache); }
/** * Constructs a FormLayout using the given column and row specifications. * * @param colSpecs an array of column specifications. * @param rowSpecs an array of row specifications. * @throws NullPointerException if {@code colSpecs} or {@code rowSpecs} * is {@code null} */ public FormLayout(ColumnSpec[] colSpecs, RowSpec[] rowSpecs) { checkNotNull(colSpecs, "The column specifications must not be null."); checkNotNull(rowSpecs, "The row specifications must not be null."); this.colSpecs = new ArrayList<ColumnSpec>(Arrays.asList(colSpecs)); this.rowSpecs = new ArrayList<RowSpec>(Arrays.asList(rowSpecs)); colGroupIndices = new int[][]{}; rowGroupIndices = new int[][]{}; int initialCapacity = colSpecs.length * rowSpecs.length / 4; constraintMap = new HashMap<Component, CellConstraints>(initialCapacity); componentSizeCache = new ComponentSizeCache(initialCapacity); minimumWidthMeasure = new MinimumWidthMeasure(componentSizeCache); minimumHeightMeasure = new MinimumHeightMeasure(componentSizeCache); preferredWidthMeasure = new PreferredWidthMeasure(componentSizeCache); preferredHeightMeasure = new PreferredHeightMeasure(componentSizeCache); }