/** Sets the horizontal gap before the component. * <p> * Note! This is currently same as gapLeft(). 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 gapBefore(String boundsSize) { hor.setGapBefore(ConstraintParser.parseBoundSize(boundsSize, true, true)); return this; }
/** Sets the gap above 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 gapTop(String boundsSize) { ver.setGapBefore(ConstraintParser.parseBoundSize(boundsSize, true, false)); return this; }
/** Sets the gap to the left 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 gapLeft(String boundsSize) { hor.setGapBefore(ConstraintParser.parseBoundSize(boundsSize, true, true)); 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.setGapBefore(gapBefore); dimConstraint.setGapAfter(gapAfter);
cc.getVertical().setGapBefore(gaps[0]); if (gaps[1] != null) cc.getHorizontal().setGapBefore(gaps[1]); if (gaps[2] != null) cc.getVertical().setGapAfter(gaps[2]);