size += hGap * (entry.cr2[C] - entry.cr1[C]);
int cumlativeGap = hGap * (entry.cr2[C] - entry.cr1[C]);  switch (entryAlignment) { case RIGHT : offset += cumlativeGap; break;  case CENTER : offset += cumlativeGap >> 1; break;  case FULL : size += cumlativeGap; break; }
protected int [] calculateSizeAndOffset    (Entry entry, int preferredSize, boolean isColumn){    // Get references to cr properties    int crOffset[] = isColumn ? this.crOffset[C] : this.crOffset[R];    int entryAlignment = isColumn ? entry.alignment[C] : entry.alignment[R];    // Determine cell set size    int cellSetSize = isColumn ?        crOffset[entry.cr2[C] + 1] - crOffset[entry.cr1[C]] :        crOffset[entry.cr2[R] + 1] - crOffset[entry.cr1[R]];    // Determine the size of the component    int size;    if ((entryAlignment == FULL) || (cellSetSize < preferredSize))        size = cellSetSize;    else        size = preferredSize;    // Since the component orientation is adjusted for in the layoutContainer    // method, we can treat leading justification as left justification and    // trailing justification as right justification.    if (isColumn && (entryAlignment == LEADING))        entryAlignment = LEFT;    if (isColumn && (entryAlignment == TRAILING))        entryAlignment = RIGHT;        // Determine offset    int offset;    switch (entryAlignment)    {        case LEFT : // Align left/top side along left edge of cell            offset = crOffset[isColumn ? entry.cr1[C] : entry.cr1[R]];        break;        case RIGHT : // Align right/bottom side along right edge of cell            offset =                crOffset[(isColumn ? entry.cr2[C] : entry.cr2[R]) + 1] - size;        break;        case CENTER : // Center justify component            offset = crOffset[isColumn ? entry.cr1[C] : entry.cr1[R]] +                     ((cellSetSize - size) >> 1);        break;        case FULL : // Align left/top side along left/top edge of cell            offset = crOffset[isColumn ? entry.cr1[C] : entry.cr1[R]];        break;        default : // This is a never should happen case, but just in case            offset = 0;    }    // Compensate for gaps    if (isColumn)    {        offset += hGap * entry.cr1[C];        size += hGap * (entry.cr2[C] - entry.cr1[C]);    }    else    {        offset += vGap * entry.cr1[R];        size += vGap * (entry.cr2[R] - entry.cr1[R]);    }    // Package return values    int value[] = {offset, size};    return value;}