public class GridPane extends Pane
子はグリッド内の任意の場所に、複数の行および列にまたがって配置できます。 子は行および列内で自由にオーバーラップでき、積上げ順序はグリッドペインの子リストの順序により定義されます(0番目のノードを背面、最後のノードを前面に配置)。
GridPaneでは、CSSを使用して背景およびボーダーのスタイルを設定できます。 詳細は、Regionスーパー・クラスを参照してください。
グリッド内の子の配置は、そのレイアウト制約によって定義されます。
| 制約 | Type | 説明 |
|---|---|---|
| columnIndex | 整数 | 子のレイアウト領域が始まる列。 |
| rowIndex | 整数 | 子のレイアウト領域が始まる行。 |
| columnSpan | 整数 | 子のレイアウト領域の水平方向の範囲内にある列数。 |
| rowSpan | 整数 | 子のレイアウト領域の垂直方向の範囲内にある行数。 |
行および列のインデックスが明示的に設定されていない場合は、子は最初の行および列に配置されます。 行および列の範囲が設定されていない場合は、デフォルトの1に設定されます。 子の配置制約は動的に変更でき、グリッドペインはそれに従って更新されます。
グリッドペインによってコンテンツに合せてグリッドが自動的に拡大または縮小されるため、行および列の合計数を前もって指定しておく必要はありません。
アプリケーションでGridPaneを使用するには、子に対するレイアウト制約を設定し、それらの子をグリッドペイン・インスタンスに追加する必要があります。 子に対する制約は、GridPaneクラスの静的なsetterメソッドを使用して設定されます。
GridPane gridpane = new GridPane();
// Set one constraint at a time...
// Places the button at the first row and second column
Button button = new Button();
GridPane.setRowIndex(button, 0);
GridPane.setColumnIndex(button, 1);
// or convenience methods set more than one constraint at once...
Label label = new Label();
GridPane.setConstraints(label, 2, 0); // column=2 row=0
// don't forget to add children to gridpane
gridpane.getChildren().addAll(button, label);
アプリケーションでは、制約の設定および子の追加ステップをまとめたコンビニエンス・メソッドを使用することもできます。
GridPane gridpane = new GridPane();
gridpane.add(new Button(), 1, 0); // column=1 row=0
gridpane.add(new Label(), 2, 0); // column=2 row=0
GridPane gridpane = new GridPane();
gridpane.getColumnConstraints().add(new ColumnConstraints(100)); // column 0 is 100 wide
gridpane.getColumnConstraints().add(new ColumnConstraints(200)); // column 1 is 200 wide
デフォルトでは、グリッドペインがその優先サイズより大きいサイズに変更されても、グリッドペインの行および列のサイズはそれらの優先サイズ(コンテンツから計算されたサイズまたは固定のサイズ)に変更されます。 アプリケーションで、余分なスペースがある場合に特定の行または列を拡大する必要がある場合は、RowConstraintsまたはColumnConstraintsオブジェクトに拡大優先度を設定できます。 たとえば:
GridPane gridpane = new GridPane();
ColumnConstraints column1 = new ColumnConstraints(100,100,Double.MAX_VALUE);
column1.setHgrow(Priority.ALWAYS);
ColumnConstraints column2 = new ColumnConstraints(100);
gridpane.getColumnConstraints().addAll(column1, column2); // first column gets any extra width
ノート: 複数の行または列にまたがるノードのサイズも、優先サイズに合せてサイズ設定されます。 影響を受ける行および列は、まず拡大優先度、次に最後の行という優先順位に従ってサイズ変更されます。 これは、行および列の制約によるものです。
GridPane gridpane = new GridPane();
ColumnConstraints column1 = new ColumnConstraints();
column1.setPercentWidth(50);
ColumnConstraints column2 = new ColumnConstraints();
column2.setPercentWidth(50);
gridpane.getColumnConstraints().addAll(column1, column2); // each get 50% of width
行および列に対してパーセント値を指定すると、その値が優先され、行および列の最小、優先、最大および拡大制約は無視されます。
widthPercent (またはheightPercent)の値の合計が100より大きい場合、それらの値は重みとして扱われることに注意してください。たとえば、3つの列それぞれにwidthPercentとして50が指定されると、各列にはグリッドペインの使用可能な幅の1/3 (50/(50+50+50))が割り当てられます。
| width | height | |
|---|---|---|
| 最小 | 左/右の枠+各列の最小幅の合計。 | 上/下の枠+各行の最小高の合計。 |
| 優先 | 左/右の枠+各列の優先幅の合計。 | 上/下の枠+各行の優先高の合計。 |
| 最大 | Double.MAX_VALUE | Double.MAX_VALUE |
グリッドペインの最大幅および最大高には制限がないため、親に割り当てられているスペースすべてを満たすために、親がその優先サイズより大きいサイズに変更される可能性があります。
GridPaneは、サイズ範囲を直接設定するためのプロパティを提供します。 これらのプロパティはデフォルトでセンチネル値USE_COMPUTED_SIZEに設定されますが、アプリケーションでは必要に応じてこれらを別の値に設定できます。
gridpane.setPrefSize(300, 300);
// never size the gridpane larger than its preferred size:
gridpane.setMaxSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);
アプリケーションでは、これらのプロパティの設定をUSE_COMPUTED_SIZEに戻すことで、計算された値を復元できます。
GridPaneはデフォルトではそのコンテンツをクリップしないため、子の最小サイズが原因でスペース内に子を収めることができない場合、子の境界がグリッドペイン自体の境界の外側まで拡大することがあります。
| 制約 | Type | 説明 |
|---|---|---|
| halignment | javafx.geometry.HPos | レイアウト領域内での子の水平方向の位置合せ。 |
| valignment | javafx.geometry.VPos | レイアウト領域内での子の垂直方向の位置合せ。 |
| hgrow | javafx.scene.layout.Priority | 子の水平方向の拡大優先度。 |
| vgrow | javafx.scene.layout.Priority | 子の垂直方向の拡大優先度。 |
| マージン | javafx.geometry.Insets | 子の外側のマージン領域。 |
デフォルトでは、子のレイアウト領域内での位置合せは、行および列に設定されている位置合せによって定義されます。 ある子に対して個別の位置合せ制約が設定されている場合、その位置合せはその子に対してのみ行および列の位置合せをオーバーライドします。 同じ行または列内にあるその他の子の位置合せには影響しません。
一方、拡大優先度は行または列全体に対してのみ適用できます。 そのため、ある1つの子に対して拡大優先度の制約が設定されている場合、その制約を使用して、その子を含む行および列のデフォルト拡大優先度が計算されます。 RowConstraintまたはColumnConstraintオブジェクトに対して直接拡大優先度が設定されている場合は、コンテンツから計算された値がその拡大優先度でオーバーライドされます。
| Type | プロパティと説明 |
|---|---|
ObjectProperty<Pos> |
alignment
グリッドペインの幅と高さの範囲内でのグリッドの位置合せ。
|
BooleanProperty |
gridLinesVisible
デバッグ専用。グリッドペインの行と列を表示するために線を表示するかどうかを制御します。
|
DoubleProperty |
hgap
列間の水平方向の間隔の幅。
|
DoubleProperty |
vgap
行の間の垂直方向の間隔の高さ。
|
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthneedsLayoutaccessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, visible| 修飾子と型 | フィールドと説明 |
|---|---|
static int |
REMAINING
子の範囲が残りの行および列すべてにわたる必要があることを示すために、子の行および列の範囲制約に設定できるセンチネル値。
|
USE_COMPUTED_SIZE, USE_PREF_SIZEBASELINE_OFFSET_SAME_AS_HEIGHT| コンストラクタと説明 |
|---|
GridPane()
hgap/vgap = 0およびTOP_LEFTの位置合せが指定されたGridPaneレイアウトを作成します。
|
| 修飾子と型 | メソッドと説明 |
|---|---|
void |
add(Node child, int columnIndex, int rowIndex)
グリッドペインの指定された列と行の位置に子を追加します。
|
void |
add(Node child, int columnIndex, int rowIndex, int colspan, int rowspan)
グリッドペインの指定された列と行の位置および範囲に子を追加します。
|
void |
addColumn(int columnIndex, Node... children)
グリッドペインの特定の列内に指定したノードを順番に配置するためのコンビニエンス・メソッド。
|
void |
addRow(int rowIndex, Node... children)
グリッドペインの特定の行内に指定したノードを順番に配置するためのコンビニエンス・メソッド。
|
ObjectProperty<Pos> |
alignmentProperty()
グリッドペインの幅と高さの範囲内でのグリッドの位置合せ。
|
static void |
clearConstraints(Node child)
子ノードからすべてのグリッドペイン制約を削除します。
|
protected double |
computeMinHeight(double width)
このリージョンの最小高を計算します。
|
protected double |
computeMinWidth(double height)
このリージョンの最小幅を計算します。
|
protected double |
computePrefHeight(double width)
指定された幅に対するこのリージョンの優先高を計算します。Regionのサブクラスでは、このメソッドをオーバーライドして、そのコンテンツおよびレイアウト手法に基づいて適切な値を返す必要があります。
|
protected double |
computePrefWidth(double height)
指定された高さに対するこのリージョンの優先幅を計算します。
|
Pos |
getAlignment()
プロパティalignmentの値を取得します。
|
static List<CssMetaData<? extends Styleable,?>> |
getClassCssMetaData() |
ObservableList<ColumnConstraints> |
getColumnConstraints()
列制約のリストを返します。
|
static Integer |
getColumnIndex(Node child)
子の列インデックス制約を返します(設定されている場合)。
|
static Integer |
getColumnSpan(Node child)
子の列範囲制約を返します(設定されている場合)。
|
Orientation |
getContentBias()
レイアウト用にノードのサイズ変更バイアスの向きを返します。
|
List<CssMetaData<? extends Styleable,?>> |
getCssMetaData()
NodeのCssMetaDataがリフレクションなしでアクセス可能になるように、このメソッドは
Node.getClassCssMetaData()に委任する必要があります。 |
static HPos |
getHalignment(Node child)
子のhalignment制約を返します(設定されている場合)。
|
double |
getHgap()
プロパティhgapの値を取得します。
|
static Priority |
getHgrow(Node child)
子のhgrow制約を返します(設定されている場合)。
|
static Insets |
getMargin(Node child)
子のマージン制約を返します(設定されている場合)。
|
ObservableList<RowConstraints> |
getRowConstraints()
行制約のリストを返します。
|
static Integer |
getRowIndex(Node child)
子の行インデックス制約を返します(設定されている場合)。
|
static Integer |
getRowSpan(Node child)
子の行範囲制約を返します(設定されている場合)。
|
static VPos |
getValignment(Node child)
子のvalignment制約を返します(設定されている場合)。
|
double |
getVgap()
プロパティvgapの値を取得します。
|
static Priority |
getVgrow(Node child)
子のvgrow制約を返します(設定されている場合)。
|
BooleanProperty |
gridLinesVisibleProperty()
デバッグ専用。グリッドペインの行と列を表示するために線を表示するかどうかを制御します。
|
DoubleProperty |
hgapProperty()
列間の水平方向の間隔の幅。
|
static Boolean |
isFillHeight(Node child)
子の垂直方向の塗りつぶしポリシーを返します(設定されている場合)。
|
static Boolean |
isFillWidth(Node child)
子の水平方向の塗りつぶしポリシーを返します(設定されている場合)。
|
boolean |
isGridLinesVisible()
プロパティgridLinesVisibleの値を取得します。
|
protected void |
layoutChildren()
この
Parentの子をレイアウトするレイアウト・パス中に起動されます。 |
void |
requestLayout()
次のシーンがレンダリングされる前に実行するレイアウト・パスを要求します。
|
void |
setAlignment(Pos value)
プロパティalignmentの値を設定します。
|
static void |
setColumnIndex(Node child, Integer value)
グリッドペインに含まれている場合に、子の列インデックスを設定して、グリッドペインのその列から子の配置が開始されるようにします。
|
static void |
setColumnSpan(Node child, Integer value)
グリッドペインに含まれている場合に、子の列範囲を設定して、子がその列数だけ水平方向に配置されるようにします。
|
static void |
setConstraints(Node child, int columnIndex, int rowIndex)
グリッドペインに含まれている場合に、子の列と行のインデックスを設定します。
|
static void |
setConstraints(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan)
グリッドペインに含まれている場合に、子の列、行、列範囲および行範囲の値を設定します。
|
static void |
setConstraints(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan, HPos halignment, VPos valignment)
グリッドペインに含まれている場合に、子のグリッド位置、範囲および位置合せを設定します。
|
static void |
setConstraints(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan, HPos halignment, VPos valignment, Priority hgrow, Priority vgrow)
グリッドペインに含まれている場合に、子のグリッド位置、範囲および位置合せを設定します。
|
static void |
setConstraints(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan, HPos halignment, VPos valignment, Priority hgrow, Priority vgrow, Insets margin)
グリッドペインに含まれている場合に、子のグリッド位置、範囲、位置合せ、拡大優先度およびマージンを設定します。
|
static void |
setFillHeight(Node child, Boolean value)
グリッドペインに含まれている場合に、子の垂直方向の塗りつぶしポリシーを設定します。
|
static void |
setFillWidth(Node child, Boolean value)
グリッドペインに含まれている場合に、子の水平方向の塗りつぶしポリシーを設定します。
|
void |
setGridLinesVisible(boolean value)
プロパティgridLinesVisibleの値を設定します。
|
static void |
setHalignment(Node child, HPos value)
グリッドペインに含まれている場合に、子の水平方向の位置合せを設定します。
|
void |
setHgap(double value)
プロパティhgapの値を設定します。
|
static void |
setHgrow(Node child, Priority value)
グリッドペインに含まれている場合に、子の水平方向の拡大優先度を設定します。
|
static void |
setMargin(Node child, Insets value)
グリッドペインに含まれている場合に、子のマージンを設定します。
|
static void |
setRowIndex(Node child, Integer value)
グリッドペインに含まれている場合に、子の行インデックスを設定して、グリッドペインのその行から子の配置が開始されるようにします。
|
static void |
setRowSpan(Node child, Integer value)
グリッドペインに含まれている場合に、子の行範囲を設定して、子がその行数だけ垂直方向に配置されるようにします。
|
static void |
setValignment(Node child, VPos value)
グリッドペインに含まれている場合に、子の垂直方向の位置合せを設定します。
|
void |
setVgap(double value)
プロパティvgapの値を設定します。
|
static void |
setVgrow(Node child, Priority value)
グリッドペインに含まれている場合に、子の垂直方向の拡大優先度を設定します。
|
String |
toString()
この
GridPaneオブジェクトの文字列表現を返します。 |
DoubleProperty |
vgapProperty()
行の間の垂直方向の間隔の高さ。
|
getChildrenbackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpace, snapToPixelProperty, widthPropertygetBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestParentLayout, setNeedsLayout, updateBoundsaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visiblePropertypublic final DoubleProperty hgapProperty
getHgap()、setHgap(double)public final DoubleProperty vgapProperty
getVgap()、setVgap(double)public final ObjectProperty<Pos> alignmentProperty
public final BooleanProperty gridLinesVisibleProperty
falseです。 public static final int REMAINING
public static void setRowIndex(Node child, Integer value)
child - グリッドペインの子ノードvalue - 子の行インデックスpublic static Integer getRowIndex(Node child)
child - グリッドペインの子ノードpublic static void setColumnIndex(Node child, Integer value)
child - グリッドペインの子ノードvalue - 子の列インデックスpublic static Integer getColumnIndex(Node child)
child - グリッドペインの子ノードpublic static void setRowSpan(Node child, Integer value)
グリッドペインの子に行範囲が設定されていない場合は、デフォルトで範囲が1行に設定されます。 値をnullに設定すると、制約は削除されます。
child - グリッドペインの子ノードvalue - 子の行範囲public static Integer getRowSpan(Node child)
child - グリッドペインの子ノードpublic static void setColumnSpan(Node child, Integer value)
グリッドペインの子に列範囲が設定されていない場合は、デフォルトで範囲が1列に設定されます。 値をnullに設定すると、制約は削除されます。
child - グリッドペインの子ノードvalue - 子の列範囲public static Integer getColumnSpan(Node child)
child - グリッドペインの子ノードpublic static void setMargin(Node child, Insets value)
child - グリッドペインの子ノードvalue - 子の周囲の空白のマージンpublic static Insets getMargin(Node child)
child - グリッドペインの子ノードpublic static void setHalignment(Node child, HPos value)
child - グリッドペインの子ノードvalue - 子の水平方向の位置合せpublic static HPos getHalignment(Node child)
child - グリッドペインの子ノードpublic static void setValignment(Node child, VPos value)
child - グリッドペインの子ノードvalue - 子の垂直方向の位置合せpublic static VPos getValignment(Node child)
child - グリッドペインの子ノードpublic static void setHgrow(Node child, Priority value)
child - グリッドペインの子value - 子の水平方向の拡大優先度public static Priority getHgrow(Node child)
child - グリッドペインの子ノードpublic static void setVgrow(Node child, Priority value)
child - グリッドペインの子value - 子の垂直方向の拡大優先度public static Priority getVgrow(Node child)
child - グリッドペインの子ノードpublic static void setFillWidth(Node child, Boolean value)
child - グリッドペインの子ノードvalue - 水平方向の塗りつぶしポリシーまたは設定しない場合はnullpublic static Boolean isFillWidth(Node child)
child - グリッドペインの子ノードpublic static void setFillHeight(Node child, Boolean value)
child - グリッドペインの子ノードvalue - 垂直方向の塗りつぶしポリシーまたは設定しない場合はnullpublic static Boolean isFillHeight(Node child)
child - グリッドペインの子ノードpublic static void setConstraints(Node child, int columnIndex, int rowIndex)
child - グリッドペインの子ノードcolumnIndex - 子の列インデックスの位置rowIndex - 子の行インデックスの位置public static void setConstraints(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan)
child - グリッドペインの子ノードcolumnIndex - 子の列インデックスの位置rowIndex - 子の行インデックスの位置columnspan - 子の範囲に含める必要がある列数rowspan - 子の範囲に含める必要がある行数public static void setConstraints(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan, HPos halignment, VPos valignment)
child - グリッドペインの子ノードcolumnIndex - 子の列インデックスの位置rowIndex - 子の行インデックスの位置columnspan - 子の範囲に含める必要がある列数rowspan - 子の範囲に含める必要がある行数halignment - 子の水平方向の位置合せvalignment - 子の垂直方向の位置合せpublic static void setConstraints(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan, HPos halignment, VPos valignment, Priority hgrow, Priority vgrow)
child - グリッドペインの子ノードcolumnIndex - 子の列インデックスの位置rowIndex - 子の行インデックスの位置columnspan - 子の範囲に含める必要がある列数rowspan - 子の範囲に含める必要がある行数halignment - 子の水平方向の位置合せvalignment - 子の垂直方向の位置合せhgrow - 子の水平方向の拡大優先度vgrow - 子の垂直方向の拡大優先度public static void setConstraints(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan, HPos halignment, VPos valignment, Priority hgrow, Priority vgrow, Insets margin)
child - グリッドペインの子ノードcolumnIndex - 子の列インデックスの位置rowIndex - 子の行インデックスの位置columnspan - 子の範囲に含める必要がある列数rowspan - 子の範囲に含める必要がある行数halignment - 子の水平方向の位置合せvalignment - 子の垂直方向の位置合せhgrow - 子の水平方向の拡大優先度vgrow - 子の垂直方向の拡大優先度margin - 子の周囲のマージン領域public static void clearConstraints(Node child)
child - 子ノードpublic final DoubleProperty hgapProperty()
getHgap()、setHgap(double)public final void setHgap(double value)
public final double getHgap()
public final DoubleProperty vgapProperty()
getVgap()、setVgap(double)public final void setVgap(double value)
public final double getVgap()
public final ObjectProperty<Pos> alignmentProperty()
public final void setAlignment(Pos value)
public final Pos getAlignment()
public final BooleanProperty gridLinesVisibleProperty()
falseです。 public final void setGridLinesVisible(boolean value)
falseです。 public final boolean isGridLinesVisible()
falseです。 public final ObservableList<RowConstraints> getRowConstraints()
public final ObservableList<ColumnConstraints> getColumnConstraints()
public void add(Node child, int columnIndex, int rowIndex)
child - グリッドペインに追加されるノードcolumnIndex - 0から始まる、グリッドペイン内の子の列インデックスの位置rowIndex - 0から始まる、グリッドペイン内の子の行インデックスの位置public void add(Node child, int columnIndex, int rowIndex, int colspan, int rowspan)
child - グリッドペインに追加されるノードcolumnIndex - 0から始まる、グリッドペイン内の子の列インデックスの位置rowIndex - 0から始まる、グリッドペイン内の子の行インデックスの位置colspan - 子のレイアウト領域範囲に含める必要がある列数rowspan - 子のレイアウト領域範囲に含める必要がある行数public void addRow(int rowIndex,
Node... children)
rowIndex - グリッドペイン内の子の行インデックスの位置children - グリッドペイン内の行として追加されるノードpublic void addColumn(int columnIndex,
Node... children)
columnIndex - グリッドペイン内の子の列インデックスの位置children - グリッドペイン内の列として追加されるノードprotected double computeMinWidth(double height)
RegioncomputeMinWidth、クラスRegionheight - 最小幅が高さに依存する場合に使用する必要がある高さprotected double computeMinHeight(double width)
RegioncomputeMinHeight、クラスRegionwidth - 最小高が幅に依存する場合に使用する必要がある幅protected double computePrefWidth(double height)
RegioncomputePrefWidth、クラスRegionheight - 推奨される幅がそれに依存する場合に使用する必要がある高さprotected double computePrefHeight(double width)
RegioncomputePrefHeight、クラスRegionwidth - 推奨される高さがそれに依存する場合に使用する必要がある幅public Orientation getContentBias()
NodeResizableのサブクラスはこのメソッドをオーバーライドし、適切な値を返す必要があります。
getContentBias、クラスNodeNode.isResizable()、Node.minWidth(double)、Node.minHeight(double)、Node.prefWidth(double)、Node.prefHeight(double)、Node.maxWidth(double)、Node.maxHeight(double)public void requestLayout()
Parentこの親がレイアウト・ルートまたは管理対象外のいずれかである場合は、シーンのダーティ・レイアウト・リストに直接追加されます。そうでない場合は、requestParentLayoutが起動されます。
requestLayout、クラスParentprotected void layoutChildren()
ParentParentの子をレイアウトするレイアウト・パス中に起動されます。 デフォルトでは、管理対象のサイズ変更可能なコンテンツのサイズをその優先サイズに合せて設定するのみで、ノードの配置は行われません。
サブクラスは必要に応じてこの関数をオーバーライドし、コンテンツをレイアウトする必要があります。
layoutChildren、クラスParentpublic String toString()
GridPaneオブジェクトの文字列表現を返します。public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
public List<CssMetaData<? extends Styleable,?>> getCssMetaData()
Node.getClassCssMetaData()に委任する必要があります。getCssMetaData、インタフェースStyleablegetCssMetaData、クラスRegionCopyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.