- java.lang.Object
- 
- javafx.scene.Node
- 
- javafx.scene.Parent
- 
- javafx.scene.layout.Region
- 
- javafx.scene.control.Control
- 
- javafx.scene.control.ButtonBar
 
 
 
 
 
- 
- すべての実装されたインタフェース:
- Styleable,- EventTarget,- Skinnable
 
 public class ButtonBar extends Control ButtonBarは、HBoxにオペレーティング・システム固有のボタン配置のための機能を追加したものです。 つまり、いずれのNodeも、setButtonData(Node, ButtonData)メソッドを介して注釈を付け、(getButtons()リストを介して) ButtonBar内部に配置し、その注釈に基づいてボタン・リスト内の他のすべてのノードおよびButtonBarに指定された包括的なbutton orderを基準として配置することができます。均一ボタン・サイジングデフォルトでは、ButtonBar内のすべてのボタンは均一のサイズに設定され、つまりすべてのボタンに最も幅の広いボタンの幅が適用されます。 setButtonUniformSize(Node, boolean)メソッドをブール値falseで呼び出して、ボタンごとにこれを取り消すことが可能です。均一サイジングから除外されたボタンは、優先サイズが取り消されて再設定されることも、測定プロセスに含まれることもないため、そのボタンのサイズがButtonBar内のすべてのボタンに対して計算される最大サイズに影響を与えることはありません。 スクリーンショットButtonBarにはWindows、Mac OSおよびLinuxの組込みサポートが付属しているため、3つのスクリーンショットを次に示します。3つのオペレーティング・システムそれぞれに同じボタンが配置されています。 Windows: 
 Mac OS: 
 Linux:  コード・サンプルButtonBarをインスタンス化および使用するのは簡単で、次のように記述するだけです。 // Create the ButtonBar instance ButtonBar buttonBar = new ButtonBar(); // Create the buttons to go into the ButtonBar Button yesButton = new Button("Yes"); ButtonBar.setButtonData(yesButton, ButtonData.YES); Button noButton = new Button("No"); ButtonBar.setButtonData(noButton, ButtonData.NO); // Add buttons to the ButtonBar buttonBar.getButtons().addAll(yesButton, noButton);前述のコード・サンプルでは、ユーザーのオペレーティング・システムを基準にしてYesボタンとNoボタンが配置されます。 つまり、WindowsおよびLinuxではYesボタンがNoボタンの前に配置され、Mac OSではNoの次にYesが配置されます。 ほとんどの場合、OSに固有のレイアウトが最適なレイアウトですが、 button order propertyを変更してカスタム・レイアウトにすることもできます。 これらは、ボタン順序の短縮表記である暗号的な文字列です。 Windows、Mac OSおよびLinuxでの組込み順序は次のとおりです。ButtonBarレイアウト表 オペレーティング・システム ボタンの順序 Windows L_E+U+FBXI_YNOCAH_R Mac OS L_HE+U+FBIX_NCYOA_R Linux L_HE+UNYACBXIO_R これらの各文字の意味の説明は、 ButtonBar.ButtonData列挙を参照してください。 ただし、ButtonBarにButtonBar.ButtonData.YESボタンとButtonBar.ButtonData.NOボタンのみを含め、yesボタンを常にnoボタンの前に配置し、かつボタンを右揃えにすた場合は、次のようにします。// Create the ButtonBar instance ButtonBar buttonBar = new ButtonBar(); // Set the custom button order buttonBar.setButtonOrder("+YN");- 導入されたバージョン:
- JavaFX 8u40
- 関連項目:
- ButtonBar.ButtonData
 
- 
- 
プロパティのサマリープロパティ Type プロパティ 説明 DoublePropertybuttonMinWidthこのボタン・バーに配置するすべてのボタンの最小幅を指定します。StringPropertybuttonOrder標準のボタン・バー内の一般的なボタンの順序。- 
クラス javafx.scene.control.Controlで宣言されたプロパティcontextMenu、skin、tooltip
 - 
クラス javafx.scene.Nodeで宣言されたプロパティ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, viewOrder, visible
 - 
クラス javafx.scene.Parentで宣言されたプロパティneedsLayout
 - 
クラス javafx.scene.layout.Regionで宣言されたプロパティbackground、border、cacheShape、centerShape、height、insets、maxHeight、maxWidth、minHeight、minWidth、opaqueInsets、padding、prefHeight、prefWidth、scaleShape、shape、snapToPixel、width
 
- 
 - 
ネストされたクラスのサマリーネストされたクラス 修飾子と型 クラス 説明 static classButtonBar.ButtonDataすべての使用可能なボタン・データ注釈の列挙。
 - 
フィールドのサマリーフィールド 修飾子と型 フィールド 説明 static StringBUTTON_ORDER_LINUXLinux (特にGNOME)でのデフォルトのボタン並び順。static StringBUTTON_ORDER_MAC_OSMac OSでのデフォルトのボタン並び順。static StringBUTTON_ORDER_NONEボタン並び順がないことを指定するボタン並び順文字列。static StringBUTTON_ORDER_WINDOWSWindowsでのデフォルトのボタン並び順。- 
クラス javafx.scene.Nodeで宣言されたフィールドBASELINE_OFFSET_SAME_AS_HEIGHT
 - 
