/** Sets the horizontal gap after the component. * <p> * Note! This is currently same as gapRight(). This might change in 4.x. * @param boundsSize The size of the gap expressed as a <code>BoundSize</code>. E.g. "50:100px:200mm" or "100px!". * @return <code>this</code> so it is possible to chain calls. E.g. <code>new LayoutConstraint().noGrid().gap().fill()</code>. * @since 3.7.2 */ public final CC gapAfter(String boundsSize) { hor.setGapAfter(ConstraintParser.parseBoundSize(boundsSize, true, true)); return this; }
/** Sets the gap below the component. * @param boundsSize The size of the gap expressed as a <code>BoundSize</code>. E.g. "50:100px:200mm" or "100px!". * @return <code>this</code> so it is possible to chain calls. E.g. <code>new LayoutConstraint().noGrid().gap().fill()</code>. * @since 3.7.2 */ public final CC gapBottom(String boundsSize) { ver.setGapAfter(ConstraintParser.parseBoundSize(boundsSize, true, false)); return this; }
/** Sets the gap to the right of the component. * @param boundsSize The size of the gap expressed as a <code>BoundSize</code>. E.g. "50:100px:200mm" or "100px!". * @return <code>this</code> so it is possible to chain calls. E.g. <code>new LayoutConstraint().noGrid().gap().fill()</code>. * @since 3.7.2 */ public final CC gapRight(String boundsSize) { hor.setGapAfter(ConstraintParser.parseBoundSize(boundsSize, true, true)); return this; }
/** Specifies the indicated rows'/columns' gap size to <code>size</code>. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param size minimum and/or preferred and/or maximum size of the gap between this and the next row/column. * The string will be interpreted as a <b>BoundSize</b>. For more info on how <b>BoundSize</b> is formatted see the documentation. * @param indexes The index(es) (0-based) of the columns/rows that should be affected by this constraint. * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. */ public final AC gap(String size, int... indexes) { BoundSize bsa = size != null ? ConstraintParser.parseBoundSize(size, true, true) : null; for (int i = indexes.length - 1; i >= 0; i--) { int ix = indexes[i]; makeSize(ix + 1); if (bsa != null) cList.get(ix).setGapAfter(bsa); } return this; }
/** The vertical gap before (normally above) and/or after (normally below) the component. The gap is towards cell bounds and/or other component bounds. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param before The size of the gap expressed as a <code>BoundSize</code>. E.g. "50:100px:200mm" or "100px!". * @param after The size of the gap expressed as a <code>BoundSize</code>. E.g. "50:100px:200mm" or "100px!". * @return <code>this</code> so it is possible to chain calls. E.g. <code>new ComponentConstraint().noGrid().gap().fill()</code>. */ public final CC gapY(String before, String after) { if (before != null) ver.setGapBefore(ConstraintParser.parseBoundSize(before, true, false)); if (after != null) ver.setGapAfter(ConstraintParser.parseBoundSize(after, true, false)); return this; }
/** The horizontal gap before and/or after the component. The gap is towards cell bounds and/or other component bounds. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param before The size of the gap expressed as a <code>BoundSize</code>. E.g. "50:100px:200mm" or "100px!". * @param after The size of the gap expressed as a <code>BoundSize</code>. E.g. "50:100px:200mm" or "100px!". * @return <code>this</code> so it is possible to chain calls. E.g. <code>new ComponentConstraint().noGrid().gap().fill()</code>. */ public final CC gapX(String before, String after) { if (before != null) hor.setGapBefore(ConstraintParser.parseBoundSize(before, true, true)); if (after != null) hor.setGapAfter(ConstraintParser.parseBoundSize(after, true, true)); return this; }
dimConstraint.setGapAfter(gapAfter);
cc.getHorizontal().setGapBefore(gaps[1]); if (gaps[2] != null) cc.getVertical().setGapAfter(gaps[2]); if (gaps[3] != null) cc.getHorizontal().setGapAfter(gaps[3]); continue;