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

public Class SplitPaneSkin

extends SkinBase<SplitPane>
Class Inheritance
Imports
java.util.ArrayList, .Iterator, .List, .ListIterator, javafx.beans.value.ChangeListener, .ObservableValue, javafx.collections.FXCollections, .ListChangeListener, .ObservableList, javafx.geometry.HPos, .NodeOrientation, .Orientation, .VPos, javafx.scene.Cursor, .Node, javafx.scene.control.Control, .SkinBase, .SplitPane, javafx.scene.input.MouseEvent, javafx.scene.layout.StackPane, javafx.scene.shape.Rectangle, com.sun.javafx.scene.control.ListenerHelper

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv class
pack-priv class

Field Summary

Modifier and TypeField and Description
private boolean
private ListenerHelper
private ObservableList<SplitPaneSkin.ContentDivider>
private ObservableList<SplitPaneSkin.Content>
private boolean
duringLayout

Flag which is used to determine whether we need to request layout when a divider position changed or not.

private boolean
private int
private double
private boolean

Constructor Summary

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

Creates a new SplitPaneSkin 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 void
addContent(int index, Node n)

private void
private void
checkDividerPosition(SplitPaneSkin.ContentDivider divider, double newPos, double oldPos)

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.

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 double
distributeFrom(double size, List<SplitPaneSkin.Content> available)

private double
distributeTo(List<SplitPaneSkin.Content> available, double size)

private double
private SplitPaneSkin.Content
private SplitPaneSkin.Content
private double
private void
private void
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.

private void
layoutDividersAndContent(double width, double height)

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

Field Detail

checkDividerPosback to summary
private boolean checkDividerPos
contentDividerListenerHelperback to summary
private ListenerHelper contentDividerListenerHelper
contentDividersback to summary
private ObservableList<SplitPaneSkin.ContentDivider> contentDividers
contentRegionsback to summary
private ObservableList<SplitPaneSkin.Content> contentRegions
duringLayoutback to summary
private boolean duringLayout

Flag which is used to determine whether we need to request layout when a divider position changed or not. E.g. We don't want to request layout when we are changing the divider position in layoutChildren(double, double, double, double) since we are currently doing the layout. See also: JDK-8277122

horizontalback to summary
private boolean horizontal
lastDividerUpdateback to summary
private int lastDividerUpdate
previousSizeback to summary
private double previousSize
resizeback to summary
private boolean resize

Constructor Detail

SplitPaneSkinback to summary
public SplitPaneSkin(final SplitPane control)

Creates a new SplitPaneSkin 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:SplitPane

The control that this skin should be installed onto.

Method Detail

addContentback to summary
private void addContent(int index, Node n)
addDividersback to summary
private void addDividers()
checkDividerPositionback to summary
private void checkDividerPosition(SplitPaneSkin.ContentDivider divider, double newPos, double oldPos)
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
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
distributeFromback to summary
private double distributeFrom(double size, List<SplitPaneSkin.Content> available)
distributeToback to summary
private double distributeTo(List<SplitPaneSkin.Content> available, double size)
getAbsoluteDividerPosback to summary
private double getAbsoluteDividerPos(SplitPaneSkin.ContentDivider divider)
getLeftback to summary
private SplitPaneSkin.Content getLeft(SplitPaneSkin.ContentDivider d)
getRightback to summary
private SplitPaneSkin.Content getRight(SplitPaneSkin.ContentDivider d)
getSizeback to summary
private double getSize()
initializeContentListenerback to summary
private void initializeContentListener()
initializeDividerEventHandlersback to summary
private void initializeDividerEventHandlers(final SplitPaneSkin.ContentDivider divider)
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
layoutDividersAndContentback to summary
private void layoutDividersAndContent(double width, double height)
posToDividerPosback to summary
private double posToDividerPos(SplitPaneSkin.ContentDivider divider, double pos)
removeAllDividersback to summary
private void removeAllDividers()
removeContentback to summary
private void removeContent(Node n)
setAbsoluteDividerPosback to summary
private void setAbsoluteDividerPos(SplitPaneSkin.ContentDivider divider, double value)
setAndCheckAbsoluteDividerPosback to summary
private void setAndCheckAbsoluteDividerPos(SplitPaneSkin.ContentDivider divider, double value)
setupContentAndDividerForLayoutback to summary
private void setupContentAndDividerForLayout()
totalMinSizeback to summary
private double totalMinSize()
javafx.scene.control.skin back to summary

pack-priv Class SplitPaneSkin.Content

extends StackPane
Class Inheritance

Field Summary

Modifier and TypeField and Description
private double
private double
private Rectangle
private Node
private double
private double
x

private double
y

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected double
computeMaxHeight(double
The width of the Region, in case this value might dictate the maximum height
width
)

Overrides javafx.scene.layout.Region.computeMaxHeight.

Computes the maximum height of this region.

protected double
computeMaxWidth(double
The height of the Region, in case this value might dictate the maximum width
height
)

Overrides javafx.scene.layout.Region.computeMaxWidth.

Computes the maximum width for this region.

