/** * Creates and returns a {@link RowSpec} that represents a gap with the * specified {@link ConstantSize}. * * @param gapHeight specifies the gap height * @return a RowSpec that describes a vertical gap with the given height * * @throws NullPointerException if {@code gapHeight} is {@code null} * * @since 1.2 */ public static RowSpec createGap(ConstantSize gapHeight) { return new RowSpec(RowSpec.DEFAULT, gapHeight, FormSpec.NO_GROW); }
/** * Creates and returns a {@link RowSpec} that represents a gap with the * specified {@link ConstantSize}. * * @param gapSize * a <code>ConstantSize</code> that specifies the gap * @return a <code>RowSpec</code> that describes a vertical gap */ public static RowSpec createGapRowSpec(ConstantSize gapSize) { return new RowSpec(RowSpec.TOP, gapSize, RowSpec.NO_GROW); }
/** * Creates and returns a {@link RowSpec} that represents a gap with the * specified {@link ConstantSize}. * * @param gapHeight specifies the gap height * @return a RowSpec that describes a vertical gap with the given height * * @throws NullPointerException if {@code gapHeight} is {@code null} * * @since 1.2 */ public static RowSpec createGap(ConstantSize gapHeight) { return new RowSpec(RowSpec.DEFAULT, gapHeight, RowSpec.NO_GROW); }
/** * Appends a row specification to the builder's layout that represents the * given string encoding. * * @param encodedRowSpec * the row specification to append in encoded form * * @see #appendRow(RowSpec) */ public final void appendRow(String encodedRowSpec) { appendRow(new RowSpec(encodedRowSpec)); }
/** * Adds a strut of a specified size. * * @param size a constant that describes the gap */ public void addStrut(ConstantSize size) { getLayout().appendRow(new RowSpec(RowSpec.TOP, size, RowSpec.NO_GROW)); nextRow(); }
/** * Set the size of the gaps between element cells. */ public void setGaps(String gapRow, String gapColumn) { this.setGapRow(gapRow != null ? new RowSpec(gapRow) : null); this.setGapColumn(gapColumn != null ? new ColumnSpec(gapColumn) : null); }
/** * Adds a strut of a specified size. * * @param size * a constant that describes the gap */ public void addStrut(ConstantSize size) { getLayout().appendRow(new RowSpec(RowSpec.TOP, size, RowSpec.NO_GROW)); nextRow(); }
/** * Adds a strut of a specified size. * * @param size a constant that describes the gap */ public void addStrut(ConstantSize size) { getLayout().appendRow(new RowSpec(RowSpec.TOP, size, FormSpec.NO_GROW)); nextRow(); }
/** * Set the size of the gaps between element cells. */ public void setGaps(String gapRow, String gapColumn) { this.setGapRow(gapRow != null ? new RowSpec(gapRow) : null); this.setGapColumn(gapColumn != null ? new ColumnSpec(gapColumn) : null); }
/** * Construct a format using the specifications and constraints specified. */ protected AbstractFormat(String rowSpecs, String columnSpecs, String gapRow, String gapColumn, CellConstraints[] cellConstraints) { this(RowSpec.decodeSpecs(rowSpecs), ColumnSpec.decodeSpecs(columnSpecs), new RowSpec(gapRow), new ColumnSpec(gapColumn), cellConstraints); }
/** * Set the size of the gaps between element cells. */ public void setGaps(String gapRow, String gapColumn) { this.setGapRow(gapRow != null ? new RowSpec(gapRow) : null); this.setGapColumn(gapColumn != null ? new ColumnSpec(gapColumn) : null); }
/** * Construct a format using the specifications and constraints specified. */ protected AbstractFormat(String rowSpecs, String columnSpecs, String gapRow, String gapColumn, CellConstraints[] cellConstraints) { this(RowSpec.decodeSpecs(rowSpecs), ColumnSpec.decodeSpecs(columnSpecs), new RowSpec(gapRow), new ColumnSpec(gapColumn), cellConstraints); }
/** * Construct a format using the specifications and constraints specified. */ protected AbstractFormat(String rowSpecs, String columnSpecs, String gapRow, String gapColumn, CellConstraints[] cellConstraints) { this(RowSpec.decodeSpecs(rowSpecs), ColumnSpec.decodeSpecs(columnSpecs), new RowSpec(gapRow), new ColumnSpec(gapColumn), cellConstraints); }
/** * Construct a format using the specifications and constraints specified. */ protected AbstractFormat(String rowSpecs, String columnSpecs, String gapRow, String gapColumn, String[] cellConstraints) { this(RowSpec.decodeSpecs(rowSpecs), ColumnSpec.decodeSpecs(columnSpecs), gapRow == null ? null : new RowSpec(gapRow), gapColumn == null ? null : new ColumnSpec(gapColumn), decode(cellConstraints)); }
/** * Construct a format using the specifications and constraints specified. */ protected AbstractFormat(String rowSpecs, String columnSpecs, String gapRow, String gapColumn, String[] cellConstraints) { this(RowSpec.decodeSpecs(rowSpecs), ColumnSpec.decodeSpecs(columnSpecs), gapRow == null ? null : new RowSpec(gapRow), gapColumn == null ? null : new ColumnSpec(gapColumn), decode(cellConstraints)); }
/** * Construct a format using the specifications and constraints specified. */ protected AbstractFormat(String rowSpecs, String columnSpecs, String gapRow, String gapColumn, String[] cellConstraints) { this(RowSpec.decodeSpecs(rowSpecs), ColumnSpec.decodeSpecs(columnSpecs), gapRow == null ? null : new RowSpec(gapRow), gapColumn == null ? null : new ColumnSpec(gapColumn), decode(cellConstraints)); }
FormLayout layout = new FormLayout("file:default:grow","fill:default:grow"); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); layout.appendRow(new RowSpec("pref")); buiulder.add(new Panel(), cc.xy(1,layout.getRowCount()));
public void actionPerformed(ActionEvent evt) { GridComponent gc = getCurrentEditor().getSelectedComponent(); if (gc != null) { GridView view = gc.getParentView(); if (view != null) { int row = gc.getRow(); // temporary dialog RowSpec oldspec = view.getFormLayout().getRowSpec(row); String newspec = javax.swing.JOptionPane.showInputDialog(m_frame, I18N.getLocalizedMessage("Row Spec:"), oldspec.toString()); if (newspec != null) { EditRowSpecCommand cmd = new EditRowSpecCommand(view.getParentForm(), row, new RowSpec(newspec), oldspec); CommandUtils.invoke(cmd, getCurrentEditor()); } } } } }
public void actionPerformed(ActionEvent evt) { GridComponent gc = getCurrentEditor().getSelectedComponent(); GridView view = gc.getParentView(); if (view != null) { int row = gc.getRow(); RowSpec oldspec = view.getRowSpec(row); RowSpec newspec = new RowSpec(getSeparatorSpec()); EditRowSpecCommand cmd = new EditRowSpecCommand(view.getParentForm(), row, newspec, oldspec); CommandUtils.invoke(cmd, getCurrentEditor()); } } }
public void actionPerformed(ActionEvent evt) { GridComponent gc = getCurrentEditor().getSelectedComponent(); if (gc != null) { GridView view = gc.getParentView(); if (view != null) { int row = gc.getRow(); RowSpec oldspec = view.getFormLayout().getRowSpec(row); RowSpec newspec = new RowSpec(oldspec.getDefaultAlignment(), Sizes.PREFERRED, oldspec.getResizeWeight()); EditRowSpecCommand cmd = new EditRowSpecCommand(view.getParentForm(), row, newspec, oldspec); CommandUtils.invoke(cmd, getCurrentEditor()); } } } }