public void layoutContainer(Canvas canvas, int[] bounds) { for (ComponentWrapper wrapper : children) { if (wrapper instanceof MigLayout) { MigLayout layout = (MigLayout) wrapper; layout.layoutContainer(canvas, bounds); } else if (wrapper instanceof MigComponent) { MigComponent migComponent = (MigComponent) wrapper; migComponent.calculatePreferredSize(canvas, canvas.size()); } } checkCache(); if (grid.layout(bounds, lc.getAlignX(), lc.getAlignY(), debug, true)) { grid = null; checkCache(); grid.layout(bounds, lc.getAlignX(), lc.getAlignY(), debug, false); } }
@Override protected void layout(Composite parent, boolean flushCache) { if (flushCache) grid = null; checkCache(parent); Rectangle r = parent.getClientArea(); int[] b = new int[] {r.x, r.y, r.width, r.height}; final boolean layoutAgain = grid.layout(b, lc.getAlignX(), lc.getAlignY(), getDebug()); if (layoutAgain) { grid = null; checkCache(parent); grid.layout(b, lc.getAlignX(), lc.getAlignY(), getDebug()); } }
groupSize = LayoutUtil.sum(rowColSizes, bIx2, Math.min((group.span << 1) - 1, rowColSizes.length - bIx2 - 1)); group.layout(primDC, curPos, groupSize, group.span);
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); }
lGrid.layout(lBounds, getLayoutConstraints().getAlignX(), getLayoutConstraints().getAlignY(), debug);