Top Description Fields Constructors Methods
javafx.scene.control.skin

public Class ScrollPaneSkin

extends SkinBase<ScrollPane>
Class Inheritance
Static Imports
com.sun.javafx.scene.control.skin.Utils.boundedSize

Default skin implementation for the ScrollPane control.
Since
9
See Also
ScrollPane

Field Summary

Modifier and TypeField and Description
private final BehaviorBase<ScrollPane>
private final ChangeListener<Bounds>
pack-priv Rectangle
private double
private DoubleProperty
private DoubleProperty
pack-priv KeyFrame
pack-priv KeyFrame
pack-priv KeyFrame
pack-priv Timeline
private double
private StackPane
private static final double
private static final double
private static final double
private static final double
private boolean
pack-priv ScrollBar
private double
private boolean
private boolean
private double
private final InvalidationListener
private boolean
private double
pack-priv double
pack-priv double
private static final double
private double
private double
pack-priv double
pack-priv double
private Cursor
pack-priv KeyFrame
pack-priv KeyFrame
pack-priv Timeline
private Node
private boolean
private boolean
private StackPane
private StackPane
pack-priv ScrollBar
private boolean
private double
private final WeakChangeListener<Bounds>
private final WeakInvalidationListener

Constructor Summary

AccessConstructor and Description
public
ScrollPaneSkin(final ScrollPane
The control that this skin should be installed onto.
control
)

Creates a new ScrollPaneSkin instance, installing the necessary child nodes into the Control children list, as well as the necessary input mappings for handling key, mouse, etc events.

Method Summary

Modifier and TypeMethod and Description
private double
computeHsbSizeHint(ScrollPane sp)

Computes the size that should be reserved for horizontal scrollbar in size hints (min/pref height)

protected double
computeMinHeight(double
The width of the Skin, in case this value might dictate the minimum height.
width
,
double
the pixel snapped top inset
topInset
,
double
the pixel snapped right inset
rightInset
,
double
the pixel snapped bottom inset
bottomInset
,
double
the pixel snapped left inset
leftInset
)

Overrides javafx.scene.control.SkinBase.computeMinHeight.

Computes the minimum allowable height of the Skin, based on the provided width.

protected double
computeMinWidth(double
The height of the Skin, in case this value might dictate the minimum width.
height
,
double
the pixel snapped top inset
topInset
,
double
the pixel snapped right inset
rightInset
,
double
the pixel snapped bottom inset
bottomInset
,
double
the pixel snapped left inset
leftInset
)

Overrides javafx.scene.control.SkinBase.computeMinWidth.

Computes the minimum allowable width of the Skin, based on the provided height.

protected double
computePrefHeight(double
the width that should be used if preferred height depends on it
width
,
double
the pixel snapped top inset
topInset
,
double
the pixel snapped right inset
rightInset
,
double
the pixel snapped bottom inset
bottomInset
,
double
the pixel snapped left inset
leftInset
)

Overrides javafx.scene.control.SkinBase.computePrefHeight.

Calculates the preferred height of this SkinBase.

protected double
computePrefWidth(double
the height that should be used if preferred width depends on it
height
,
double
the pixel snapped top inset
topInset
,
double
the pixel snapped right inset
rightInset
,
double
the pixel snapped bottom inset
bottomInset
,
double
the pixel snapped left inset
leftInset
)

Overrides javafx.scene.control.SkinBase.computePrefWidth.

Calculates the preferred width of this SkinBase.

private void
private void
computeScrollNodeSize(double contentWidth, double contentHeight)

private double
computeVsbSizeHint(ScrollPane sp)

Computes the size that should be reserved for vertical scrollbar in size hints (min/pref width)

private final DoubleProperty
private final DoubleProperty
private boolean
private boolean
public void
dispose()

Overrides javafx.scene.control.SkinBase.dispose.

Implements javafx.scene.control.Skin.dispose.

Called when a previously installed skin is about to be removed from its associated control.

private final double
private final double
public final ScrollBar

Returns:

the horizontal ScrollBar used in this ScrollPaneSkin instance
getHorizontalScrollBar
()

Returns the horizontal ScrollBar used in this ScrollPaneSkin instance.

public final ScrollBar

Returns:

the vertical ScrollBar used in this ScrollPaneSkin instance
getVerticalScrollBar
()

Returns the vertical ScrollBar used in this ScrollPaneSkin instance.

private void
private boolean
protected void
layoutChildren(final double
the x position
x
,
final double
the y position
y
,
final double
the width
w
,
final double
the height
h
)

Overrides javafx.scene.control.SkinBase.layoutChildren.

Called during the layout pass of the scenegraph.

protected Object
queryAccessibleAttribute(AccessibleAttribute
the requested attribute
attribute
,
Object...
optional list of parameters
parameters
)

Overrides javafx.scene.control.SkinBase.queryAccessibleAttribute.

This method is called by the assistive technology to request the value for an attribute.

private void
pack-priv void
private final void
setContentPosX(double value)

private final void
setContentPosY(double value)

