/** * Returns the leading column. Unlike the superclass this method * honors the column offset. * * @return the leading column */ protected int getLeadingColumn() { int column = super.getLeadingColumn(); return column + getLeadingColumnOffset() * getColumnIncrementSign(); }
public void layout(final DefaultFormBuilder builder) { for(int i = 0; i < n; i++){ builder.append(""); } }
/** * Builds and returns a left aligned button bar with the given buttons. * * @param buttons an array of buttons to add * @return a left aligned button bar with the given buttons */ public static JPanel buildLeftAlignedBar(JButton[] buttons) { ButtonBarBuilder builder = new ButtonBarBuilder(); builder.addGriddedButtons(buttons); builder.addGlue(); return builder.getPanel(); }
/** * Ensures that the cursor is in the grid. In case it's beyond the * form's right hand side, the cursor is moved to the leading column * of the next line. */ private void ensureCursorColumnInGrid() { if ( ( isLeftToRight() && (getColumn() > getColumnCount())) || (!isLeftToRight() && (getColumn() < 1))) { nextLine(); } }
/** * Appends an internationalized titled separator for * the given resource key that spans all columns. * * @param resourceKey the resource key for the separator title's text * @return the added titled separator */ public JComponent appendI15dSeparator(String resourceKey) { return appendSeparator(getI15dString(resourceKey)); }
/** * Creates and returns a <code>ButtonBarBuilder</code> with * initialized with a left to right button order. * * @return a button bar builder with button order set to left-to-right */ public static ButtonBarBuilder createLeftToRightBuilder() { ButtonBarBuilder builder = new ButtonBarBuilder(); builder.setLeftToRightButtonOrder(true); return builder; }
/** * Moves the cursor down several lines: increases the row by the * specified number of lines and sets the cursor to the leading column. * * @param lines number of rows to move */ public final void nextLine(int lines) { nextRow(lines); setColumn(getLeadingColumn()); }
/** * Sets the cursor's extent to the given column span and row span. * * @param columnSpan the new column span (grid width) * @param rowSpan the new row span (grid height) */ public final void setExtent(int columnSpan, int rowSpan) { setColumnSpan(columnSpan); setRowSpan(rowSpan); }
/** * Sets the horizontal and vertical alignment. * * @param hAlign the new horizontal alignment * @param vAlign the new vertical alignment */ public final void setAlignment(CellConstraints.Alignment hAlign, CellConstraints.Alignment vAlign) { setHAlignment(hAlign); setVAlignment(vAlign); }
/** * Adds the standard gap for unrelated components. */ public void addUnrelatedGap() { appendUnrelatedComponentsGapRow(); nextRow(); }
/** * Adds a glue that will be given the extra space, * if this box is larger than its preferred size. */ public void addGlue() { appendGlueColumn(); nextColumn(); }
/** * Creates and returns a ButtonBarBuilder2 with * a left to right button order. * * @return a button bar builder with button order set to left-to-right */ public static ButtonBarBuilder2 createLeftToRightBuilder() { ButtonBarBuilder2 builder = new ButtonBarBuilder2(); builder.setLeftToRightButtonOrder(true); return builder; }
/** * Adds the standard horizontal gap for related components. * * @see LayoutStyle#getRelatedComponentsPadX() */ public void addRelatedGap() { appendRelatedComponentsGapColumn(); nextColumn(); }
/** * Adds a glue that will be given the extra space, * if this button bar is larger than its preferred size. */ public void addGlue() { appendGlueColumn(); nextColumn(); }
/** * Appends a glue column. * * @see #appendRelatedComponentsGapColumn() * @see #appendUnrelatedComponentsGapColumn() */ protected final void appendGlueColumn() { appendColumn(FormFactory.GLUE_COLSPEC); }
/** * Moves to the next column. * * @param columns number of columns to move */ private void nextColumn(int columns) { currentCellConstraints.gridX += columns * getColumnIncrementSign(); }
/** * Appends a glue row. * * @see #appendRelatedComponentsGapRow() * @see #appendUnrelatedComponentsGapRow() */ protected final void appendGlueRow() { appendRow(FormFactory.GLUE_ROWSPEC); }
/** * Returns the sign (-1 or 1) used to increment the cursor's column * when moving to the next column. * * @return -1 for right-to-left, 1 for left-to-right */ private int getColumnIncrementSign() { return isLeftToRight() ? 1 : -1; }
/** * Returns the leading column. Unlike the superclass this method honors the * column offset. * * @return the leading column */ protected int getLeadingColumn() { int column = super.getLeadingColumn(); return column + getLeadingColumnOffset() * getColumnIncrementSign(); }
/** * Returns the leading column. Unlike the superclass this method * honors the column offset. * * @return the leading column */ @Override protected int getLeadingColumn() { int column = super.getLeadingColumn(); return column + getLeadingColumnOffset() * getColumnIncrementSign(); }