else if (span > 1)
else
    private void distributeSizeAndWeight (int size, double weight,                                          int start, int span,                                          int[] sizes, double[] weights)    {      if (span == 1)        {          sizes[start] = Math.max(sizes[start], size);          weights[start] = Math.max(weights[start], weight);        }      else if (span > 1)        {          int numOccupied = span;          int lastOccupied = -1;          for(int i = start; i < start + span; i++)            {              if (sizes[i] == 0.0)                numOccupied--;              else                {                  size -= sizes[i];                  lastOccupied = i;                }            }          // A component needs to occupy at least one row.          if(numOccupied == 0)            sizes[start + span - 1] = size;          else if (size > 0)            sizes[lastOccupied] += size;          calcCellWeights(weight, weights, start, span);        }    }