クラス javafx.scene.layout.Regionで宣言されたフィールドUSE_COMPUTED_SIZE、USE_PREF_SIZE
 
- 
 - 
コンストラクタのサマリーコンストラクタ コンストラクタ 説明 ButtonBar()ユーザーのオペレーティング・システムのデフォルト・プロパティを使用して、デフォルトのButtonBarインスタンスを作成します。ButtonBar(String buttonOrder)指定されたボタン順序でButtonBarを作成します(詳細はbuttonOrderProperty()を参照)。
 - 
メソッドのサマリーすべてのメソッド 静的メソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 DoublePropertybuttonMinWidthProperty()このボタン・バーに配置するすべてのボタンの最小幅を指定します。StringPropertybuttonOrderProperty()標準のボタン・バー内の一般的なボタンの順序。static ButtonBar.ButtonDatagetButtonData(Node button)指定されたボタンに以前に設定されたButtonDataプロパティを返します。doublegetButtonMinWidth()このボタン・バーに配置するすべてのボタンの最小幅を返します。StringgetButtonOrder()現在のbutton orderを返します。ObservableList<Node>getButtons()このObservableList内にボタンを配置すると、指定したButtonBar.ButtonDataに基づいてボタンそれぞれを相対的に配置するようButtonBarに指示します。protected BooleangetInitialFocusTraversable()このコントロールの初期フォーカス・トラバーサブル状態を返します。これは、JavaFX CSSエンジンが初期値を正しく設定するために使用します。static booleanisButtonUniformSize(Node button)指定されたノードが均一サイジング計算に含まれるかどうかを返します。static voidsetButtonData(Node button, ButtonBar.ButtonData buttonData)指定されたボタンに、指定されたButtonDataを設定します。voidsetButtonMinWidth(double value)このボタン・バーに配置するすべてのボタンの最小幅を設定します。voidsetButtonOrder(String buttonOrder)button orderを設定しますstatic voidsetButtonUniformSize(Node button, boolean uniformSize)デフォルトでは、ButtonBar内のすべてのボタンは均一のサイズに設定され、つまりすべてのボタンに最も幅の広いボタンの幅が適用されます。- 
クラス javafx.scene.control.Controlで宣言されたメソッドcomputeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, contextMenuProperty, createDefaultSkin, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getTooltip, isResizable, setContextMenu, setTooltip, skinProperty, tooltipProperty
 - 
クラス javafx.scene.Nodeで宣言されたメソッド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, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, 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, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, 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, lookup, 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, queryAccessibleAttribute, 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, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
 - 
クラス java.lang.Objectで宣言されたメソッドclone、equals、finalize、getClass、hashCode、notify、notifyAll、wait、wait、wait
 - 
クラス javafx.scene.Parentで宣言されたメソッドgetBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, layoutChildren, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
 - 
クラス javafx.scene.layout.Regionで宣言されたメソッドbackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computePrefHeight, computePrefWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, 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, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
 - 
インタフェース javafx.css.Styleableで宣言されたメソッドgetStyleableNode, getStyleClass
 
- 
 
- 
- 
- 
プロパティの詳細- 
buttonOrderpublic final StringProperty buttonOrderProperty 標準のボタン・バー内の一般的なボタンの順序。ButtonBar.ButtonData列挙値ごとに1文字です。 オペレーティング・システムのデフォルトのボタン順序(BUTTON_ORDER_WINDOWS、BUTTON_ORDER_MAC_OSおよびBUTTON_ORDER_LINUX)も使用可能です。
 - 
buttonMinWidthpublic final DoubleProperty buttonMinWidthProperty このボタン・バーに配置するすべてのボタンの最小幅を指定します。
 
- 
 - 
フィールドの詳細- 
BUTTON_ORDER_WINDOWSpublic static final String BUTTON_ORDER_WINDOWS Windowsでのデフォルトのボタン並び順。- 関連項目:
- 定数フィールド値
 
 - 
BUTTON_ORDER_MAC_OSpublic static final String BUTTON_ORDER_MAC_OS Mac OSでのデフォルトのボタン並び順。- 関連項目:
- 定数フィールド値
 
 - 
BUTTON_ORDER_LINUXpublic static final String BUTTON_ORDER_LINUX Linux (特にGNOME)でのデフォルトのボタン並び順。- 関連項目:
- 定数フィールド値
 
 - 
BUTTON_ORDER_NONEpublic static final String BUTTON_ORDER_NONE ボタン並び順がないことを指定するボタン並び順文字列。 つまり、ボタンはgetButtons()リスト内の順序で配置されます。 レイアウトでHBoxを使用する場合と異なる点は、ボタンが右揃えであることのみです。- 関連項目:
- 定数フィールド値
 
 
- 
 - 
