code: private static int[] compressedSizes(List formSpecs,
              int totalSize, int totalMinSize, int totalPrefSize,
              int[] minSizes, int[] prefSizes) {
  
          // If we have less space than the total min size, answer the min sizes.
          if (totalSize < totalMinSize) {
              return minSizes;
          }
          // If we have more space than the total pref size, answer the pref sizes.
          if (totalSize >= totalPrefSize) {
              return prefSizes;
          }
  
          int count = formSpecs.size();
          int[] sizes = new int[count];
  
          double totalCompressionSpace = totalPrefSize - totalSize;
          double maxCompressionSpace = totalPrefSize - totalMinSize;
          double compressionFactor = totalCompressionSpace / maxCompressionSpace;
  
  //      System.out.println("Total compression space=" + totalCompressionSpace);
  //      System.out.println("Max compression space  =" + maxCompressionSpace);
  //      System.out.println("Compression factor     =" + compressionFactor);
          for (int i = 0; i < count; i++) {
              FormSpec formSpec = (FormSpec) formSpecs.get(i);
              sizes[i] = prefSizes[i];
              if (formSpec.getSize().compressible()) {
                  sizes[i] -= (int) Math.round((prefSizes[i] - minSizes[i])
                          * compressionFactor);
              }
          }
          return sizes;
      }
docs: Computes and returns the compressed sizes. Compresses space for columns and rows iff the
  available space is less than the total preferred size but more than the total minimum
  size.<p>
  
  Only columns and rows that are specified to be compressible will be affected. You can specify
  a column and row as compressible by giving it the component size <tt>default</tt>.
  
  @param formSpecs the column or row specs to use
  @param totalSize the total available size
  @param totalMinSize the sum of all minimum sizes
  @param totalPrefSize the sum of all preferred sizes
  @param minSizes an int array of column/row minimum sizes
  @param prefSizes an int array of column/row preferred sizes
  @return an int array of compressed column/row sizes