private void
private void
private void
private double
private double
private void
Inherited from javafx.scene.control.SkinBase:
computeBaselineOffsetcomputeMaxHeightcomputeMaxWidthconsumeMouseEventsexecuteAccessibleActiongetChildrengetClassCssMetaDatagetCssMetaDatagetNodegetSkinnablelayoutInArealayoutInArealayoutInAreapositionInAreapositionInAreapseudoClassStateChangedregisterChangeListenerregisterInvalidationListenerregisterListChangeListenersnappedBottomInsetsnappedLeftInsetsnappedRightInsetsnappedTopInsetsnapPositionsnapPositionXsnapPositionYsnapSizesnapSizeXsnapSizeYsnapSpacesnapSpaceXsnapSpaceYunregisterChangeListenersunregisterInvalidationListenersunregisterListChangeListeners

Field Detail

behaviorback to summary
private final BehaviorBase<ScrollPane> behavior
boundsChangeListenerback to summary
private final ChangeListener<Bounds> boundsChangeListener
clipRectback to summary
pack-priv Rectangle clipRect
contentHeightback to summary
private double contentHeight
contentPosXback to summary
private DoubleProperty contentPosX
contentPosYback to summary
private DoubleProperty contentPosY
contentsToViewKF1back to summary
pack-priv KeyFrame contentsToViewKF1
contentsToViewKF2back to summary
pack-priv KeyFrame contentsToViewKF2
contentsToViewKF3back to summary
pack-priv KeyFrame contentsToViewKF3
contentsToViewTimelineback to summary
pack-priv Timeline contentsToViewTimeline
contentWidthback to summary
private double contentWidth
cornerback to summary
private StackPane corner
DEFAULT_EMBEDDED_SB_BREADTHback to summary
private static final double DEFAULT_EMBEDDED_SB_BREADTH
DEFAULT_MIN_SIZEback to summary
private static final double DEFAULT_MIN_SIZE
DEFAULT_PREF_SIZEback to summary
private static final double DEFAULT_PREF_SIZE
DEFAULT_SB_BREADTHback to summary
private static final double DEFAULT_SB_BREADTH
dragDetectedback to summary
private boolean dragDetected
hsbback to summary
pack-priv ScrollBar hsb
hsbHeightback to summary
private double hsbHeight
hsbvisback to summary
private boolean hsbvis
mouseDownback to summary
private boolean mouseDown
nodeHeightback to summary
private double nodeHeight
nodeListenerback to summary
private final InvalidationListener nodeListener
nodeSizeInvalidback to summary
private boolean nodeSizeInvalid
nodeWidthback to summary
private double nodeWidth
ohvalueback to summary
pack-priv double ohvalue
ovvalueback to summary
pack-priv double ovvalue
PAN_THRESHOLDback to summary
private static final double PAN_THRESHOLD
posXback to summary
private double posX
posYback to summary
private double posY
pressXback to summary
pack-priv double pressX
pressYback to summary
pack-priv double pressY
saveCursorback to summary
private Cursor saveCursor
sbTouchKF1back to summary
pack-priv KeyFrame sbTouchKF1
sbTouchKF2back to summary
pack-priv KeyFrame sbTouchKF2
sbTouchTimelineback to summary
pack-priv Timeline sbTouchTimeline
scrollNodeback to summary
private Node scrollNode
tempVisibilityback to summary
private boolean tempVisibility
touchDetectedback to summary
private boolean touchDetected
viewContentback to summary
private StackPane viewContent
viewRectback to summary
private StackPane viewRect
vsbback to summary
pack-priv ScrollBar vsb
vsbvisback to summary
private boolean vsbvis
vsbWidthback to summary
private double vsbWidth
weakBoundsChangeListenerback to summary
private final WeakChangeListener<Bounds> weakBoundsChangeListener
weakNodeListenerback to summary
private final WeakInvalidationListener weakNodeListener

Constructor Detail

ScrollPaneSkinback to summary
public ScrollPaneSkin(final ScrollPane control)

Creates a new ScrollPaneSkin instance, installing the necessary child nodes into the Control children list, as well as the necessary input mappings for handling key, mouse, etc events.

Parameters
control:ScrollPane

The control that this skin should be installed onto.

Method Detail

computeHsbSizeHintback to summary
private double computeHsbSizeHint(ScrollPane sp)

Computes the size that should be reserved for horizontal scrollbar in size hints (min/pref height)

computeMinHeightback to summary
protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computeMinHeight.

Doc from javafx.scene.control.SkinBase.computeMinHeight.

Computes the minimum allowable height of the Skin, based on the provided width.

Parameters
width:double

The width of the Skin, in case this value might dictate the minimum height.

topInset:double

the pixel snapped top inset

rightInset:double

the pixel snapped right inset

bottomInset:double

the pixel snapped bottom inset

leftInset:double

the pixel snapped left inset

Returns:double

A double representing the minimum height of this Skin.

Annotations
@Override
computeMinWidthback to summary
protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computeMinWidth.

Doc from javafx.scene.control.SkinBase.computeMinWidth.

Computes the minimum allowable width of the Skin, based on the provided height.

