/** Specifies the current row/column's columns default alignment <b>for its components</b>. It does not affect the positioning * or size of the columns/row itself. For columns it is the horizontal alignment (e.g. "left") and for rows it is the vertical * alignment (e.g. "top"). * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param side The default side to align the components. E.g. "top" or "left", or "leading" or "trailing" or "bottom" or "right". * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. */ public final AC align(String side) { return align(side, curIx); }
/** Specifies that the current row/column's component should grow by default. It does not affect the size of the row/column. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. */ public final AC fill() { return fill(curIx); }
/** Specifies the gap size to <code>size</code> <b>AND</b> moves to the next column/row. * <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. * @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) { return gap(size, curIx++); }
return new AC(); // Short circuit for performance. AC ac = new AC(); ac.setConstaints(colSpecs);
DimConstraint[] dims = ac.getConstaints(); BoundSize defGap = isCols ? PlatformDefaults.getGridGapX() : PlatformDefaults.getGridGapY();
/** Specifies the gap size to be the default one <b>AND</b> moves to the next column/row. The method is called <code>.gap()</code> * rather the more natural <code>.next()</code> to indicate that it is very much related to the other <code>.gap(..)</code> methods. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. */ public final AC gap() { curIx++; makeSize(curIx); return this; }
this.callbackList = callbackList; int wrap = lc.getWrapAfter() != 0 ? lc.getWrapAfter() : (lc.isFlowX() ? colConstr : rowConstr).getConstaints().length; boolean useVisualPadding = lc.isVisualPadding(); final ArrayList<int[]> spannedRects = new ArrayList<int[]>(2); final DimConstraint[] specs = (lc.isFlowX() ? rowConstr : colConstr).getConstaints(); ensureIndexSizes(colConstr.getCount(), rowConstr.getCount());
/** Specifies the current row/column's grow weight within columns/rows with the <code>grow priority</code> 100f. * <p> * Same as <code>grow(100f)</code> * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. * @since 3.7.2 */ public final AC grow() { return grow(100f, curIx); }
/** Specifies the current row/column's grow priority. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param p The new grow priority. * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. */ public final AC growPrio(int p) { return growPrio(p, curIx); }
TreeSet<Integer> primIndexes = isRows ? rowIndexes : colIndexes; TreeSet<Integer> secIndexes = isRows ? colIndexes : rowIndexes; DimConstraint[] primDCs = (isRows ? rowConstr : colConstr).getConstaints();
/** Sets the total number of rows/columns to <code>size</code>. If the number of rows/columns is already more * than <code>size</code> nothing will happen. * @param size The total number of rows/columns * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. */ public final AC count(int size) { makeSize(size); return this; }
/** Specifies the current row/column's grow weight within columns/rows with the same <code>grow priority</code>. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param w The new grow weight. * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. */ public final AC grow(float w) { return grow(w, curIx); }
public SimpleCopyApplication() { setMiglayout(new LC().wrapAfter(1), new AC().align("center"), new AC()); final JTextField textField = newTextField("textToCopy"); JButton button = newButton("copyButton", "Copy text to label"); final JLabel label = newLabel("copiedText"); addActionToButton(button, new Runnable() { @Override public void run() { label.setText(textField.getText()); } }); add(textField); add(button); add(label); pack(); }
private void layoutInOneDim(int refSize, UnitValue align, boolean isRows, Float[] defaultPushWeights) DimConstraint[] primDCs = (isRows ? rowConstr : colConstr).getConstaints(); FlowSizeSpec fss = isRows ? rowFlowSpecs : colFlowSpecs; ArrayList<LinkedDimGroup>[] rowCols = isRows ? rowGroupLists : colGroupLists;
/** Sets the current row/column to <code>i</code>. If the current number of rows/columns is less than <code>i</code> a call * to {@link #count(int)} will set the size accordingly. * <p> * The next call to any of the constraint methods (e.g. {@link net.miginfocom.layout.AC#noGrid}) will be carried * out on this new row/column. * <p> * For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. * @param i The new current row/column. * @return <code>this</code> so it is possible to chain calls. E.g. <code>new AxisConstraint().noGrid().gap().fill()</code>. */ public final AC index(int i) { makeSize(i); curIx = i; return this; }