APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javafx.scene.control

public abstract Class SkinBase<C extends Control>

extends Object
implements Skin<C extends Control>
Class Inheritance
All Implemented Interfaces
javafx.scene.control.Skin
Known Direct Subclasses
javafx.scene.control.skin.LabeledSkinBase, javafx.scene.control.skin.SpinnerSkin, javafx.scene.control.skin.AccordionSkin, javafx.scene.control.skin.ButtonBarSkin, javafx.scene.control.skin.ChoiceBoxSkin, javafx.scene.control.skin.ComboBoxBaseSkin, javafx.scene.control.skin.MenuBarSkin, javafx.scene.control.skin.MenuButtonSkinBase, javafx.scene.control.skin.PaginationSkin, javafx.scene.control.skin.ProgressIndicatorSkin, javafx.scene.control.skin.ScrollBarSkin, javafx.scene.control.skin.ScrollPaneSkin, javafx.scene.control.skin.SeparatorSkin, javafx.scene.control.skin.SliderSkin, javafx.scene.control.skin.SplitPaneSkin, javafx.scene.control.skin.TabPaneSkin, javafx.scene.control.skin.TextInputControlSkin, javafx.scene.control.skin.ToolBarSkin, javafx.scene.control.skin.VirtualContainerBase, com.sun.javafx.scene.control.skin.FXVKSkin
Type Parameters
<C>
the type of the control
Imports
java.util.Collections, .List, java.util.function.Consumer, javafx.beans.Observable, javafx.beans.value.ObservableValue, javafx.collections.ListChangeListener.Change, .ObservableList, javafx.css.CssMetaData, .PseudoClass, .Styleable, javafx.event.EventHandler, javafx.geometry.HPos, .Insets, .VPos, javafx.scene.AccessibleAction, .AccessibleAttribute, .Node, javafx.scene.input.MouseEvent, javafx.scene.layout.Region, com.sun.javafx.scene.control.LambdaMultiplePropertyChangeListenerHandler, .ListenerHelper

Base implementation class for defining the visual representation of user interface controls by defining a scene graph of nodes to represent the skin. A user interface control is abstracted behind the Skinnable interface.
Since
JavaFX 8.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private ObservableList<Node>
children

A local field that directly refers to the children list inside the Control.

private C
control

The Control that is referencing this Skin.

private LambdaMultiplePropertyChangeListenerHandler
lambdaChangeListenerHandler

This is part of the workaround introduced during delomboking.

private ListenerHelper
private static final EventHandler<MouseEvent>
mouseEventConsumer

Mouse handler used for consuming all mouse events (preventing them from bubbling up to parent)

Constructor Summary

AccessConstructor and Description
protected
SkinBase(final C
The control for which this Skin should attach to.
control
)

Constructor for all SkinBase instances.

Method Summary

Modifier and TypeMethod and Description
protected double

Returns:

baseline offset
computeBaselineOffset
(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
)

Calculates the baseline offset based on the first managed child.

protected double

Returns:

A double representing the maximum height of this Skin.
computeMaxHeight
(double
The width of the Skin, in case this value might dictate the maximum 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
)

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

protected double

Returns:

A double representing the maximum width of this Skin.
computeMaxWidth
(double
The height of the Skin, in case this value might dictate the maximum 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
)

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

protected double

Returns:

A double representing the minimum height of this Skin.
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
)

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

protected double

Returns:

A double representing the minimum width of this Skin.
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
)

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

protected double

Returns:

the calculated preferred height
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
)

Calculates the preferred height of this SkinBase.

protected double

Returns:

the calculated preferred width
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
)

Calculates the preferred width of this SkinBase.

protected final void
consumeMouseEvents(boolean
the consume mouse events flag
value
)

Determines whether all mouse events should be automatically consumed.

public void
dispose()

Implements javafx.scene.control.Skin.dispose.

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

protected void
executeAccessibleAction(AccessibleAction
the action to execute
action
,
Object...
optional list of parameters
parameters
)

This method is called by the assistive technology to request the action indicated by the argument should be executed.

public final ObservableList<Node>

Returns:

the children of the skin
getChildren
()

Returns the children of the skin.

public static List<CssMetaData<? extends Styleable, ?>>

Returns:

the CssMetaData associated with this class, which may include the CssMetaData of its superclasses
getClassCssMetaData
()

Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

public List<CssMetaData<? extends Styleable, ?>>

Returns:

The CssMetaData associated with this node, which may include the CssMetaData of its superclasses.
getCssMetaData
()

This method should delegate to Node#getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.

public final Node
getNode()

