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

public Class TreeCellSkin<T>

extends CellSkinBase<TreeCell<T>>
Class Inheritance
Type Parameters
<T>
the type of the value contained within the TreeItem
Imports
java.util.ArrayList, .Collections, .List, .Map, .WeakHashMap, com.sun.javafx.scene.control.behavior.BehaviorBase, .TreeCellBehavior, javafx.beans.property.DoubleProperty, javafx.geometry.HPos, .VPos, javafx.scene.Node, javafx.scene.control.Control, .TreeCell, .TreeItem, .TreeView, javafx.scene.layout.Region, javafx.css.StyleableDoubleProperty, .StyleableProperty, .CssMetaData, .Styleable, javafx.css.converter.SizeConverter

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final BehaviorBase<TreeCell<T>>
private boolean
private DoubleProperty
indent

The amount of space to multiply by the treeItem.level to get the left margin for this tree cell.

private static final Map<TreeView<?>, Double>
private TreeItem<?>
Inherited from javafx.scene.control.skin.CellSkinBase:
DEFAULT_CELL_SIZE

Constructor Summary

AccessConstructor and Description
public
TreeCellSkin(TreeCell<T>
The control that this skin should be installed onto.
control
)

Creates a new TreeCellSkin 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
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
)

Overrides javafx.scene.control.skin.LabeledSkinBase.computeMaxHeight.

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

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
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.

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

Returns:

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

Hides javafx.scene.control.skin.CellSkinBase.getClassCssMetaData.

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

public List<CssMetaData<? extends Styleable, ?>>
getCssMetaData()

Overrides javafx.scene.control.skin.CellSkinBase.getCssMetaData.

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

private double
public final double
public final DoubleProperty
protected void
layoutChildren(double
the x position
x
,
final double
the y position
y
,
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

public final void
setIndent(double value)

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.

private void
private void
Inherited from javafx.scene.control.skin.CellSkinBase:
cellSizePropertygetCellSize

Field Detail

behaviorback to summary
private final BehaviorBase<TreeCell<T>> behavior
disclosureNodeDirtyback to summary
private boolean disclosureNodeDirty
indentback to summary
private DoubleProperty indent

The amount of space to multiply by the treeItem.level to get the left margin for this tree cell. This is settable from CSS

maxDisclosureWidthMapback to summary
private static final Map<TreeView<?>, Double> maxDisclosureWidthMap
treeItemback to summary
private TreeItem<?> treeItem

Constructor Detail

TreeCellSkinback to summary
public TreeCellSkin(TreeCell<T> control)

Creates a new TreeCellSkin 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:TreeCell<T>

The control that this skin should be installed onto.

Method Detail

computeMaxHeightback to summary
protected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.skin.LabeledSkinBase.computeMaxHeight.

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

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

Parameters
width:double

Doc from javafx.scene.control.SkinBase.computeMaxHeight.

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

topInset:double

Doc from javafx.scene.control.SkinBase.computeMaxHeight.

the pixel snapped top inset

rightInset:double

Doc from javafx.scene.control.SkinBase.computeMaxHeight.

the pixel snapped right inset

bottomInset:double

Doc from javafx.scene.control.SkinBase.computeMaxHeight.

the pixel snapped bottom inset

leftInset:double

Doc from javafx.scene.control.SkinBase.computeMaxHeight.

the pixel snapped left inset

Returns:double

Doc from javafx.scene.control.SkinBase.computeMaxHeight.

A double representing the maximum height of this Skin.

Annotations
@Override
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
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
getClassCssMetaDataback to summary
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData()

Hides javafx.scene.control.skin.CellSkinBase.getClassCssMetaData.

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

Returns:List<CssMetaData<? extends Styleable, ?>>

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

getCssMetaDataback to summary
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData()

Overrides javafx.scene.control.skin.CellSkinBase.getCssMetaData.

Doc from javafx.scene.control.skin.CellSkinBase.getCssMetaData.

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

Returns:List<CssMetaData<? extends Styleable, ?>>

Doc from javafx.scene.control.SkinBase.getCssMetaData.

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

Annotations
@Override
getFixedCellSizeback to summary
private double getFixedCellSize()
getIndentback to summary
public final double getIndent()
indentPropertyback to summary
public final DoubleProperty indentProperty()
layoutChildrenback to summary
protected void layoutChildren(double x, final double y, 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
setIndentback to summary
public final void setIndent(double value)
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
updateDisclosureNodeback to summary
private void updateDisclosureNode()
updateTreeItemback to summary
private void updateTreeItem()
javafx.scene.control.skin back to summary

private Class TreeCellSkin.StyleableProperties

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final CssMetaData<TreeCell<?>, Number>
private static final List<CssMetaData<? extends Styleable, ?>>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INDENTback to summary
private static final CssMetaData<TreeCell<?>, Number> INDENT
STYLEABLESback to summary
private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES

Constructor Detail

StyleablePropertiesback to summary
private StyleableProperties()