/** * Creates and returns a {@link ColumnSpec} that represents a gap with the * specified {@link ConstantSize}. * * @param gapSize * a <code>ConstantSize</code> that specifies the gap * @return a <code>ColumnSpec</code> that describes a horizontal gap */ public static ColumnSpec createGapColumnSpec(ConstantSize gapSize) { return new ColumnSpec(ColumnSpec.LEFT, gapSize, ColumnSpec.NO_GROW); }
/** * Creates and returns a {@link ColumnSpec} that represents a gap with the * specified {@link ConstantSize}. * * @param gapWidth specifies the gap width * @return a ColumnSpec that describes a horizontal gap * * @throws NullPointerException if {@code gapWidth} is {@code null} * * @since 1.2 */ public static ColumnSpec createGap(ConstantSize gapWidth) { return new ColumnSpec(DEFAULT, gapWidth, ColumnSpec.NO_GROW); }
/** * Creates and returns a {@link ColumnSpec} that represents a gap with the * specified {@link ConstantSize}. * * @param gapWidth specifies the gap width * @return a ColumnSpec that describes a horizontal gap * * @throws NullPointerException if {@code gapWidth} is {@code null} * * @since 1.2 */ public static ColumnSpec createGap(ConstantSize gapWidth) { return new ColumnSpec(DEFAULT, gapWidth, FormSpec.NO_GROW); }
/** * Decodes an expanded, trimmed, lower case column spec. * Called by the public ColumnSpec factory methods. * Looks up and returns the ColumnSpec object from the cache - if any, * or constructs and returns a new ColumnSpec instance. * * @param expandedTrimmedLowerCaseSpec the encoded column specification * @return a ColumnSpec for the given encoded column spec */ static ColumnSpec decodeExpanded(String expandedTrimmedLowerCaseSpec) { ColumnSpec spec = (ColumnSpec) CACHE.get(expandedTrimmedLowerCaseSpec); if (spec == null) { spec = new ColumnSpec(expandedTrimmedLowerCaseSpec); CACHE.put(expandedTrimmedLowerCaseSpec, spec); } return spec; }
/** * Appends a column specification to the builder's layout that represents * the given string encoding. * * @param encodedColumnSpec * the column specification to append in encoded form * * @see #appendColumn(ColumnSpec) */ public final void appendColumn(String encodedColumnSpec) { appendColumn(new ColumnSpec(encodedColumnSpec)); }
/** * Adds a strut of a specified size. * * @param size * a <code>ConstantSize</code> that describes the gap's size */ public void addStrut(ConstantSize size) { getLayout().appendColumn(new ColumnSpec(ColumnSpec.LEFT, size, ColumnSpec.NO_GROW)); nextColumn(); }
/** * 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); }
/** * 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); }
/** * ctor */ public EditColumnSpecCommand(FormComponent form, int col, ColumnSpec colspec, ColumnSpec oldspec) { super(form); m_col = col; m_columnspec = colspec; /** * note that you must create a copy of the oldspec here because the * reference passed to the constructor is probabaly bound to the view * and will change */ m_oldspec = new ColumnSpec(oldspec.getDefaultAlignment(), oldspec.getSize(), oldspec.getResizeWeight()); }
/** * 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)); }
/** * Updates the columnspecrowspec for the given column * * @param colspec * the new columnspec * @param col * the column */ public void setColumnSpec(int col, ColumnSpec colspec) { FormLayout layout = getFormLayout(); ColumnSpec newspec = new ColumnSpec(colspec.getDefaultAlignment(), colspec.getSize(), colspec.getResizeWeight()); layout.setColumnSpec(col, newspec); m_form.revalidate(); fireGridEvent(new GridViewEvent(this, GridViewEvent.COLUMN_SPEC_CHANGED)); }
public void actionPerformed(ActionEvent evt) { GridComponent gc = getCurrentEditor().getSelectedComponent(); GridView view = gc.getParentView(); if (view != null) { int col = gc.getColumn(); ColumnSpec oldspec = view.getColumnSpec(col); ColumnSpec newspec = new ColumnSpec(getSeparatorSpec()); EditColumnSpecCommand cmd = new EditColumnSpecCommand(view.getParentForm(), col, newspec, oldspec); CommandUtils.invoke(cmd, getCurrentEditor()); } } }
public void actionPerformed(ActionEvent evt) { GridComponent gc = getCurrentEditor().getSelectedComponent(); if (gc != null) { GridView view = gc.getParentView(); int col = gc.getColumn(); ColumnSpec oldspec = view.getFormLayout().getColumnSpec(col); ColumnSpec newspec = new ColumnSpec(oldspec.getDefaultAlignment(), Sizes.PREFERRED, oldspec.getResizeWeight()); EditColumnSpecCommand cmd = new EditColumnSpecCommand(view.getParentForm(), col, 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 col = gc.getColumn(); ColumnSpec oldspec = view.getFormLayout().getColumnSpec(col); float resize_weight = m_growable ? 1.0f : 0.0f; ColumnSpec newspec = new ColumnSpec(oldspec.getDefaultAlignment(), oldspec.getSize(), resize_weight); EditColumnSpecCommand cmd = new EditColumnSpecCommand(view.getParentForm(), col, newspec, oldspec); CommandUtils.invoke(cmd, getCurrentEditor()); } } } }