private void calcGridSizes(int refWidth, int refHeight) { // Note, in these calls the grid can be invalidated and specs set to null. Therefore use local versions. FlowSizeSpec colSpecs = calcRowsOrColsSizes(true, refWidth); FlowSizeSpec rowSpecs = calcRowsOrColsSizes(false, refHeight); colFlowSpecs = colSpecs; rowFlowSpecs = rowSpecs; width = getMinPrefMaxSumSize(true, colSpecs.sizes); height = getMinPrefMaxSumSize(false, rowSpecs.sizes); if (linkTargetIDs == null) { resetLinkValues(false, true); } else { // This call makes some components flicker on SWT. They get their bounds changed twice since // the change might affect the absolute size adjustment below. There's no way around this that // I know of. layout(new int[]{0, 0, refWidth, refHeight}, null, null, false); resetLinkValues(false, false); } adjustSizeForAbsolute(true); adjustSizeForAbsolute(false); }