public class RowConstraints extends ConstraintsBase
GridPane
.
If a RowConstraints object is added for a row in a gridpane, the gridpane
will use those constraint values when computing the row's height and layout.
For example, to create a GridPane with 10 rows 50 pixels tall:
GridPane gridpane = new GridPane();
for (int i = 0; i < 10; i++) {
RowConstraints row = new RowConstraints(50);
gridpane.getRowConstraints().add(row);
}
Or, to create a GridPane where rows take 25%, 50%, 25% of its width:
GridPane gridpane = new GridPane();
RowConstraints row1 = new RowConstraints();
row1.setPercentWidth(25);
RowConstraints row2 = new RowConstraints();
row2.setPercentWidth(50);
RowConstraints row3 = new RowConstraints();
row3.setPercentWidth(25);
gridpane.getRowConstraints().addAll(row1,row2,row3);
Note that adding an empty RowConstraints object has the effect of not setting
any constraints, leaving the GridPane to compute the row's layout based
solely on its content's size preferences and constraints.Modifier and Type | Field and Description |
---|---|
private BooleanProperty |
fillHeight
The vertical fill policy for the row.
|
private DoubleProperty |
maxHeight
The maximum height for the row.
|
private DoubleProperty |
minHeight
The minimum height for the row.
|
private DoubleProperty |
percentHeight
The height percentage of the row.
|
private DoubleProperty |
prefHeight
The preferred height for the row.
|
private ObjectProperty<VPos> |
valignment
The vertical alignment for the row.
|
private ObjectProperty<Priority> |
vgrow
The vertical grow priority for the row.
|
CONSTRAIN_TO_PREF, impl_nodes
Constructor and Description |
---|
RowConstraints()
Creates a row constraints object with no properties set.
|
RowConstraints(double height)
Creates a row constraint object with a fixed height.
|
RowConstraints(double minHeight,
double prefHeight,
double maxHeight)
Creates a row constraint object with a fixed size range.
|
RowConstraints(double minHeight,
double prefHeight,
double maxHeight,
Priority vgrow,
VPos valignment,
boolean fillHeight)
Creates a row constraint object with a fixed size range, vertical
grow priority, vertical alignment, and vertical fill behavior.
|
Modifier and Type | Method and Description |
---|---|
BooleanProperty |
fillHeightProperty() |
double |
getMaxHeight() |
double |
getMinHeight() |
double |
getPercentHeight() |
double |
getPrefHeight() |
VPos |
getValignment() |
Priority |
getVgrow() |
boolean |
isFillHeight() |
DoubleProperty |
maxHeightProperty() |
DoubleProperty |
minHeightProperty() |
DoubleProperty |
percentHeightProperty() |
DoubleProperty |
prefHeightProperty() |
void |
setFillHeight(boolean value) |
void |
setMaxHeight(double value) |
void |
setMinHeight(double value) |
void |
setPercentHeight(double value) |
void |
setPrefHeight(double value) |
void |
setValignment(VPos value) |
void |
setVgrow(Priority value) |
java.lang.String |
toString()
Returns a string representation of this
RowConstraints object. |
ObjectProperty<VPos> |
valignmentProperty() |
ObjectProperty<Priority> |
vgrowProperty() |
add, remove, requestLayout
private DoubleProperty minHeight
The default value is USE_COMPUTED_SIZE, which means the minimum height will be computed to be the largest minimum height of the row's content.
private DoubleProperty prefHeight
The default value is USE_COMPUTED_SIZE, which means the preferred height will be computed to be the largest preferred height of the row's content.
private DoubleProperty maxHeight
The default value is USE_COMPUTED_SIZE, which means the maximum height will be computed to be the smallest maximum height of the row's content.
private DoubleProperty percentHeight
private ObjectProperty<Priority> vgrow
This default value is null, which means that the row's grow priority will be derived from largest grow priority set on a content node.
private ObjectProperty<VPos> valignment
private BooleanProperty fillHeight
The default value is true.
public RowConstraints()
public RowConstraints(double height)
height
- the height of the rowpublic RowConstraints(double minHeight, double prefHeight, double maxHeight)
public final void setMinHeight(double value)
public final double getMinHeight()
public final DoubleProperty minHeightProperty()
public final void setPrefHeight(double value)
public final double getPrefHeight()
public final DoubleProperty prefHeightProperty()
public final void setMaxHeight(double value)
public final double getMaxHeight()
public final DoubleProperty maxHeightProperty()
public final void setPercentHeight(double value)
public final double getPercentHeight()
public final DoubleProperty percentHeightProperty()
public final void setVgrow(Priority value)
public final Priority getVgrow()
public final ObjectProperty<Priority> vgrowProperty()
public final void setValignment(VPos value)
public final VPos getValignment()
public final ObjectProperty<VPos> valignmentProperty()
public final void setFillHeight(boolean value)
public final boolean isFillHeight()
public final BooleanProperty fillHeightProperty()
public java.lang.String toString()
RowConstraints
object.toString
in class java.lang.Object
RowConstraints
object.