Parameters
height:double

The height of the Skin, in case this value might dictate the minimum width.

topInset:double

the pixel snapped top inset

rightInset:double

the pixel snapped right inset

bottomInset:double

the pixel snapped bottom inset

leftInset:double

the pixel snapped left inset

Returns:double

A double representing the minimum width of this Skin.

Annotations
@Override
computePrefHeightback to summary
protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computePrefHeight.

Doc from javafx.scene.control.SkinBase.computePrefHeight.

Calculates the preferred height of this SkinBase. The default implementation calculates this height as the height of the area occupied by its managed children when they are positioned at their current positions at their preferred heights.

Parameters
width:double

the width that should be used if preferred height depends on it

topInset:double

the pixel snapped top inset

rightInset:double

the pixel snapped right inset

bottomInset:double

the pixel snapped bottom inset

leftInset:double

the pixel snapped left inset

Returns:double

the calculated preferred height

Annotations
@Override
computePrefWidthback to summary
protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computePrefWidth.

Doc from javafx.scene.control.SkinBase.computePrefWidth.

Calculates the preferred width of this SkinBase. The default implementation calculates this width as the width of the area occupied by its managed children when they are positioned at their current positions at their preferred widths.

Parameters
height:double

the height that should be used if preferred width depends on it

topInset:double

the pixel snapped top inset

rightInset:double

the pixel snapped right inset

bottomInset:double

the pixel snapped bottom inset

leftInset:double

the pixel snapped left inset

Returns:double

the calculated preferred width

Annotations
@Override
computeScrollBarSizeback to summary
private void computeScrollBarSize()
computeScrollNodeSizeback to summary
private void computeScrollNodeSize(double contentWidth, double contentHeight)
computeVsbSizeHintback to summary
private double computeVsbSizeHint(ScrollPane sp)

Computes the size that should be reserved for vertical scrollbar in size hints (min/pref width)

contentPosXPropertyback to summary
private final DoubleProperty contentPosXProperty()
contentPosYPropertyback to summary
private final DoubleProperty contentPosYProperty()
determineHorizontalSBVisibleback to summary
private boolean determineHorizontalSBVisible()
determineVerticalSBVisibleback to summary
private boolean determineVerticalSBVisible()
disposeback to summary
public void dispose()

Overrides javafx.scene.control.SkinBase.dispose.

Implements javafx.scene.control.Skin.dispose.

Doc from javafx.scene.control.SkinBase.dispose.

Called when a previously installed skin is about to be removed from its associated control. This allows the skin to do clean up, like removing listeners and bindings, and undo any changes to the control's properties. After this method completes, getSkinnable() and getNode() should return null.

Calling dispose() more than once has no effect.

Annotations
@Override
getContentPosXback to summary
private final double getContentPosX()
getContentPosYback to summary
private final double getContentPosY()
getHorizontalScrollBarback to summary
public final ScrollBar getHorizontalScrollBar()

Returns the horizontal ScrollBar used in this ScrollPaneSkin instance.

Returns:ScrollBar

the horizontal ScrollBar used in this ScrollPaneSkin instance

getVerticalScrollBarback to summary
public final ScrollBar getVerticalScrollBar()

Returns the vertical ScrollBar used in this ScrollPaneSkin instance.

Returns:ScrollBar

the vertical ScrollBar used in this ScrollPaneSkin instance

initializeback to summary
private void initialize()
isReverseNodeOrientationback to summary
private boolean isReverseNodeOrientation()
layoutChildrenback to summary
protected void layoutChildren(final double x, final double y, final double w, final double h)

Overrides javafx.scene.control.SkinBase.layoutChildren.

Doc from javafx.scene.control.SkinBase.layoutChildren.

Called during the layout pass of the scenegraph.

Parameters
x:double

the x position

y:double

the y position

w:double

the width

h:double

the height

Annotations
@Override
queryAccessibleAttributeback to summary
protected Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)

Overrides javafx.scene.control.SkinBase.queryAccessibleAttribute.

Doc from javafx.scene.control.SkinBase.queryAccessibleAttribute.

This method is called by the assistive technology to request the value for an attribute.

This method is commonly overridden by subclasses to implement attributes that are required for a specific role.
If a particular attribute is not handled, the superclass implementation must be called.

Parameters
attribute:AccessibleAttribute

the requested attribute

parameters:Object[]

optional list of parameters

Returns:Object

the value for the requested attribute

Annotations
@Override
resetClipback to summary
private void resetClip()
scrollBoundsIntoViewback to summary
pack-priv void scrollBoundsIntoView(Bounds b)
setContentPosXback to summary
private final void setContentPosX(double value)
setContentPosYback to summary
private final void setContentPosY(double value)
startContentsToViewportback to summary
private void startContentsToViewport()
startSBReleasedAnimationback to summary
private void startSBReleasedAnimation()
updateHorizontalSBback to summary
private void updateHorizontalSB()
updatePosXback to summary
private double updatePosX()
updatePosYback to summary
private double updatePosY()
updateVerticalSBback to summary
private void updateVerticalSB()