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

public Class CheckBoxSkin

extends LabeledSkinBase<CheckBox>
Class Inheritance
Imports
com.sun.javafx.scene.control.behavior.BehaviorBase, .ButtonBehavior, com.sun.javafx.scene.control.skin.Utils, javafx.scene.control.CheckBox, .Control, javafx.scene.layout.StackPane, javafx.geometry.NodeOrientation

Default skin implementation for the tri-state CheckBox control.
Since
9
See Also
CheckBox

Field Summary

Modifier and TypeField and Description
private final BehaviorBase<CheckBox>
private final StackPane
private StackPane
Inherited from javafx.scene.control.skin.LabeledSkinBase:
ellipsisWidthgraphicgraphicPropertyChangedListenerinvalidTexttexttextWidth

Constructor Summary

AccessConstructor and Description
public
CheckBoxSkin(CheckBox
The control that this skin should be installed onto.
control
)

Creates a new CheckBoxSkin 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
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.skin.LabeledSkinBase.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.skin.LabeledSkinBase.computeMinWidth.

Compute and return the minimum width of this Labeled.

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.skin.LabeledSkinBase.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.skin.LabeledSkinBase.computePrefWidth.

Calculates the preferred width of this SkinBase.

public void
dispose()

Overrides javafx.scene.control.skin.LabeledSkinBase.dispose.

Implements javafx.scene.control.Skin.dispose.

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

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.skin.LabeledSkinBase.layoutChildren.

The Layout algorithm works like this: - Get the labeled w/h, graphic w/h, text w/h - Compute content w/h based on graphicVPos, graphicHPos, graphicTextGap, and graphic w/h and text w/h - (Note that the text content has been pre-truncated where necessary) - compute content x/y based on content w/h and labeled w/h and the labeled's hpos and vpos - position the graphic and text

protected void
updateChildren()

Overrides javafx.scene.control.skin.LabeledSkinBase.updateChildren.

Updates the children managed by LabeledSkinBase, which can be the Labeled graphic and/or a Text node.

Inherited from javafx.scene.control.skin.LabeledSkinBase:
bottomLabelPaddingcomputeBaselineOffsetcomputeMaxHeightcomputeMaxWidthisIgnoreGraphicisIgnoreTextlayoutLabelInArealayoutLabelInArealeftLabelPaddingmnemonicTargetChangedqueryAccessibleAttributerightLabelPaddingtopLabelPaddingupdateDisplayedText

Field Detail

behaviorback to summary
private final BehaviorBase<CheckBox> behavior
boxback to summary
private final StackPane box
innerboxback to summary
private StackPane innerbox

Constructor Detail

CheckBoxSkinback to summary
public CheckBoxSkin(CheckBox control)

Creates a new CheckBoxSkin 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:CheckBox

The control that this skin should be installed onto.

Method Detail

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

Overrides javafx.scene.control.skin.LabeledSkinBase.computeMinHeight.

Doc from javafx.scene.control.skin.LabeledSkinBase.computeMinHeight.

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

Parameters
width:double

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

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

topInset:double

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

the pixel snapped top inset

rightInset:double

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

the pixel snapped right inset

bottomInset:double

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

the pixel snapped bottom inset

leftInset:double

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

the pixel snapped left inset

Returns:double

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

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.skin.LabeledSkinBase.computeMinWidth.

Doc from javafx.scene.control.skin.LabeledSkinBase.computeMinWidth.

Compute and return the minimum width of this Labeled. The minimum width is the smaller of the width of "..." and the width with the actual text. In this way, if the text width itself is smaller than the ellipsis then we should use that as the min width, otherwise the ellipsis needs to be the min width.

We use the same calculation here regardless of whether we are talking about a single or multiline labeled. So a multiline labeled may find that the width of the "..." is as small as it will ever get.

Parameters
height:double

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

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

topInset:double

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

the pixel snapped top inset

rightInset:double

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

the pixel snapped right inset

bottomInset:double

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

the pixel snapped bottom inset

leftInset:double

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

the pixel snapped left inset

Returns:double

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

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.skin.LabeledSkinBase.computePrefHeight.

Doc from javafx.scene.control.skin.LabeledSkinBase.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

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

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

topInset:double

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

the pixel snapped top inset

rightInset:double

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

the pixel snapped right inset

bottomInset:double

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

the pixel snapped bottom inset

leftInset:double

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

the pixel snapped left inset

Returns:double

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

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.skin.LabeledSkinBase.computePrefWidth.

Doc from javafx.scene.control.skin.LabeledSkinBase.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

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

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

topInset:double

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

the pixel snapped top inset

rightInset:double

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

the pixel snapped right inset

bottomInset:double

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

the pixel snapped bottom inset

leftInset:double

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

the pixel snapped left inset

Returns:double

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

the calculated preferred width

Annotations
@Override
disposeback to summary
public void dispose()

Overrides javafx.scene.control.skin.LabeledSkinBase.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
layoutChildrenback to summary
protected void layoutChildren(final double x, final double y, final double w, final double h)

Overrides javafx.scene.control.skin.LabeledSkinBase.layoutChildren.

Doc from javafx.scene.control.skin.LabeledSkinBase.layoutChildren.

The Layout algorithm works like this: - Get the labeled w/h, graphic w/h, text w/h - Compute content w/h based on graphicVPos, graphicHPos, graphicTextGap, and graphic w/h and text w/h - (Note that the text content has been pre-truncated where necessary) - compute content x/y based on content w/h and labeled w/h and the labeled's hpos and vpos - position the graphic and text

Parameters
x:double

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

the x position

y:double

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

the y position

w:double

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

the width

h:double

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

the height

Annotations
@Override
updateChildrenback to summary
protected void updateChildren()

Overrides javafx.scene.control.skin.LabeledSkinBase.updateChildren.

Doc from javafx.scene.control.skin.LabeledSkinBase.updateChildren.

Updates the children managed by LabeledSkinBase, which can be the Labeled graphic and/or a Text node. Only those nodes which actually must be used are used. For example, with a ContentDisplay of GRAPHIC_ONLY the text node is not added, and with a ContentDisplay of TEXT_ONLY, the graphic is not added.

Annotations
@Override