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 .