Implements javafx.scene.control.Skin.getNode.

Gets the Node which represents this Skin.

public final C
getSkinnable()

Implements javafx.scene.control.Skin.getSkinnable.

Gets the Skinnable to which this Skin is assigned.

protected void
layoutChildren(final double
the x position
contentX
,
final double
the y position
contentY
,
final double
the width
contentWidth
,
final double
the height
contentHeight
)

Called during the layout pass of the scenegraph.

protected void
layoutInArea(Node
the child being positioned within this skin
child
,
double
the horizontal offset of the layout area relative to this skin
areaX
,
double
the vertical offset of the layout area relative to this skin
areaY
,
double
the width of the layout area
areaWidth
,
double
the height of the layout area
areaHeight
,
double
the baseline offset to be used if VPos is BASELINE
areaBaselineOffset
,
HPos
the horizontal alignment for the child within the area
halignment
,
VPos
the vertical alignment for the child within the area
valignment
)

Utility method which lays out the child within an area of this skin defined by areaX, areaY, areaWidth x areaHeight, with a baseline offset relative to that area.

protected void
layoutInArea(Node
the child being positioned within this skin
child
,
double
the horizontal offset of the layout area relative to this skin
areaX
,
double
the vertical offset of the layout area relative to this skin
areaY
,
double
the width of the layout area
areaWidth
,
double
the height of the layout area
areaHeight
,
double
the baseline offset to be used if VPos is BASELINE
areaBaselineOffset
,
Insets
the margin of space to be allocated around the child
margin
,
HPos
the horizontal alignment for the child within the area
halignment
,
VPos
the vertical alignment for the child within the area
valignment
)

Utility method which lays out the child within an area of this skin defined by areaX, areaY, areaWidth x areaHeight, with a baseline offset relative to that area.

protected void
layoutInArea(Node
the child being positioned within this skin
child
,
double
the horizontal offset of the layout area relative to this skin
areaX
,
double
the vertical offset of the layout area relative to this skin
areaY
,
double
the width of the layout area
areaWidth
,
double
the height of the layout area
areaHeight
,
double
the baseline offset to be used if VPos is BASELINE
areaBaselineOffset
,
Insets
the margin of space to be allocated around the child
margin
,
boolean
whether or not the child should be resized to fill the area width or kept to its preferred width
fillWidth
,
boolean
whether or not the child should e resized to fill the area height or kept to its preferred height
fillHeight
,
HPos
the horizontal alignment for the child within the area
halignment
,
VPos
the vertical alignment for the child within the area
valignment
)

Utility method which lays out the child within an area of this skin defined by areaX, areaY, areaWidth x areaHeight, with a baseline offset relative to that area.

pack-priv ListenerHelper
listenerHelper()

Returns the skin's instance of ListenerHelper, creating it if necessary.

protected void
positionInArea(Node
the child being positioned within this skin
child
,
double
the horizontal offset of the layout area relative to this skin
areaX
,
double
the vertical offset of the layout area relative to this skin
areaY
,
double
the width of the layout area
areaWidth
,
double
the height of the layout area
areaHeight
,
double
the baseline offset to be used if VPos is BASELINE
areaBaselineOffset
,
HPos
the horizontal alignment for the child within the area
halignment
,
VPos
the vertical alignment for the child within the area
valignment
)

Utility method which positions the child within an area of this skin defined by areaX, areaY, areaWidth x areaHeight, with a baseline offset relative to that area.

protected void
positionInArea(Node
the child being positioned within this skin
child
,
double
the horizontal offset of the layout area relative to this skin
areaX
,
double
the vertical offset of the layout area relative to this skin
areaY
,
double
the width of the layout area
areaWidth
,
double
the height of the layout area
areaHeight
,
double
the baseline offset to be used if VPos is BASELINE
areaBaselineOffset
,
Insets
the margin of space to be allocated around the child
margin
,
HPos
the horizontal alignment for the child within the area
halignment
,
VPos
the vertical alignment for the child within the area
valignment
)

Utility method which positions the child within an area of this skin defined by areaX, areaY, areaWidth x areaHeight, with a baseline offset relative to that area.

public final void
pseudoClassStateChanged(PseudoClass
the pseudo-class that has changed state
pseudoClass
,
boolean
whether or not the state is active
active
)

Used to specify that a pseudo-class of this Node has changed.

protected Object

Returns:

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

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

protected final void
registerChangeListener(ObservableValue<?>
the observable to observe for change events, may be null
observable
,
Consumer<ObservableValue<?>>
the operation to perform when the observable sends a change event, may be null
operation
)