private void
public double
public double
public Node
public double
public double
getX()

public double
getY()

public boolean
public void
setArea(double area)

public void
setAvailable(double available)

protected void
setClipSize(double w, double h)

public void
setResizableWithParentArea(double resizableWithParentArea)

public void
setX(double x)

public void
setY(double y)

Inherited from javafx.scene.layout.StackPane:
alignmentPropertyclearConstraintscomputeMinHeightcomputeMinWidthcomputePrefHeightcomputePrefWidthgetAlignmentgetAlignmentgetClassCssMetaDatagetContentBiasgetCssMetaDatagetMarginlayoutChildrenrequestLayoutsetAlignmentsetAlignmentsetMargin

Field Detail

areaback to summary
private double area
availableback to summary
private double available
clipRectback to summary
private Rectangle clipRect
contentback to summary
private Node content
resizableWithParentAreaback to summary
private double resizableWithParentArea
xback to summary
private double x
yback to summary
private double y

Constructor Detail

Contentback to summary
public Content(Node n)

Method Detail

computeMaxHeightback to summary
protected double computeMaxHeight(double width)

Overrides javafx.scene.layout.Region.computeMaxHeight.

Doc from javafx.scene.layout.Region.computeMaxHeight.

Computes the maximum height of this region. Returns Double.MAX_VALUE by default. Region subclasses may override this method to return a different value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.

Parameters
width:double

The width of the Region, in case this value might dictate the maximum height

Returns:double

the computed maximum height for this region

Annotations
@Override
computeMaxWidthback to summary
protected double computeMaxWidth(double height)

Overrides javafx.scene.layout.Region.computeMaxWidth.

Doc from javafx.scene.layout.Region.computeMaxWidth.

Computes the maximum width for this region. Returns Double.MAX_VALUE by default. Region subclasses may override this method to return an different value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.

Parameters
height:double

The height of the Region, in case this value might dictate the maximum width

Returns:double

the computed maximum width for this region

Annotations
@Override
disposeback to summary
private void dispose()
getAreaback to summary
public double getArea()
getAvailableback to summary
public double getAvailable()
getContentback to summary
public Node getContent()
getResizableWithParentAreaback to summary
public double getResizableWithParentArea()
getXback to summary
public double getX()
getYback to summary
public double getY()
isResizableWithParentback to summary
public boolean isResizableWithParent()
setAreaback to summary
public void setArea(double area)
setAvailableback to summary
public void setAvailable(double available)
setClipSizeback to summary
protected void setClipSize(double w, double h)
setResizableWithParentAreaback to summary
public void setResizableWithParentArea(double resizableWithParentArea)
setXback to summary
public void setX(double x)
setYback to summary
public void setY(double y)
javafx.scene.control.skin back to summary

pack-priv Class SplitPaneSkin.ContentDivider

extends StackPane
Class Inheritance

Field Summary

Modifier and TypeField and Description
private SplitPane.Divider
d

private double
private StackPane
private double
private boolean
private double
private double
x

private double
y

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected double
computeMaxHeight(double
The width of the Region, in case this value might dictate the maximum height
width
)

Overrides javafx.scene.layout.Region.computeMaxHeight.

Computes the maximum height of this region.

protected double
computeMaxWidth(double
The height of the Region, in case this value might dictate the maximum width
height
)

Overrides javafx.scene.layout.Region.computeMaxWidth.

Computes the maximum width for this region.

protected double
computeMinHeight(double
the width that should be used if min height depends on it
width
)

Overrides javafx.scene.layout.StackPane.computeMinHeight.

Computes the minimum height of this region.

protected double
computeMinWidth(double
the height that should be used if min width depends on it
height
)

Overrides javafx.scene.layout.StackPane.computeMinWidth.

Computes the minimum width of this region.

protected double
computePrefHeight(double
the width that should be used if preferred height depends on it
width
)

Overrides javafx.scene.layout.StackPane.computePrefHeight.

Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy.

protected double
computePrefWidth(double
the height that should be used if preferred width depends on it
height
)

Overrides javafx.scene.layout.StackPane.computePrefWidth.

Computes the preferred width of this region for the given height.

public SplitPane.Divider
public double
public double
public double
public double
getX()

public double
getY()

protected void
layoutChildren()

Overrides javafx.scene.layout.StackPane.layoutChildren.

Invoked during the layout pass to layout the children in this Parent.

public void
setDividerPos(double dividerPos)

public final void
setGrabberStyle(boolean horizontal)

public void
setInitialPos(double initialPos)

public void
setPressPos(double pressPos)

public void
setX(double x)

public void
setY(double y)

Inherited from javafx.scene.layout.StackPane:
alignmentPropertyclearConstraintsgetAlignmentgetAlignmentgetClassCssMetaDatagetContentBiasgetCssMetaDatagetMarginrequestLayoutsetAlignmentsetAlignmentsetMargin

Field Detail

dback to summary
private SplitPane.Divider d
dividerPosback to summary
private double dividerPos
grabberback to summary
private StackPane grabber
initialPosback to summary
private double initialPos
posExplicitback to summary
private boolean posExplicit
pressPosback to summary
private double pressPos
xback to summary
private double x
yback to summary
private double y

