public class BorderPane extends Pane
上下の子は、その優先高に合せてサイズ変更され、ボーダー・ペインの幅が拡張されます。左右の子は、その優先幅に合せてサイズ変更され、上下ノード間の長さが拡張されます。また、中央ノードは、中央の使用可能なスペース全体に表示されるようにサイズ変更されます。いずれかの位置はnullの可能性があります。例:
BorderPane borderPane = new BorderPane();
ToolBar toolbar = new ToolBar();
HBox statusbar = new HBox();
Node appContent = new AppContentNode();
borderPane.setTop(toolbar);
borderPane.setCenter(appContent);
borderPane.setBottom(statusbar);
CSSを使用して、背景およびボーダーがあるBorderpaneのスタイルを設定できます。詳細は、Region
スーパー・クラスを参照してください。
BorderPaneでは、その子の最小サイズ、優先サイズおよび最大サイズが考慮されます。子が、そのサイズ変更可能な範囲のために、その位置に収まるようにサイズ変更できない場合は、次のように、デフォルトの位置合せを使用して、スペースに対して相対的に位置合せされます。
BorderPaneでは、子の可視プロパティ値に関係なく、5つの位置に設定される子がそれぞれレイアウトされ、管理対象外の子は無視されます。
Scene
のルートとして使用され、その場合は、そのサイズがシーンのサイズに追随します。シーンまたはステージ・サイズがアプリケーションによって直接設定されていない場合は、シーン・サイズはボーダー・ペインの優先サイズに初期化されます。ただし、ボーダー・ペインにシーン以外の親がある場合は、その親が、ボーダー・ペインのサイズ変更可能な範囲内で、レイアウト中にボーダー・ペインをサイズ変更します。デフォルトでは、ボーダー・ペインは、次の表で説明するように、そのコンテンツに基づいてこの範囲を計算します。
width | height | |
---|---|---|
最小 | 左/右の枠+左/右の子が、その優先幅および上/下/中央を適用し、少なくともその最小幅を使用して表示されるために必要な幅 | 上/下の枠+上/下の子が、その優先高と左/右/中央を適用し、少なくとも子の最小高を使用して表示されるために必要な高さ |
優先 | 左/右の枠+上/右/下/左/中央の子が、少なくともその優先幅を使用して表示されるために必要な幅 | 上/下の枠+上/右/下/左/中央の子が、少なくとも子の優先高を使用して表示されるために必要な高さ |
最大 | Double.MAX_VALUE | Double.MAX_VALUE |
ボーダー・ペインの最大幅および最大高には制限がないため、親に割り当てられているスペースすべてを満たすために、親がその優先サイズより大きいサイズに変更される可能性があります。
BorderPaneでは、直接サイズ範囲を設定するプロパティを提供します。これらのプロパティのデフォルトはセンチネル値Region.USE_COMPUTED_SIZEになりますが、アプリケーションで、必要に応じて、次のような他の値に設定できます。
borderPane.setPrefSize(500,400);
アプリケーションでは、これらのプロパティをRegion.USE_COMPUTED_SIZEに戻すことによって、計算値をリストアできます。
BorderPaneはデフォルトではそのコンテンツをクリップしないため、子の最小サイズが原因でスペース内に子を収めることができない場合は、子の境界がBorderPane自体の境界の外側まで拡大することがあります。
制約 | Type | 説明 |
---|---|---|
位置合せ | javafx.geometry.Pos | ボーダー・ペインのその領域内の子の位置合せ。 |
マージン | javafx.geometry.Insets | 子の外側のマージン領域。 |
例:
ListView list = new ListView();
BorderPane.setAlignment(list, Pos.TOP_LEFT);
BorderPane.setMargin(list, new Insets(12,12,12,12));
borderPane.setCenter(list);
Type | プロパティと説明 |
---|---|
ObjectProperty<Node> |
bottom
ボーダー・ペインの下端に配置されるノード。
|
ObjectProperty<Node> |
center
このボーダー・ペインの中央に配置されるノード。
|
ObjectProperty<Node> |
left
このボーダー・ペインの左端に配置されるノード。
|
ObjectProperty<Node> |
right
このボーダー・ペインの右端に配置されるノード。
|
ObjectProperty<Node> |
top
このボーダー・ペインの上端に配置されるノード。
|
background、border、cacheShape、centerShape、height、insets、maxHeight、maxWidth、minHeight、minWidth、opaqueInsets、padding、prefHeight、prefWidth、scaleShape、shape、snapToPixel、width
needsLayout
accessibleHelp、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
USE_COMPUTED_SIZE、USE_PREF_SIZE
BASELINE_OFFSET_SAME_AS_HEIGHT
コンストラクタと説明 |
---|
BorderPane()
BorderPaneレイアウトを作成します。
|
BorderPane(Node center)
BorderPaneの中央としてノードが指定されたBorderPaneレイアウトを作成します。
|
BorderPane(Node center, Node top, Node right, Node bottom, Node left)
BorderPaneの主なレイアウト領域ごとに使用するノードが指定されたBorderPaneレイアウトを作成します。
|
修飾子と型 | メソッドと説明 |
---|---|
ObjectProperty<Node> |
bottomProperty()
ボーダー・ペインの下端に配置されるノード。
|
ObjectProperty<Node> |
centerProperty()
このボーダー・ペインの中央に配置されるノード。
|
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)
指定された高さに対するこのリージョンの優先幅を計算します。
|
static Pos |
getAlignment(Node child)
子の位置合せ制約を返します(設定されている場合)。
|
Node |
getBottom()
プロパティbottomの値を取得します。
|
Node |
getCenter()
プロパティcenterの値を取得します。
|
Orientation |
getContentBias()
レイアウト用にノードのサイズ変更バイアスの向きを返します。
|
Node |
getLeft()
プロパティleftの値を取得します。
|
static Insets |
getMargin(Node child)
子のマージン制約を返します(設定されている場合)。
|
Node |
getRight()
プロパティrightの値を取得します。
|
Node |
getTop()
プロパティtopの値を取得します。
|
protected void |
layoutChildren()
この
Parent の子をレイアウトするレイアウト・パス中に起動されます。 |
ObjectProperty<Node> |
leftProperty()
このボーダー・ペインの左端に配置されるノード。
|
ObjectProperty<Node> |
rightProperty()
このボーダー・ペインの右端に配置されるノード。
|
static void |
setAlignment(Node child, Pos value)
ボーダー・ペインに含まれている場合に、子の位置合せを設定します。
|
void |
setBottom(Node value)
プロパティbottomの値を設定します。
|
void |
setCenter(Node value)
プロパティcenterの値を設定します。
|
void |
setLeft(Node value)
プロパティleftの値を設定します。
|
static void |
setMargin(Node child, Insets value)
ボーダー・ペインに含まれている場合に、子のマージンを設定します。
|
void |
setRight(Node value)
プロパティrightの値を設定します。
|
void |
setTop(Node value)
プロパティtopの値を設定します。
|
ObjectProperty<Node> |
topProperty()
このボーダー・ペインの上端に配置されるノード。
|
getChildren
backgroundProperty、borderProperty、cacheShapeProperty、centerShapeProperty、computeMaxHeight、computeMaxWidth、getBackground、getBorder、getClassCssMetaData、getCssMetaData、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、widthProperty
getBaselineOffset、getChildrenUnmodifiable、getManagedChildren、getStylesheets、isNeedsLayout、layout、lookup、needsLayoutProperty、queryAccessibleAttribute、requestLayout、requestParentLayout、setNeedsLayout、updateBounds
accessibleHelpProperty、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、toString、translateXProperty、translateYProperty、translateZProperty、usesMirroring、visibleProperty
public final ObjectProperty<Node> centerProperty
getCenter()
、setCenter(Node)
public final ObjectProperty<Node> topProperty
getTop()
、setTop(Node)
public final ObjectProperty<Node> bottomProperty
getBottom()
、setBottom(Node)
public final ObjectProperty<Node> leftProperty
getLeft()
、setLeft(Node)
public final ObjectProperty<Node> rightProperty
getRight()
、setRight(Node)
public BorderPane()
public BorderPane(Node center)
center
- BorderPaneの中央として設定するノード。public BorderPane(Node center, Node top, Node right, Node bottom, Node left)
center
- BorderPaneの中央として設定するノード。top
- BorderPaneの上部として設定するノード。right
- BorderPaneの右として設定するノード。bottom
- BorderPaneの下部として設定するノード。left
- BorderPaneの左として設定するノード。public static void setAlignment(Node child, Pos value)
child
- ボーダー・ペインの子ノードvalue
- 子の配置位置public static Pos getAlignment(Node child)
child
- ボーダー・ペインの子ノードpublic static void setMargin(Node child, Insets value)
child
- ボーダー・ペインの子ノードvalue
- 子の周囲の空白のマージンpublic static Insets getMargin(Node child)
child
- ボーダー・ペインの子ノードpublic static void clearConstraints(Node child)
child
- 子ノードpublic final ObjectProperty<Node> centerProperty()
getCenter()
、setCenter(Node)
public final void setCenter(Node value)
public final Node getCenter()
public final ObjectProperty<Node> topProperty()
getTop()
、setTop(Node)
public final void setTop(Node value)
public final Node getTop()
public final ObjectProperty<Node> bottomProperty()
getBottom()
、setBottom(Node)
public final void setBottom(Node value)
public final Node getBottom()
public final ObjectProperty<Node> leftProperty()
getLeft()
、setLeft(Node)
public final void setLeft(Node value)
public final Node getLeft()
public final ObjectProperty<Node> rightProperty()
getRight()
、setRight(Node)
public final void setRight(Node value)
public final Node getRight()
public Orientation getContentBias()
Node
Resizableのサブクラスはこのメソッドをオーバーライドし、適切な値を返す必要があります。
getContentBias
、クラス: Node
Node.isResizable()
、Node.minWidth(double)
、Node.minHeight(double)
、Node.prefWidth(double)
、Node.prefHeight(double)
、Node.maxWidth(double)
、Node.maxHeight(double)
protected double computeMinWidth(double height)
Region
computeMinWidth
、クラス: Region
height
- 最小幅が高さに依存する場合に使用する必要がある高さprotected double computeMinHeight(double width)
Region
computeMinHeight
、クラス: Region
width
- 最小高が幅に依存する場合に使用する必要がある幅protected double computePrefWidth(double height)
Region
computePrefWidth
、クラス: Region
height
- 推奨される幅がそれに依存する場合に使用する必要がある高さprotected double computePrefHeight(double width)
Region
computePrefHeight
、クラス: Region
width
- 推奨される高さがそれに依存する場合に使用する必要がある幅protected void layoutChildren()
Parent
Parent
の子をレイアウトするレイアウト・パス中に起動されます。デフォルトでは、管理対象のサイズ変更可能なコンテンツのサイズをその優先サイズに合せて設定するのみで、ノードの配置は行われません。
サブクラスは必要に応じてこの関数をオーバーライドし、コンテンツをレイアウトする必要があります。
layoutChildren
、クラス: Parent
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.