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

public Class TreeViewSkin<T>

extends VirtualContainerBase<TreeView<T>, TreeCell<T>>
Class Inheritance
Type Parameters
<T>
the type of the item contained within the TreeItem value property for all tree items in this TreeView
Imports
java.lang.ref.WeakReference, java.util.ArrayList, .List, javafx.beans.InvalidationListener, .Observable, .WeakInvalidationListener, javafx.collections.FXCollections, .MapChangeListener, .ObservableList, .ObservableMap, javafx.event.EventHandler, .EventType, .WeakEventHandler, javafx.geometry.NodeOrientation, javafx.scene.AccessibleAction, .AccessibleAttribute, .Node, javafx.scene.control.Control, .FocusModel, .MultipleSelectionModel, .ScrollBar, .SelectionModel, .TreeCell, .TreeItem, .TreeItem.TreeModificationEvent, .TreeView, javafx.scene.input.MouseEvent, javafx.scene.layout.HBox, .StackPane, com.sun.javafx.scene.control.Properties, com.sun.javafx.scene.control.behavior.TreeViewBehavior

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

Field Summary

Modifier and TypeField and Description
private final TreeViewBehavior<T>
private final VirtualFlow<TreeCell<T>>
private static final boolean
private MapChangeListener<Object, Object>
private EventHandler<TreeItem.TreeModificationEvent<T>>
private WeakReference<TreeItem<T>>
private WeakEventHandler<TreeItem.TreeModificationEvent<T>>

Constructor Summary

AccessConstructor and Description
public
TreeViewSkin(final TreeView<T>
The control that this skin should be installed onto.
control
)

Creates a new TreeViewSkin 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
computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computePrefHeight.

Calculates the preferred height of this SkinBase.

protected double
computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computePrefWidth.

Calculates the preferred width of this SkinBase.

private TreeCell<T>
private TreeCell<T>
public void
dispose()

Overrides javafx.scene.control.skin.VirtualContainerBase.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 action, Object... parameters)

Overrides javafx.scene.control.SkinBase.executeAccessibleAction.

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

protected int
getItemCount()

Implements abstract javafx.scene.control.skin.VirtualContainerBase.getItemCount.

Returns the total number of items in this container, including those that are currently hidden because they are out of view.

private TreeItem<T>
private void
horizontalUnitScroll(boolean right)

protected void
layoutChildren(final double x, final double y, final double w, final double h)

Overrides javafx.scene.control.skin.VirtualContainerBase.layoutChildren.

Called during the layout pass of the scenegraph.

private void
private void
private void
private void
private int
onScrollPageDown(boolean isFocusDriven)

Function used to scroll the container down by one 'page'.

private int
onScrollPageUp(boolean isFocusDriven)

Function used to scroll the container up by one 'page'.

private void
private void
protected Object
queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)

Overrides javafx.scene.control.SkinBase.queryAccessibleAttribute.

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

private void
setRoot(TreeItem<T> newRoot)

protected void
updateItemCount()

Implements abstract javafx.scene.control.skin.VirtualContainerBase.updateItemCount.

This method is called when it is possible that the item count has changed (i.e. scrolling has occurred, the control has resized, etc).

private void
verticalUnitScroll(boolean down)

Inherited from javafx.scene.control.skin.VirtualContainerBase:
checkStatecreateVirtualFlowgetMaxCellWidthgetVirtualFlowgetVirtualFlowPreferredHeightmarkItemCountDirtyrequestRebuildCellsrequestRecreateCells

Field Detail

behaviorback to summary
private final TreeViewBehavior<T> behavior
flowback to summary
private final VirtualFlow<TreeCell<T>> flow

Hides javafx.scene.control.skin.VirtualContainerBase.flow.

IS_PANNABLEback to summary
private static final boolean IS_PANNABLE
propertiesMapListenerback to summary
private MapChangeListener<Object, Object> propertiesMapListener
rootListenerback to summary
private EventHandler<TreeItem.TreeModificationEvent<T>> rootListener
weakRootback to summary
private WeakReference<TreeItem<T>> weakRoot
weakRootListenerback to summary
private WeakEventHandler<TreeItem.TreeModificationEvent<T>> weakRootListener

Constructor Detail

TreeViewSkinback to summary
public TreeViewSkin(final TreeView<T> control)

Creates a new TreeViewSkin 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:TreeView<T>

The control that this skin should be installed onto.

Method Detail

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.

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.

Annotations
@Override
createCellback to summary
private TreeCell<T> createCell(VirtualFlow<TreeCell<T>> flow)
createDefaultCellImplback to summary
private TreeCell<T> createDefaultCellImpl()
disposeback to summary
public void dispose()

Overrides javafx.scene.control.skin.VirtualContainerBase.dispose.

Implements javafx.scene.control.Skin.dispose.

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

Overridden to remove EventHandler.

Annotations
@Override
executeAccessibleActionback to summary
protected void executeAccessibleAction(AccessibleAction action, Object... parameters)

Overrides javafx.scene.control.SkinBase.executeAccessibleAction.

Doc from javafx.scene.control.SkinBase.executeAccessibleAction.

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

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

Annotations
@Override
getItemCountback to summary
protected int getItemCount()

Implements abstract javafx.scene.control.skin.VirtualContainerBase.getItemCount.

Doc from javafx.scene.control.skin.VirtualContainerBase.getItemCount.

Returns the total number of items in this container, including those that are currently hidden because they are out of view.

Annotations
@Override
getRootback to summary
private TreeItem<T> getRoot()
horizontalUnitScrollback to summary
private void horizontalUnitScroll(boolean right)
layoutChildrenback to summary
protected void layoutChildren(final double x, final double y, final double w, final double h)

Overrides javafx.scene.control.skin.VirtualContainerBase.layoutChildren.

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

Called during the layout pass of the scenegraph.

Annotations
@Override
onFocusNextCellback to summary
private void onFocusNextCell()
onFocusPreviousCellback to summary
private void onFocusPreviousCell()
onMoveToFirstCellback to summary
private void onMoveToFirstCell()
onMoveToLastCellback to summary
private void onMoveToLastCell()
onScrollPageDownback to summary
private int onScrollPageDown(boolean isFocusDriven)

Function used to scroll the container down by one 'page'.

onScrollPageUpback to summary
private int onScrollPageUp(boolean isFocusDriven)

Function used to scroll the container up by one 'page'.

onSelectNextCellback to summary
private void onSelectNextCell()
onSelectPreviousCellback to summary
private void onSelectPreviousCell()
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.

Annotations
@Override
setRootback to summary
private void setRoot(TreeItem<T> newRoot)
updateItemCountback to summary
protected void updateItemCount()

Implements abstract javafx.scene.control.skin.VirtualContainerBase.updateItemCount.

Doc from javafx.scene.control.skin.VirtualContainerBase.updateItemCount.

This method is called when it is possible that the item count has changed (i.e. scrolling has occurred, the control has resized, etc). This method should recalculate the item count and store that for future use by the getItemCount method.

Annotations
@Override
verticalUnitScrollback to summary
private void verticalUnitScroll(boolean down)