/** 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 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 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; }
/** The size for the component as a min and/or preferred and/or maximum size. The value will override any value that is set on * the component itself. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param size The size 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 height(String size) { ver.setSize(ConstraintParser.parseBoundSize(size, false, false)); return this; }
/** The width for the container as a min and/or preferred and/or maximum width. The value will override any value that is set on * the container itself. * <p> * For a more thorough explanation of what this constraint does see the white paper or Cheat Sheet at www.migcontainers.com. * @param width The width 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>. */ public final LC width(String width) { setWidth(ConstraintParser.parseBoundSize(width, false, true)); return this; }
/** The size for the component as a min and/or preferred and/or maximum size. The value will override any value that is set on * the component itself. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param size The size 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 width(String size) { hor.setSize(ConstraintParser.parseBoundSize(size, false, 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; }
/** 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 height for the container as a min and/or preferred and/or maximum height. The value will override any value that is set on * the container itself. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcontainers.com. * @param height The height 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>. */ public final LC height(String height) { setHeight(ConstraintParser.parseBoundSize(height, false, false)); return this; }
/** Same functionality as <code>setGridGapY(ConstraintParser.parseBoundSize(boundsSize, true, false))</code> only this method * returns <code>this</code> for chaining multiple calls. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param boundsSize The <code>BoundSize</code> of the gap. This is a minimum and/or preferred and/or maximum size. E.g. * <code>"50:100:200"</code> or <code>"100px"</code>. * @return <code>this</code> so it is possible to chain calls. E.g. <code>new LayoutConstraint().noGrid().gap().fill()</code>. * @see #setGridGapY(BoundSize) */ public final LC gridGapY(String boundsSize) { setGridGapY(ConstraintParser.parseBoundSize(boundsSize, true, false)); return this; }
/** Same functionality as <code>setGridGapX(ConstraintParser.parseBoundSize(boundsSize, true, true))</code> only this method * returns <code>this</code> for chaining multiple calls. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param boundsSize The <code>BoundSize</code> of the gap. This is a minimum and/or preferred and/or maximum size. E.g. * <code>"50:100:200"</code> or <code>"100px"</code>. * @return <code>this</code> so it is possible to chain calls. E.g. <code>new LayoutConstraint().noGrid().gap().fill()</code>. * @see #setGridGapX(BoundSize) */ public final LC gridGapX(String boundsSize) { setGridGapX(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; }
/** Sets the pack width and height. * <p> * Same functionality as {@link #setPackHeight(BoundSize)} and {@link #setPackWidth(net.miginfocom.layout.BoundSize)} * only this method returns <code>this</code> for chaining multiple calls. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param width The pack width. May be <code>null</code>. * @param height The pack height. May be <code>null</code>. * @return <code>this</code> so it is possible to chain calls. E.g. <code>new LayoutConstraint().noGrid().gap().fill()</code>. * @since 3.5 */ public final LC pack(String width, String height) { setPackWidth(width != null ? ConstraintParser.parseBoundSize(width, false, true) : BoundSize.NULL_SIZE); setPackHeight(height != null ? ConstraintParser.parseBoundSize(height, false, false) : BoundSize.NULL_SIZE); 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; }
/** Specifies the indicated rows'/columns' min and/or preferred and/or max size. E.g. <code>"10px"</code> or <code>"50:100:200"</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 The minimum and/or preferred and/or maximum size of this row. 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 size(String size, int... indexes) { BoundSize bs = ConstraintParser.parseBoundSize(size, false, true); for (int i = indexes.length - 1; i >= 0; i--) { int ix = indexes[i]; makeSize(ix); cList.get(ix).setSize(bs); } 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; }
/** Same functionality as {@link #setWrapGapSize(BoundSize)} only this method returns <code>this</code> for chaining multiple calls. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param gapSize The gap size that will override the gap size in the row/column constraints if <code>!= null</code>. E.g. "5px" or "unrel". * If <code>null</code> or <code>""</code> the wrap size will be set to the default size and turned on. This is different compared to * {@link #setWrapGapSize(BoundSize)}. * @return <code>this</code> so it is possible to chain calls. E.g. <code>new ComponentConstraint().noGrid().gap().fill()</code>. * @see #setWrapGapSize(BoundSize) */ public final CC wrap(String gapSize) { BoundSize bs = ConstraintParser.parseBoundSize(gapSize, true, (flowX != null && flowX == false)); if (bs != null) { setWrapGapSize(bs); } else { setWrap(true); } return this; }
gaps[gIx] = parseBoundSize(parts.get(i), true, isCols);
/** Same functionality as {@link #setNewlineGapSize(BoundSize)} only this method returns <code>this</code> for chaining multiple calls. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param gapSize The gap size that will override the gap size in the row/column constraints if <code>!= null</code>. E.g. "5px" or "unrel". * If <code>null</code> or <code>""</code> the newline size will be set to the default size and turned on. This is different compared to * {@link #setNewlineGapSize(BoundSize)}. * @return <code>this</code> so it is possible to chain calls. E.g. <code>new ComponentConstraint().noGrid().gap().fill()</code>. * @see #setNewlineGapSize(BoundSize) */ public final CC newline(String gapSize) { BoundSize bs = ConstraintParser.parseBoundSize(gapSize, true, (flowX != null && flowX == false)); if (bs != null) { setNewlineGapSize(bs); } else { setNewline(true); } return this; }