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 SpecificationType | Property and Description |
---|---|
DoubleProperty |
blockIncrement
The amount by which to adjust the scrollbar if the track of the bar is
clicked.
|
DoubleProperty |
max
The maximum value represented by this
ScrollBar . |
DoubleProperty |
min
The minimum value represented by this
ScrollBar . |
<any> |
orientation
The orientation of the
ScrollBar can either be HORIZONTAL
or VERTICAL . |
DoubleProperty |
unitIncrement
|
DoubleProperty |
value
The current value represented by this
ScrollBar . |
DoubleProperty |
visibleAmount
Visible amount of the scrollbar's range, typically represented by
the size of the scroll bar's thumb.
|
contextMenuProperty, skinClassNameProperty, skinProperty, tooltipProperty
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 <any> |
orientation
The orientation of the
ScrollBar can either be HORIZONTAL
or VERTICAL . |
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.
|
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()
The amount by which to adjust the scrollbar if the track of the bar is
clicked.
|
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) |
double |
getBlockIncrement()
Gets the value of the property blockIncrement.
|
static java.util.List<<any>> |
getClassCssMetaData() |
java.util.List<<any>> |
getControlCssMetaData() |
protected java.lang.Boolean |
getInitialFocusTraversable()
Returns the initial focus traversable state of this control, for use
by the JavaFX CSS engine to correctly set its initial value.
|
double |
getMax()
Gets the value of the property max.
|
double |
getMin()
Gets the value of the property min.
|
Orientation |
getOrientation()
Gets the value of the property orientation.
|
double |
getUnitIncrement()
Gets the value of the property unitIncrement.
|
double |
getValue()
Gets the value of the property value.
|
double |
getVisibleAmount()
Gets the value of the property visibleAmount.
|
void |
increment()
Increments the value of the
ScrollBar by the
unitIncrement |
DoubleProperty |
maxProperty()
The maximum value represented by this
ScrollBar . |
DoubleProperty |
minProperty()
The minimum value represented by this
ScrollBar . |
<any> |
orientationProperty()
The orientation of the
ScrollBar can either be HORIZONTAL
or VERTICAL . |
java.lang.Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
java.lang.Object... parameters) |
void |
setBlockIncrement(double value)
Sets the value of the property blockIncrement.
|
void |
setMax(double value)
Sets the value of the property max.
|
void |
setMin(double value)
Sets the value of the property min.
|
void |
setOrientation(Orientation value)
Sets the value of the property orientation.
|
void |
setUnitIncrement(double value)
Sets the value of the property unitIncrement.
|
void |
setValue(double value)
Sets the value of the property value.
|
void |
setVisibleAmount(double value)
Sets the value of the property visibleAmount.
|
DoubleProperty |
unitIncrementProperty()
|
DoubleProperty |
valueProperty()
The current value represented by this
ScrollBar . |
DoubleProperty |
visibleAmountProperty()
Visible amount of the scrollbar's range, typically represented by
the size of the scroll bar's thumb.
|
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getControlChildren, getCssMetaData, getSkin, getTooltip, isResizable, layoutChildren, loadSkinClass, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipProperty
public final DoubleProperty minProperty
ScrollBar
. This should be a
value less than or equal to max
. Default value is 0.getMin()
,
setMin(double)
public final DoubleProperty maxProperty
ScrollBar
. This should be a
value greater than or equal to min
. Default value is 100.getMax()
,
setMax(double)
public final DoubleProperty valueProperty
ScrollBar
. This value should
be between min
and max
, inclusive.getValue()
,
setValue(double)
public final <any> orientationProperty
ScrollBar
can either be HORIZONTAL
or VERTICAL
.getOrientation()
,
setOrientation(Orientation)
public final DoubleProperty unitIncrementProperty
getUnitIncrement()
,
setUnitIncrement(double)
public final DoubleProperty blockIncrementProperty
getBlockIncrement()
,
setBlockIncrement(double)
public final DoubleProperty visibleAmountProperty
getVisibleAmount()
,
setVisibleAmount(double)
private 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 <any> orientation
ScrollBar
can either be HORIZONTAL
or VERTICAL
.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()
ScrollBar
. This should be a
value less than or equal to max
. Default value is 0.getMin()
,
setMin(double)
public final void setMax(double value)
public final double getMax()
public final DoubleProperty maxProperty()
ScrollBar
. This should be a
value greater than or equal to min
. Default value is 100.getMax()
,
setMax(double)
public final void setValue(double value)
public final double getValue()
public final DoubleProperty valueProperty()
ScrollBar
. This value should
be between min
and max
, inclusive.getValue()
,
setValue(double)
public final void setOrientation(Orientation value)
public final Orientation getOrientation()
public final <any> orientationProperty()
ScrollBar
can either be HORIZONTAL
or VERTICAL
.getOrientation()
,
setOrientation(Orientation)
public final void setUnitIncrement(double value)
public final double getUnitIncrement()
public final DoubleProperty unitIncrementProperty()
getUnitIncrement()
,
setUnitIncrement(double)
public final void setBlockIncrement(double value)
public final double getBlockIncrement()
public final DoubleProperty blockIncrementProperty()
getBlockIncrement()
,
setBlockIncrement(double)
public final void setVisibleAmount(double value)
public final double getVisibleAmount()
public final DoubleProperty visibleAmountProperty()
getVisibleAmount()
,
setVisibleAmount(double)
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
.
Note: This function is intended to be used by experts, primarily
by those implementing new Skins or Behaviors. It is not common
for developers or designers to access this function directly.position
- the positionpublic void increment()
ScrollBar
by the
unitIncrement
public void decrement()
ScrollBar
by the
unitIncrement
private void blockIncrement()
private void blockDecrement()
protected Skin<?> createDefaultSkin()
-fx-skin
or set explicitly in a sub-class with setSkin(...)
.createDefaultSkin
in class Control
public static java.util.List<<any>> getClassCssMetaData()
public java.util.List<<any>> getControlCssMetaData()
getControlCssMetaData
in class Control
protected java.lang.Boolean getInitialFocusTraversable()
getInitialFocusTraversable
in class Control
public java.lang.Object queryAccessibleAttribute(AccessibleAttribute attribute, java.lang.Object... parameters)
queryAccessibleAttribute
in class Control
public void executeAccessibleAction(AccessibleAction action, java.lang.Object... parameters)
executeAccessibleAction
in class Control