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.CONSTRAIN_TO_PREF
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) |
String |
toString()
Returns a string representation of this
RowConstraints object. |
ObjectProperty<VPos> |
valignmentProperty() |
ObjectProperty<Priority> |
vgrowProperty() |
requestLayout
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()
Copyright © 2020. All rights reserved.