Registers an operation to perform when the given observable sends a change event.

protected final void
registerInvalidationListener(Observable
the observable to observe for invalidation events, may be null
observable
,
Consumer<Observable>
the operation to perform when the observable sends an invalidation event, may be null
operation
)

Registers an operation to perform when the given observable sends an invalidation event.

protected final void
registerListChangeListener(ObservableList<?>
the observableList to observe for list change events, may be null
observableList
,
Consumer<ListChangeListener.Change<?>>
the operation to perform when the observableList sends a list change event, may be null
operation
)

Registers an operation to perform when the given observableList sends a list change event.

protected double

Returns:

Rounded up insets bottom
snappedBottomInset
()

Utility method to get the bottom inset which includes padding and border inset.

protected double

Returns:

Rounded up insets left
snappedLeftInset
()

Utility method to get the left inset which includes padding and border inset.

protected double

Returns:

Rounded up insets right
snappedRightInset
()

Utility method to get the right inset which includes padding and border inset.

protected double

Returns:

Rounded up insets top
snappedTopInset
()

Utility method to get the top inset which includes padding and border inset.

protected double

Returns:

value rounded to nearest pixel
snapPosition
(double
the position value to be snapped
value
)
Deprecated since 9. replaced by snapPositionX() and snapPositionY()

If getSkinnable().isSnapToPixel() is false, this method returns the same value, else it tries to return a value rounded to the nearest pixel, but since there is no indication if the value is a vertical or horizontal measurement then it may be snapped to the wrong pixel size metric on screens with different horizontal and vertical scales.

protected double

Returns:

value rounded to nearest pixel
snapPositionX
(double
the position value to be snapped
value
)

Convenience method for accessing the snapPositionX() method on the skinnable.

protected double

Returns:

value rounded to nearest pixel
snapPositionY
(double
the position value to be snapped
value
)

Convenience method for accessing the snapPositionY() method on the skinnable.

protected double

Returns:

value ceiled to nearest pixel
snapSize
(double
the size value to be snapped
value
)
Deprecated since 9. replaced by snapSizeX() and snapSizeY()

If getSkinnable().isSnapToPixel() is false, this method returns the same value, else it tries to return a value ceiled to the nearest pixel, but since there is no indication if the value is a vertical or horizontal measurement then it may be snapped to the wrong pixel size metric on screens with different horizontal and vertical scales.

protected double

Returns:

value ceiled to nearest pixel
snapSizeX
(double
the size value to be snapped
value
)

Convenience method for accessing the snapSizeX() method on the skinnable.

protected double

Returns:

value ceiled to nearest pixel
snapSizeY
(double
the size value to be snapped
value
)

Convenience method for accessing the snapSizeY() method on the skinnable.

protected double

Returns:

value rounded to nearest pixel
snapSpace
(double
the space value to be snapped
value
)
Deprecated since 9. replaced by snapSpaceX() and snapSpaceY()

If getSkinnable().isSnapToPixel() is false, this method returns the same value, else it tries to return a value rounded to the nearest pixel, but since there is no indication if the value is a vertical or horizontal measurement then it may be snapped to the wrong pixel size metric on screens with different horizontal and vertical scales.

protected double

Returns:

value rounded to nearest pixel
snapSpaceX
(double
the space value to be snapped
value
)

Convenience method for accessing the snapSpaceX() method on the skinnable.

protected double

Returns:

value rounded to nearest pixel
snapSpaceY
(double
the space value to be snapped
value
)

Convenience method for accessing the snapSpaceY() method on the skinnable.

protected final Consumer<ObservableValue<?>>

Returns:

a composed consumer representing all previously registered operations, or null if none have been registered or the observable is null
unregisterChangeListeners
(ObservableValue<?>
the observable for which the registered operations should be removed, may be null
observable
)

Unregisters all operations that have been registered using registerChangeListener(ObservableValue, Consumer) for the given observable.

protected final Consumer<Observable>

Returns:

a composed consumer representing all previously registered operations, or null if none have been registered or the observable is null
unregisterInvalidationListeners
(Observable
the observable for which the registered operations should be removed, may be null
observable
)

Unregisters all operations that have been registered using registerInvalidationListener(Observable, Consumer) for the given observable.

protected final Consumer<ListChangeListener.Change<?>>

Returns:

a composed consumer representing all previously registered operations, or null if none have been registered or the observableList is null
unregisterListChangeListeners
(ObservableList<?>
the observableList for which the registered operations should be removed, may be null
observableList
)

Unregisters all operations that have been registered using registerListChangeListener(ObservableList, Consumer) for the given observableList.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait