Spec-Zone .ru
спецификации, руководства, описания, API
|
public class ColumnConstraints extends ConstraintsBase
GridPane
. Если объект ColumnConstraints будет добавлен для столбца в gridpane, то gridpane будет использовать те ограничительные значения, вычисляя width столбца и расположение. Например, чтобы создать GridPane с 5 столбцами 100 широких пикселей:
GridPane gridpane = new GridPane();
for (int i = 0; i < 5; i++) {
ColumnConstraints column = new ColumnConstraints(100);
gridpane.getColumnConstraints().add(column);
}
Or, to create a GridPane where columns take 25%, 50%, 25% of its width:
GridPane gridpane = new GridPane();
ColumnConstraints col1 = new ColumnConstraints();
col1.setPercentWidth(25);
ColumnConstraints col2 = new ColumnConstraints();
col2.setPercentWidth(50);
ColumnConstraints col3 = new ColumnConstraints();
col3.setPercentWidth(25);
gridpane.getColumnConstraints().addAll(col1,col2,col3);
Note that adding an empty ColumnConstraints object has the effect of not setting any constraints, leaving the GridPane to compute the column's layout based solely on its content's size preferences and constraints.Type | Property and Description |
---|---|
BooleanProperty |
fillWidth
The horizontal fill policy for the column.
|
ObjectProperty<HPos> |
halignment
The horizontal alignment for the column.
|
ObjectProperty<Priority> |
hgrow
The horizontal grow priority for the column.
|
DoubleProperty |
maxWidth
The maximum width for the column.
|
DoubleProperty |
minWidth
The minimum width for the column.
|
DoubleProperty |
percentWidth
The width percentage of the column.
|
DoubleProperty |
prefWidth
The preferred width for the column.
|
CONSTRAIN_TO_PREF
Constructor and Description |
---|
ColumnConstraints()
Create a column constraint object with no properties set.
|
ColumnConstraints(double width)
Creates a column constraint object with a fixed width.
|
ColumnConstraints(double minWidth, double prefWidth, double maxWidth)
Creates a column constraint object with a fixed size range.
|
ColumnConstraints(double minWidth, double prefWidth, double maxWidth, Priority hgrow, HPos halignment, boolean fillWidth)
Creates a column constraint object with a fixed size range, horizontal grow priority, horizonal alignment, and horizontal fill behavior.
|
Modifier and Type | Method and Description |
---|---|
BooleanProperty |
fillWidthProperty()
The horizontal fill policy for the column.
|
HPos |
getHalignment()
The horizontal alignment for the column.
|
Приоритет |
getHgrow()
The horizontal grow priority for the column.
|
double |
getMaxWidth()
The maximum width for the column.
|
double |
getMinWidth()
The minimum width for the column.
|
double |
getPercentWidth()
The width percentage of the column.
|
double |
getPrefWidth()
The preferred width for the column.
|
ObjectProperty<HPos> |
halignmentProperty()
The horizontal alignment for the column.
|
ObjectProperty<Priority> |
hgrowProperty()
The horizontal grow priority for the column.
|
boolean |
isFillWidth()
The horizontal fill policy for the column.
|
DoubleProperty |
maxWidthProperty()
The maximum width for the column.
|
DoubleProperty |
minWidthProperty()
The minimum width for the column.
|
DoubleProperty |
percentWidthProperty()
The width percentage of the column.
|
DoubleProperty |
prefWidthProperty()
The preferred width for the column.
|
void |
setFillWidth(boolean value)
The horizontal fill policy for the column.
|
void |
setHalignment(HPos value)
The horizontal alignment for the column.
|
void |
setHgrow(Priority value)
The horizontal grow priority for the column.
|
void |
setMaxWidth(double value)
The maximum width for the column.
|
void |
setMinWidth(double value)
The minimum width for the column.
|
void |
setPercentWidth(double value)
The width percentage of the column.
|
void |
setPrefWidth(double value)
The preferred width for the column.
|
java.lang.String |
toString()
Returns a string representation of this
ColumnConstraints object. |
requestLayout
The default value is USE_COMPUTED_SIZE, which means the minimum width will be computed to be the largest minimum width of the column's content.
getMinWidth()
, setMinWidth(double)
The default value is USE_COMPUTED_SIZE, which means the preferred width will be computed to be the largest preferred width of the column's content.
getPrefWidth()
, setPrefWidth(double)
The default value is USE_COMPUTED_SIZE, which means the maximum width will be computed to be the smallest maximum width of the column's content.
getMaxWidth()
, setMaxWidth(double)
getPercentWidth()
, setPercentWidth(double)
This default value is null, which means that the column's grow priority will be derived from largest grow priority set on a content node.
getHgrow()
, setHgrow(Priority)
The default value is null, which means the column alignment will fall back to the default halignment set on the gridpane.
getHalignment()
, setHalignment(HPos)
The default value is true.
isFillWidth()
, setFillWidth(boolean)
public ColumnConstraints()
public ColumnConstraints(double width)
width
- the width of the columnpublic ColumnConstraints(double minWidth, double prefWidth, double maxWidth)
public final void setMinWidth(double value)
The default value is USE_COMPUTED_SIZE, which means the minimum width will be computed to be the largest minimum width of the column's content.
public final double getMinWidth()
The default value is USE_COMPUTED_SIZE, which means the minimum width will be computed to be the largest minimum width of the column's content.
public final DoubleProperty minWidthProperty()
The default value is USE_COMPUTED_SIZE, which means the minimum width will be computed to be the largest minimum width of the column's content.
getMinWidth()
, setMinWidth(double)
public final void setPrefWidth(double value)
The default value is USE_COMPUTED_SIZE, which means the preferred width will be computed to be the largest preferred width of the column's content.
public final double getPrefWidth()
The default value is USE_COMPUTED_SIZE, which means the preferred width will be computed to be the largest preferred width of the column's content.
public final DoubleProperty prefWidthProperty()
The default value is USE_COMPUTED_SIZE, which means the preferred width will be computed to be the largest preferred width of the column's content.
getPrefWidth()
, setPrefWidth(double)
public final void setMaxWidth(double value)
The default value is USE_COMPUTED_SIZE, which means the maximum width will be computed to be the smallest maximum width of the column's content.
public final double getMaxWidth()
The default value is USE_COMPUTED_SIZE, which means the maximum width will be computed to be the smallest maximum width of the column's content.
public final DoubleProperty maxWidthProperty()
The default value is USE_COMPUTED_SIZE, which means the maximum width will be computed to be the smallest maximum width of the column's content.
getMaxWidth()
, setMaxWidth(double)
public final void setPercentWidth(double value)
public final double getPercentWidth()
public final DoubleProperty percentWidthProperty()
getPercentWidth()
, setPercentWidth(double)
public final void setHgrow(Priority value)
This default value is null, which means that the column's grow priority will be derived from largest grow priority set on a content node.
public final Priority getHgrow()
This default value is null, which means that the column's grow priority will be derived from largest grow priority set on a content node.
public final ObjectProperty<Priority> hgrowProperty()
This default value is null, which means that the column's grow priority will be derived from largest grow priority set on a content node.
getHgrow()
, setHgrow(Priority)
public final void setHalignment(HPos value)
The default value is null, which means the column alignment will fall back to the default halignment set on the gridpane.
public final HPos getHalignment()
The default value is null, which means the column alignment will fall back to the default halignment set on the gridpane.
public final ObjectProperty<HPos> halignmentProperty()
The default value is null, which means the column alignment will fall back to the default halignment set on the gridpane.
getHalignment()
, setHalignment(HPos)
public final void setFillWidth(boolean value)
The default value is true.
public final boolean isFillWidth()
The default value is true.
public final BooleanProperty fillWidthProperty()
The default value is true.
isFillWidth()
, setFillWidth(boolean)
public java.lang.String toString()
ColumnConstraints
object.toString
in class java.lang.Object
ColumnConstraints
object.Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. Use is subject to