/** * Sets the horizontal alignment. * * @param alignment the new horizontal alignment */ public final void setHAlignment(CellConstraints.Alignment alignment) { cellConstraints().hAlign = alignment; }
/** * Sets the vertical alignment. * * @param alignment the new vertical alignment */ public final void setVAlignment(CellConstraints.Alignment alignment) { cellConstraints().vAlign = alignment; }
/** * Increases the row by the specified rows. * * @param rows number of rows to move */ public final void nextRow(int rows) { cellConstraints().gridY += rows; }
/** * Moves to the next column. * * @param columns number of columns to move */ public final void nextColumn(int columns) { cellConstraints().gridX += columns * getColumnIncrementSign(); }
/** * 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; }
/** * 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); }
/** * 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); }
/** * 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); }