FormSpec formSpec = (FormSpec) formSpecs.get(i); sizes[i] = prefSizes[i]; if (formSpec.getSize() == Sizes.DEFAULT) { sizes[i] -= (int) Math.round((prefSizes[i] - minSizes[i]) * compressionFactor);
FormSpec formSpec = (FormSpec) formSpecs.get(i); sizes[i] = prefSizes[i]; if (formSpec.getSize().compressible()) { sizes[i] -= (int) Math.round((prefSizes[i] - minSizes[i])
FormSpec formSpec = (FormSpec) formSpecs.get(i); sizes[i] = prefSizes[i]; if (formSpec.getSize().compressible()) { sizes[i] -= (int) Math.round((prefSizes[i] - minSizes[i])
/** * Computes and returns the pixel size of the given component using the * given form specification, measures, and cell size. * * @param component the component to measure * @param formSpec the specification of the component's column/row * @param minMeasure the measure for the minimum size * @param prefMeasure the measure for the preferred size * @param cellSize the cell size * @return the component size as measured or a constant */ private static int componentSize(Component component, FormSpec formSpec, int cellSize, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure) { if (formSpec == null) { return prefMeasure.sizeOf(component); } else if (formSpec.getSize() == Sizes.MINIMUM) { return minMeasure.sizeOf(component); } else if (formSpec.getSize() == Sizes.PREFERRED) { return prefMeasure.sizeOf(component); } else { // default mode return Math.min(cellSize, prefMeasure.sizeOf(component)); } }
/** * Computes and returns the pixel size of the given component using the * given form specification, measures, and cell size. * * @param component the component to measure * @param formSpec the specification of the component's column/row * @param minMeasure the measure for the minimum size * @param prefMeasure the measure for the preferred size * @param cellSize the cell size * @return the component size as measured or a constant */ private int componentSize(Component component, FormSpec formSpec, int cellSize, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure) { if (formSpec == null) { return prefMeasure.sizeOf(component); } else if (formSpec.getSize() == Sizes.MINIMUM) { return minMeasure.sizeOf(component); } else if (formSpec.getSize() == Sizes.PREFERRED) { return prefMeasure.sizeOf(component); } else { // default mode return Math.min(cellSize, prefMeasure.sizeOf(component)); } }
/** * Computes and returns the pixel size of the given component using the * given form specification, measures, and cell size. * * @param component * the component to measure * @param formSpec * the specification of the component's column/row * @param minMeasure * the measure for the minimum size * @param prefMeasure * the measure for the preferred size * @param cellSize * the cell size * @return the component size as measured or a constant */ private int componentSize(Component component, FormSpec formSpec, int cellSize, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure) { if (formSpec == null) { return prefMeasure.sizeOf(component); } else if (formSpec.getSize() == Sizes.MINIMUM) { return minMeasure.sizeOf(component); } else if (formSpec.getSize() == Sizes.PREFERRED) { return prefMeasure.sizeOf(component); } else { // default mode return Math.min(cellSize, prefMeasure.sizeOf(component)); } }