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 {
    return Math.min(cellSize,prefMeasure.sizeOf(component));
  }
}

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 { 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 .