コンストラクタの詳細- 
ButtonBarpublic ButtonBar() ユーザーのオペレーティング・システムのデフォルト・プロパティを使用して、デフォルトのButtonBarインスタンスを作成します。
 - 
ButtonBarpublic ButtonBar(String buttonOrder) 指定されたボタン順序でButtonBarを作成します(詳細はbuttonOrderProperty()を参照)。- パラメータ:
- buttonOrder- このボタン・バー・インスタンスで使用するボタン順序。
 
 
- 
 - 
メソッドの詳細- 
setButtonDatapublic static void setButtonData(Node button, ButtonBar.ButtonData buttonData) 指定されたボタンに、指定されたButtonDataを設定します。 その後でこのボタンがButtonBarに配置されるとき、バーの他のすべてのボタンを基準にして正しい位置に配置されます。- パラメータ:
- button- 指定された- ButtonBar.ButtonData値で注釈付けするボタン。
- buttonData- ボタンの指定に使用するButtonData。
 
 - 
getButtonDatapublic static ButtonBar.ButtonData getButtonData(Node button) 指定されたボタンに以前に設定されたButtonDataプロパティを返します。 これが設定されていない場合、このメソッドはnullを返します。- パラメータ:
- button- 以前に設定されたButtonDataを返すボタン。
- 戻り値:
- 指定されたボタンの以前に設定されたButtonDataプロパティ
 
 - 
setButtonUniformSizepublic static void setButtonUniformSize(Node button, boolean uniformSize) デフォルトでは、ButtonBar内のすべてのボタンは均一のサイズに設定され、つまりすべてのボタンに最も幅の広いボタンの幅が適用されます。 setButtonUniformSizeメソッドをブール値falseで呼び出して、ボタンごとにこれを取り消すことが可能です。均一サイジングから除外されたボタンは、優先サイズが取り消されて再設定されることも、測定プロセスに含まれることもないため、そのボタンのサイズがButtonBar内のすべてのボタンに対して計算される最大サイズに影響を与えることはありません。 - パラメータ:
- button- 均一サイジングに含める、または均一サイジングから除外するボタン。
- uniformSize- ボタンに均一サイジングを適用する場合はブールのtrue、ボタンを均一サイジングから除外する場合はfalse。
 
 - 
isButtonUniformSizepublic static boolean isButtonUniformSize(Node button) 指定されたノードが均一サイジング計算に含まれるかどうかを返します。 デフォルトでは、(setButtonUniformSize(Node, boolean)を介して)除外されていないノードはすべてここでtrueを返します。- パラメータ:
- button- ボタン
- 戻り値:
- ボタンが均一なサイズの計算の一部である場合はtrue
 
 - 
getButtonspublic final ObservableList<Node> getButtons() このObservableList内にボタンを配置すると、指定したButtonBar.ButtonDataに基づいてボタンそれぞれを相対的に配置するようButtonBarに指示します。 ボタンのButtonDataを設定するには、setButtonData(Node, ButtonData)を呼び出して、関連するButtonDataを渡すだけです。- 戻り値:
- 現在ボタン・バー内にあるすべてのボタンが含まれた、ボタンの追加や削除が可能なリスト。
 
 - 
buttonOrderPropertypublic final StringProperty buttonOrderProperty() 標準のボタン・バー内の一般的なボタンの順序。ButtonBar.ButtonData列挙値ごとに1文字です。 オペレーティング・システムのデフォルトのボタン順序(BUTTON_ORDER_WINDOWS、BUTTON_ORDER_MAC_OSおよびBUTTON_ORDER_LINUX)も使用可能です。
 - 
setButtonOrderpublic final void setButtonOrder(String buttonOrder) button orderを設定します- パラメータ:
- buttonOrder- 現在設定されているボタン順序(デフォルトではOSに固有のボタン順序になります)。
 
 - 
getButtonOrderpublic final String getButtonOrder() 現在のbutton orderを返します。- 戻り値:
- 現在のボタン順序。
 
 - 
buttonMinWidthPropertypublic final DoubleProperty buttonMinWidthProperty() このボタン・バーに配置するすべてのボタンの最小幅を指定します。
 - 
setButtonMinWidthpublic final void setButtonMinWidth(double value) このボタン・バーに配置するすべてのボタンの最小幅を設定します。- パラメータ:
- value- 最小幅の値
 
 - 
getButtonMinWidthpublic final double getButtonMinWidth() このボタン・バーに配置するすべてのボタンの最小幅を返します。- 戻り値:
- 最小幅の値
 
 - 
getInitialFocusTraversableprotected Boolean getInitialFocusTraversable() このコントロールの初期フォーカス・トラバーサブル状態を返します。これは、JavaFX CSSエンジンが初期値を正しく設定するために使用します。 このメソッドはオーバーライドされます。既定のUIコントロールでは、フォーカス・トラバーサルがtrueに設定されていますが、このコントロールには適切ではありません。- オーバーライド:
- クラスControlのgetInitialFocusTraversable
- 戻り値:
- このコントロールの最初のフォーカス・トラバーサル状態
- 導入されたバージョン:
- 9
 
 
- 
 
-