/** * Adds a component to the container using the default cell constraints. * Note that when building from left to right, this method won't adjust * the cell constraints if the column span is larger than 1. In this case * you should use {@link #add(Component, CellConstraints)} with a cell * constraints object created by {@link #createLeftAdjustedConstraints(int)}. * * @param component the component to add * @return the added component * * @see #add(Component, CellConstraints) * @see #createLeftAdjustedConstraints(int) */ public final Component add(Component component) { add(component, cellConstraints()); return component; }
/** * Appends a glue column. * * @see #appendLabelComponentsGapColumn() * @see #appendRelatedComponentsGapColumn() * @see #appendUnrelatedComponentsGapColumn() */ public final void appendGlueColumn() { appendColumn(FormFactory.GLUE_COLSPEC); }
/** * Appends a row that is the default gap for related components. * * @see #appendGlueRow() * @see #appendUnrelatedComponentsGapRow() * @see #appendParagraphGapRow() */ public final void appendRelatedComponentsGapRow() { appendRow(FormFactory.RELATED_GAP_ROWSPEC); }
/** * 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()); }
/** * Returns the index of the leading column.<p> * * Subclasses may override this method, for example, if the form * has a leading gap column that should not be filled with components. * * @return the leading column */ protected int getLeadingColumn() { return isLeftToRight() ? 1 : getColumnCount(); }
/** * Moves to the next column. * * @param columns number of columns to move */ public final void nextColumn(int columns) { cellConstraints().gridX += columns * getColumnIncrementSign(); }
/** * Creates and returns a <code>CellConstraints</code> object at the * current cursor position that uses the given column span and is adjusted * to the left. Useful when building from right to left. * * @param columnSpan * the column span to be used in the constraints * @return CellConstraints adjusted to the left hand side */ protected final CellConstraints createLeftAdjustedConstraints(int columnSpan) { int firstColumn = isLeftToRight() ? getColumn() : getColumn() + 1 - columnSpan; return new CellConstraints(firstColumn, getRow(), columnSpan, cellConstraints().gridHeight); }
/** * Returns the number of rows in the form. * * @return the number of rows */ public final int getRowCount() { return getLayout().getRowCount(); }
/** * Sets the horizontal alignment. * * @param alignment the new horizontal alignment */ public final void setHAlignment(CellConstraints.Alignment alignment) { cellConstraints().hAlign = alignment; }
/** * Adds a component to the container using the default cell constraints. * Note that when building from left to right, this method won't adjust * the cell constraints if the column span is larger than 1. In this case * you should use {@link #add(Component, CellConstraints)} with a cell * constraints object created by {@link #createLeftAdjustedConstraints(int)}. * * @param component the component to add * @return the added component * * @see #add(Component, CellConstraints) * @see #createLeftAdjustedConstraints(int) */ public final Component add(Component component) { add(component, currentCellConstraints); return component; }
/** * Moves to the next column. * * @param columns number of columns to move */ public final void nextColumn(int columns) { currentCellConstraints.gridX += columns * getColumnIncrementSign(); }
/** * Creates and returns a <code>CellConstraints</code> object at * the current cursor position that uses the given column span * and is adjusted to the left. Useful when building from right to left. * * @param columnSpan the column span to be used in the constraints * @return CellConstraints adjusted to the left hand side */ protected final CellConstraints createLeftAdjustedConstraints(int columnSpan) { int firstColumn = isLeftToRight() ? getColumn() : getColumn() + 1 - columnSpan; return new CellConstraints(firstColumn, getRow(), columnSpan, cellConstraints().gridHeight); }
/** * 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()); }
/** * Returns the index of the leading column. * <p> * * Subclasses may override this method, for example, if the form has a * leading gap column that should not be filled with components. * * @return the leading column */ protected int getLeadingColumn() { return isLeftToRight() ? 1 : getColumnCount(); }
/** * Returns the number of columns in the form. * * @return the number of columns */ public final int getColumnCount() { return getLayout().getColumnCount(); }
/** * Sets the vertical alignment. * * @param alignment the new vertical alignment */ public final void setVAlignment(CellConstraints.Alignment alignment) { cellConstraints().vAlign = alignment; }
/** * Adds a component to the container using the default cell constraints. * Note that when building from left to right, this method won't adjust the * cell constraints if the column span is larger than 1. In this case you * should use {@link #add(Component, CellConstraints)} with a cell * constraints object created by {@link #createLeftAdjustedConstraints(int)}. * * @param component * the component to add * @return the added component * * @see #add(Component, CellConstraints) * @see #createLeftAdjustedConstraints(int) */ public final Component add(Component component) { add(component, currentCellConstraints); return component; }
/** * Moves to the next column. * * @param columns * number of columns to move */ public final void nextColumn(int columns) { currentCellConstraints.gridX += columns * getColumnIncrementSign(); }
/** * Creates and returns a {@code CellConstraints} object at * the current cursor position that uses the given column span * and is adjusted to the left. Useful when building from right to left. * * @param columnSpan the column span to be used in the constraints * @return CellConstraints adjusted to the left hand side */ protected final CellConstraints createLeftAdjustedConstraints(int columnSpan) { int firstColumn = isLeftToRight() ? getColumn() : getColumn() + 1 - columnSpan; return new CellConstraints(firstColumn, getRow(), columnSpan, cellConstraints().gridHeight); }
/** * 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()); }