public class ScrollBar extends Control
ScrollBar sets focusTraversable to false.
This example creates a vertical ScrollBar :
import javafx.scene.control.ScrollBar;
ScrollBar s1 = new ScrollBar();
s1.setOrientation(Orientation.VERTICAL);
Implementation of ScrollBar According to JavaFX UI Control API Specification| Modifier and Type | Class and Description |
|---|---|
private static class |
ScrollBar.StyleableProperties |
| Modifier and Type | Field and Description |
|---|---|
private DoubleProperty |
blockIncrement
The amount by which to adjust the scrollbar if the track of the bar is
clicked.
|
private static java.lang.String |
DEFAULT_STYLE_CLASS
Initialize the style class to 'scroll-bar'.
|
private static PseudoClass |
HORIZONTAL_PSEUDOCLASS_STATE
Pseudo-class indicating this is a horizontal ScrollBar.
|
private DoubleProperty |
max
The maximum value represented by this
ScrollBar. |
private DoubleProperty |
min
The minimum value represented by this
ScrollBar. |
private ObjectProperty<Orientation> |
orientation
|
private DoubleProperty |
unitIncrement
|
private DoubleProperty |
value
The current value represented by this
ScrollBar. |
private static PseudoClass |
VERTICAL_PSEUDOCLASS_STATE
Pseud-class indicating this is a vertical ScrollBar.
|
private DoubleProperty |
visibleAmount
Visible amount of the scrollbar's range, typically represented by
the size of the scroll bar's thumb.
|
USE_COMPUTED_SIZE, USE_PREF_SIZEBASELINE_OFFSET_SAME_AS_HEIGHT| Constructor and Description |
|---|
ScrollBar()
Creates a new horizontal ScrollBar (ie getOrientation() == Orientation.HORIZONTAL).
|
| Modifier and Type | Method and Description |
|---|---|
void |
adjustValue(double position)
Adjusts the
value property by
blockIncrement. |
private void |
blockDecrement() |
private void |
blockIncrement() |
DoubleProperty |
blockIncrementProperty() |
protected Skin<?> |
createDefaultSkin()
Create a new instance of the default skin for this control.
|
void |
decrement()
Decrements the value of the
ScrollBar by the
unitIncrement |
void |
executeAccessibleAction(AccessibleAction action,
java.lang.Object... parameters)
This method is called by the assistive technology to request the action
indicated by the argument should be executed.
|
double |
getBlockIncrement() |
static java.util.List<CssMetaData<? extends Styleable,?>> |
getClassCssMetaData() |
java.util.List<CssMetaData<? extends Styleable,?>> |
getControlCssMetaData() |
double |
getMax() |
double |
getMin() |
Orientation |
getOrientation() |
double |
getUnitIncrement() |
double |
getValue() |
double |
getVisibleAmount() |
protected java.lang.Boolean |
impl_cssGetFocusTraversableInitialValue()
Deprecated.
|
void |
increment()
Increments the value of the
ScrollBar by the
unitIncrement |
DoubleProperty |
maxProperty() |
DoubleProperty |
minProperty() |
ObjectProperty<Orientation> |
orientationProperty() |
java.lang.Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
java.lang.Object... parameters)
*
Accessibility handling *
*
|
void |
setBlockIncrement(double value) |
void |
setMax(double value) |
void |
setMin(double value) |
void |
setOrientation(Orientation value) |
void |
setUnitIncrement(double value) |
void |
setValue(double value) |
void |
setVisibleAmount(double value) |
DoubleProperty |
unitIncrementProperty() |
DoubleProperty |
valueProperty() |
DoubleProperty |
visibleAmountProperty() |
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getControlChildren, getCssMetaData, getSkin, getTooltip, impl_processCSS, isResizable, layoutChildren, loadSkinClass, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipPropertybackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, 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, widthPropertygetChildren, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBoundsaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, 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, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, 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, visiblePropertyprivate DoubleProperty min
ScrollBar. This should be a
value less than or equal to max. Default value is 0.private DoubleProperty max
ScrollBar. This should be a
value greater than or equal to min. Default value is 100.private DoubleProperty value
private ObjectProperty<Orientation> orientation
private DoubleProperty unitIncrement
private DoubleProperty blockIncrement
private DoubleProperty visibleAmount
private static final java.lang.String DEFAULT_STYLE_CLASS
private static final PseudoClass VERTICAL_PSEUDOCLASS_STATE
private static final PseudoClass HORIZONTAL_PSEUDOCLASS_STATE
public ScrollBar()
public final void setMin(double value)
public final double getMin()
public final DoubleProperty minProperty()
public final void setMax(double value)
public final double getMax()
public final DoubleProperty maxProperty()
public final void setValue(double value)
public final double getValue()
public final DoubleProperty valueProperty()
public final void setOrientation(Orientation value)
public final Orientation getOrientation()
public final ObjectProperty<Orientation> orientationProperty()
public final void setUnitIncrement(double value)
public final double getUnitIncrement()
public final DoubleProperty unitIncrementProperty()
public final void setBlockIncrement(double value)
public final double getBlockIncrement()
public final DoubleProperty blockIncrementProperty()
public final void setVisibleAmount(double value)
public final double getVisibleAmount()
public final DoubleProperty visibleAmountProperty()
public void adjustValue(double position)
value property by
blockIncrement. The position is the fractional amount
between the min and max. For
example, it might be 50%. If #minProperty min were 0 and #maxProperty max
were 100 and value were 25, then a position of .5 would indicate
that we should increment value by
blockIncrement. If value were 75, then a
position of .5 would indicate that we
should decrement value by blockIncrement.public void increment()
ScrollBar by the
unitIncrementpublic void decrement()
ScrollBar by the
unitIncrementprivate void blockIncrement()
private void blockDecrement()
protected Skin<?> createDefaultSkin()
-fx-skin or set explicitly in a sub-class with setSkin(...).createDefaultSkin in class Controlpublic static java.util.List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
public java.util.List<CssMetaData<? extends Styleable,?>> getControlCssMetaData()
getControlCssMetaData in class Control@Deprecated protected java.lang.Boolean impl_cssGetFocusTraversableInitialValue()
impl_cssGetFocusTraversableInitialValue in class Controlpublic java.lang.Object queryAccessibleAttribute(AccessibleAttribute attribute, java.lang.Object... parameters)
queryAccessibleAttribute in class Controlattribute - the requested attributeparameters - optional list of parametersAccessibleAttributepublic void executeAccessibleAction(AccessibleAction action, java.lang.Object... parameters)
Node
This method is commonly overridden by subclasses to implement
action that are required for a specific role.
If a particular action is not handled, the super class implementation
must be called.
executeAccessibleAction in class Controlaction - the action to executeparameters - optional list of parametersAccessibleAction