public class Slider extends Control
スライダの3つの基本的な変数は、min
、max
およびvalue
です。value
は常にmin
およびmax
で定義される範囲内の数値にし、min
は常にmax
以下の値にする必要があります(min
とmax
が等しいスライダは、意味をなさないデジェネレート・ケースです)。min
のデフォルトは0、max
のデフォルトは100です。
この最初の例では、範囲つまりスパンが0から1、値のデフォルトが.5であるスライダを作成します。
import javafx.scene.control.Slider; Slider slider = new Slider(0, 1, 0.5);
次の例では、カスタマイズされた目盛および目盛ラベルを持つスライダ(範囲は0から1まで)を示しています。
import javafx.scene.control.Slider; Slider slider = new Slider(0, 1, 0.5); slider.setShowTickMarks(true); slider.setShowTickLabels(true); slider.setMajorTickUnit(0.25f); slider.setBlockIncrement(0.1f);
Type | プロパティと説明 |
---|---|
DoubleProperty |
blockIncrement
スライダのトラックがクリックされた場合にSliderを調整する量。
|
ObjectProperty<StringConverter<Double>> |
labelFormatter
大目盛のラベルをフォーマットするための関数。
|
DoubleProperty |
majorTickUnit
大目盛の間の単位距離。
|
DoubleProperty |
max
このSliderで表される最大値。
|
IntegerProperty |
minorTickCount
2つの大目盛の間に配置する小目盛の数。
|
DoubleProperty |
min
このSliderで表される最小値。
|
ObjectProperty<Orientation> |
orientation
Slider の向きに水平または垂直を指定できます。 |
BooleanProperty |
showTickLabels
目盛のラベルを表示する必要があることを示します。
|
BooleanProperty |
showTickMarks
Skin 実装が目盛を表示する必要があるかどうかを指定します。 |
BooleanProperty |
snapToTicks
Slider のvalue を常に目盛に合せるかどうかを示します。 |
BooleanProperty |
valueChanging
trueの場合、このSliderの現在の値を変更していることを示します。
|
DoubleProperty |
value
このSliderで表される現在の値。
|
contextMenu、skin、tooltip
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
コンストラクタと説明 |
---|
Slider()
デフォルトのSliderインスタンスを作成します。
|
Slider(double min, double max, double value)
スライダの最小値、最大値および現在の値を指定してSliderコントロールを構築します。
|
修飾子と型 | メソッドと説明 |
---|---|
void |
adjustValue(double newValue)
newValue に合せてvalue を調整します。 |
DoubleProperty |
blockIncrementProperty()
スライダのトラックがクリックされた場合にSliderを調整する量。
|
protected Skin<?> |
createDefaultSkin()
このコントロールのデフォルト・スキンの新しいインスタンスを作成します。
|
void |
decrement()
maxを上限として、値を
blockIncrement ずつ減らします。 |
void |
executeAccessibleAction(AccessibleAction action, Object... parameters)
このメソッドは、引数で指定されたアクションの実行をリクエストするためにアシスティブ・テクノロジによって呼び出されます。
|
double |
getBlockIncrement()
プロパティblockIncrementの値を取得します。
|
static List<CssMetaData<? extends Styleable,?>> |
getClassCssMetaData() |
StringConverter<Double> |
getLabelFormatter()
プロパティlabelFormatterの値を取得します。
|
double |
getMajorTickUnit()
プロパティmajorTickUnitの値を取得します。
|
double |
getMax()
プロパティmaxの値を取得します。
|
double |
getMin()
プロパティminの値を取得します。
|
int |
getMinorTickCount()
プロパティminorTickCountの値を取得します。
|
Orientation |
getOrientation()
プロパティorientationの値を取得します。
|
double |
getValue()
プロパティvalueの値を取得します。
|
void |
increment()
maxを上限として、値を
blockIncrement ずつ増やします。 |
boolean |
isShowTickLabels()
プロパティshowTickLabelsの値を取得します。
|
boolean |
isShowTickMarks()
プロパティshowTickMarksの値を取得します。
|
boolean |
isSnapToTicks()
プロパティsnapToTicksの値を取得します。
|
boolean |
isValueChanging()
プロパティvalueChangingの値を取得します。
|
ObjectProperty<StringConverter<Double>> |
labelFormatterProperty()
大目盛のラベルをフォーマットするための関数。
|
DoubleProperty |
majorTickUnitProperty()
大目盛の間の単位距離。
|
DoubleProperty |
maxProperty()
このSliderで表される最大値。
|
IntegerProperty |
minorTickCountProperty()
2つの大目盛の間に配置する小目盛の数。
|
DoubleProperty |
minProperty()
このSliderで表される最小値。
|
ObjectProperty<Orientation> |
orientationProperty()
Slider の向きに水平または垂直を指定できます。 |
Object |
queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
*アクセシビリティ処理* *
|
void |
setBlockIncrement(double value)
プロパティblockIncrementの値を設定します。
|
void |
setLabelFormatter(StringConverter<Double> value)
プロパティlabelFormatterの値を設定します。
|
void |
setMajorTickUnit(double value)
プロパティmajorTickUnitの値を設定します。
|
void |
setMax(double value)
プロパティmaxの値を設定します。
|
void |
setMin(double value)
プロパティminの値を設定します。
|
void |
setMinorTickCount(int value)
プロパティminorTickCountの値を設定します。
|
void |
setOrientation(Orientation value)
プロパティorientationの値を設定します。
|
void |
setShowTickLabels(boolean value)
プロパティshowTickLabelsの値を設定します。
|
void |
setShowTickMarks(boolean value)
プロパティshowTickMarksの値を設定します。
|
void |
setSnapToTicks(boolean value)
プロパティsnapToTicksの値を設定します。
|
void |
setValue(double value)
プロパティvalueの値を設定します。
|
void |
setValueChanging(boolean value)
プロパティvalueChangingの値を設定します。
|
BooleanProperty |
showTickLabelsProperty()
目盛のラベルを表示する必要があることを示します。
|
BooleanProperty |
showTickMarksProperty()
Skin 実装が目盛を表示する必要があるかどうかを指定します。 |
BooleanProperty |
snapToTicksProperty()
Slider のvalue を常に目盛に合せるかどうかを示します。 |
BooleanProperty |
valueChangingProperty()
trueの場合、このSliderの現在の値を変更していることを示します。
|
DoubleProperty |
valueProperty()
このSliderで表される現在の値。
|
computeMaxHeight、computeMaxWidth、computeMinHeight、computeMinWidth、computePrefHeight、computePrefWidth、contextMenuProperty、getBaselineOffset、getContextMenu、getCssMetaData、getSkin、getTooltip、isResizable、layoutChildren、setContextMenu、setSkin、setTooltip、skinProperty、tooltipProperty
backgroundProperty、borderProperty、cacheShapeProperty、centerShapeProperty、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、snapSize、snapSpace、snapToPixelProperty、widthProperty
getChildren、getChildrenUnmodifiable、getManagedChildren、getStylesheets、isNeedsLayout、layout、lookup、needsLayoutProperty、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、fireEvent、focusedProperty、focusTraversableProperty、getAccessibleHelp、getAccessibleRole、getAccessibleRoleDescription、getAccessibleText、getBlendMode、getBoundsInLocal、getBoundsInParent、getCacheHint、getClip、getContentBias、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 DoubleProperty maxProperty
min
を超える値である必要があります。getMax()
、setMax(double)
public final DoubleProperty minProperty
max
未満の値である必要があります。getMin()
、setMin(double)
public final DoubleProperty valueProperty
min
からmax
までの間にある必要があります。min
またはmax
が変更されたり、これ自体が変更されたために範囲外になる場合は、常に有効になるように固定されます。getValue()
、setValue(double)
public final BooleanProperty valueChangingProperty
public final ObjectProperty<Orientation> orientationProperty
Slider
の向きに水平または垂直を指定できます。public final BooleanProperty showTickLabelsProperty
Skin
実装は、showTickMarks
もtrueである場合にのみラベルを表示します。public final BooleanProperty showTickMarksProperty
Skin
実装が目盛を表示する必要があるかどうかを指定します。public final DoubleProperty majorTickUnitProperty
min
が0でmax
が100、majorTickUnit
が25の場合は、5つの目盛(位置0、位置25、位置50、位置75、最後は位置100)があります。
この値は正の整数で、スパン未満の値にする必要があります。範囲外の値を指定することは、基本的には目盛を無効にすることと同じです。
public final IntegerProperty minorTickCountProperty
public final BooleanProperty snapToTicksProperty
Slider
のvalue
を常に目盛に合せるかどうかを示します。これは、目盛が表示されない場合でも有効です。public final ObjectProperty<StringConverter<Double>> labelFormatterProperty
Skin
実装で使用されます。public final DoubleProperty blockIncrementProperty
snapToTicks
がtrueの場合、調整された値に最も近い目盛が使用されます。public Slider()
public Slider(double min, double max, double value)
min
- スライダの最小値max
- スライダの最大値value
- スライダの現在の値public final void setMax(double value)
min
を超える値である必要があります。public final double getMax()
min
を超える値である必要があります。public final DoubleProperty maxProperty()
min
を超える値である必要があります。getMax()
、setMax(double)
public final void setMin(double value)
max
未満の値である必要があります。public final double getMin()
max
未満の値である必要があります。public final DoubleProperty minProperty()
max
未満の値である必要があります。getMin()
、setMin(double)
public final void setValue(double value)
public final double getValue()
public final DoubleProperty valueProperty()
min
からmax
までの間にある必要があります。min
またはmax
が変更されたり、これ自体が変更されたために範囲外になる場合は、常に有効になるように固定されます。getValue()
、setValue(double)
public final void setValueChanging(boolean value)
public final boolean isValueChanging()
public final BooleanProperty valueChangingProperty()
public final void setOrientation(Orientation value)
Slider
の向きに水平または垂直を指定できます。public final Orientation getOrientation()
Slider
の向きに水平または垂直を指定できます。public final ObjectProperty<Orientation> orientationProperty()
Slider
の向きに水平または垂直を指定できます。public final void setShowTickLabels(boolean value)
Skin
実装は、showTickMarks
もtrueである場合にのみラベルを表示します。public final boolean isShowTickLabels()
Skin
実装は、showTickMarks
もtrueである場合にのみラベルを表示します。public final BooleanProperty showTickLabelsProperty()
Skin
実装は、showTickMarks
もtrueである場合にのみラベルを表示します。public final void setShowTickMarks(boolean value)
Skin
実装が目盛を表示する必要があるかどうかを指定します。public final boolean isShowTickMarks()
Skin
実装が目盛を表示する必要があるかどうかを指定します。public final BooleanProperty showTickMarksProperty()
Skin
実装が目盛を表示する必要があるかどうかを指定します。public final void setMajorTickUnit(double value)
min
が0でmax
が100、majorTickUnit
が25の場合は、5つの目盛(位置0、位置25、位置50、位置75、最後は位置100)があります。
この値は正の整数で、スパン未満の値にする必要があります。範囲外の値を指定することは、基本的には目盛を無効にすることと同じです。
public final double getMajorTickUnit()
min
が0でmax
が100、majorTickUnit
が25の場合は、5つの目盛(位置0、位置25、位置50、位置75、最後は位置100)があります。
この値は正の整数で、スパン未満の値にする必要があります。範囲外の値を指定することは、基本的には目盛を無効にすることと同じです。
public final DoubleProperty majorTickUnitProperty()
min
が0でmax
が100、majorTickUnit
が25の場合は、5つの目盛(位置0、位置25、位置50、位置75、最後は位置100)があります。
この値は正の整数で、スパン未満の値にする必要があります。範囲外の値を指定することは、基本的には目盛を無効にすることと同じです。
public final void setMinorTickCount(int value)
public final int getMinorTickCount()
public final IntegerProperty minorTickCountProperty()
public final void setSnapToTicks(boolean value)
Slider
のvalue
を常に目盛に合せるかどうかを示します。これは、目盛が表示されない場合でも有効です。public final boolean isSnapToTicks()
Slider
のvalue
を常に目盛に合せるかどうかを示します。これは、目盛が表示されない場合でも有効です。public final BooleanProperty snapToTicksProperty()
Slider
のvalue
を常に目盛に合せるかどうかを示します。これは、目盛が表示されない場合でも有効です。public final void setLabelFormatter(StringConverter<Double> value)
Skin
実装で使用されます。public final StringConverter<Double> getLabelFormatter()
Skin
実装で使用されます。public final ObjectProperty<StringConverter<Double>> labelFormatterProperty()
Skin
実装で使用されます。public final void setBlockIncrement(double value)
snapToTicks
がtrueの場合、調整された値に最も近い目盛が使用されます。public final double getBlockIncrement()
snapToTicks
がtrueの場合、調整された値に最も近い目盛が使用されます。public final DoubleProperty blockIncrementProperty()
snapToTicks
がtrueの場合、調整された値に最も近い目盛が使用されます。public void adjustValue(double newValue)
newValue
に合せてvalue
を調整します。value
は、min
からmax
までの間の実際の量です。この関数ではsnapToTicks
も考慮されることがadjustValueとsetValue間の主な違いとなります。さらに、値がminからmaxまでの有効な数値であることが保証されます。public void increment()
blockIncrement
ずつ増やします。maxがmin以下の場合、このメソッドは何も行いません。public void decrement()
blockIncrement
ずつ減らします。maxがmin以下の場合、このメソッドは何も行いません。protected Skin<?> createDefaultSkin()
-fx-skin
を介してスキンが提供されていない場合にコントロール用のスキンを作成するために、またはsetSkin(...)
を使用してサブクラスで明示的に設定するために呼び出されます。createDefaultSkin
、クラス: Control
public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
queryAccessibleAttribute
、クラス: Control
attribute
- リクエストされた属性parameters
- オプションのパラメータ・リストAccessibleAttribute
public void executeAccessibleAction(AccessibleAction action, Object... parameters)
Node
このメソッドは一般に、特定の役割に必要なアクションを実装するためにサブクラスによってオーバーライドされます。
特定のアクションが処理されない場合、スーパー・クラス実装を呼び出す必要があります。
executeAccessibleAction
、クラス: Control
action
- 実行するアクションparameters
- オプションのパラメータ・リスト「AccessibleAction」
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.