Constructor Detail

ContentDividerback to summary
public ContentDivider(SplitPane.Divider d)

Method Detail

computeMaxHeightback to summary
protected double computeMaxHeight(double width)

Overrides javafx.scene.layout.Region.computeMaxHeight.

Doc from javafx.scene.layout.Region.computeMaxHeight.

Computes the maximum height of this region. Returns Double.MAX_VALUE by default. Region subclasses may override this method to return a different value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.

Parameters
width:double

The width of the Region, in case this value might dictate the maximum height

Returns:double

the computed maximum height for this region

Annotations
@Override
computeMaxWidthback to summary
protected double computeMaxWidth(double height)

Overrides javafx.scene.layout.Region.computeMaxWidth.

Doc from javafx.scene.layout.Region.computeMaxWidth.

Computes the maximum width for this region. Returns Double.MAX_VALUE by default. Region subclasses may override this method to return an different value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.

Parameters
height:double

The height of the Region, in case this value might dictate the maximum width

Returns:double

the computed maximum width for this region

Annotations
@Override
computeMinHeightback to summary
protected double computeMinHeight(double width)

Overrides javafx.scene.layout.StackPane.computeMinHeight.

Doc from javafx.scene.layout.Region.computeMinHeight.

Computes the minimum height of this region. Returns the sum of the top and bottom insets by default. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.

Parameters
width:double

Doc from javafx.scene.Parent.computeMinHeight.

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

Returns:double

the computed minimum height for this region

Annotations
@Override
computeMinWidthback to summary
protected double computeMinWidth(double height)

Overrides javafx.scene.layout.StackPane.computeMinWidth.

Doc from javafx.scene.layout.Region.computeMinWidth.

Computes the minimum width of this region. Returns the sum of the left and right insets by default. region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.

Parameters
height:double

Doc from javafx.scene.Parent.computeMinWidth.

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

Returns:double

the computed minimum width of this region

Annotations
@Override
computePrefHeightback to summary
protected double computePrefHeight(double width)

Overrides javafx.scene.layout.StackPane.computePrefHeight.

Doc from javafx.scene.layout.Region.computePrefHeight.

Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.

Parameters
width:double

Doc from javafx.scene.Parent.computePrefHeight.

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

Returns:double

the computed preferred height for this region

Annotations
@Override
computePrefWidthback to summary
protected double computePrefWidth(double height)

Overrides javafx.scene.layout.StackPane.computePrefWidth.

Doc from javafx.scene.layout.Region.computePrefWidth.

Computes the preferred width of this region for the given height. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.

Parameters
height:double

Doc from javafx.scene.Parent.computePrefWidth.

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

Returns:double

the computed preferred width for this region

Annotations
@Override
getDividerback to summary
public SplitPane.Divider getDivider()
getDividerPosback to summary
public double getDividerPos()
getInitialPosback to summary
public double getInitialPos()
getPressPosback to summary
public double getPressPos()
getXback to summary
public double getX()
getYback to summary
public double getY()
layoutChildrenback to summary
protected void layoutChildren()

Overrides javafx.scene.layout.StackPane.layoutChildren.

Doc from javafx.scene.Parent.layoutChildren.

Invoked during the layout pass to layout the children in this Parent. By default it will only set the size of managed, resizable content to their preferred sizes and does not do any node positioning.

Subclasses should override this function to layout content as needed.

Annotations
@Override
setDividerPosback to summary
public void setDividerPos(double dividerPos)
setGrabberStyleback to summary
public final void setGrabberStyle(boolean horizontal)
setInitialPosback to summary
public void setInitialPos(double initialPos)
setPressPosback to summary
public void setPressPos(double pressPos)
setXback to summary
public void setX(double x)
setYback to summary
public void setY(double y)
javafx.scene.control.skin back to summary

pack-priv Class SplitPaneSkin.PosPropertyListener

extends Object
implements ChangeListener<Number>
Class Inheritance
All Implemented Interfaces
javafx.beans.value.ChangeListener

Field Summary

Modifier and TypeField and Description
pack-priv SplitPaneSkin.ContentDivider

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
changed(ObservableValue<? extends Number>
The ObservableValue which value changed
observable
,
Number
The old value
oldValue
,
Number
The new value
newValue
)

Implements javafx.beans.value.ChangeListener.changed.

Called when the value of an ObservableValue changes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dividerback to summary
pack-priv SplitPaneSkin.ContentDivider divider

Constructor Detail

PosPropertyListenerback to summary
public PosPropertyListener(SplitPaneSkin.ContentDivider divider)

Method Detail

changedback to summary
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue)

Implements javafx.beans.value.ChangeListener.changed.

Doc from javafx.beans.value.ChangeListener.changed.

Called when the value of an ObservableValue changes.

In general, it is considered bad practice to modify the observed value in this method.

Parameters
observable:ObservableValue<? extends Number>

The ObservableValue which value changed

oldValue:Number

The old value

newValue:Number

The new value

Annotations
@Override