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

public Class TitledPaneSkin

extends LabeledSkinBase<TitledPane>
Class Inheritance
Imports
com.sun.javafx.PlatformUtil, com.sun.javafx.scene.control.skin.Utils, javafx.animation.Animation.Status, .Interpolator, .KeyFrame, .KeyValue, .Timeline, javafx.beans.property.DoubleProperty, .SimpleDoubleProperty, javafx.geometry.HPos, .Pos, .VPos, .Insets, javafx.scene.Cursor, .Node, javafx.scene.control.ContentDisplay, .Control, .TitledPane, .Accordion, .Labeled, .ContextMenu, javafx.scene.layout.StackPane, javafx.scene.shape.Rectangle, javafx.util.Duration, com.sun.javafx.scene.control.behavior.TitledPaneBehavior, javafx.beans.binding.DoubleBinding, javafx.scene.input.MouseButton, javafx.scene.text.Font

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private final TitledPaneBehavior
private static final boolean
private Rectangle
private Node
private final StackPane
private HPos
private Pos
private double
private Timeline
private final TitledPaneSkin.TitleRegion
private DoubleProperty
private static final Duration
private double
private VPos
Inherited from javafx.scene.control.skin.LabeledSkinBase:
ellipsisWidthgraphicgraphicPropertyChangedListenerinvalidTexttexttextWidth

Constructor Summary

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

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

Overrides javafx.scene.control.skin.LabeledSkinBase.computeMaxWidth.

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

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.

private void
pack-priv double
pack-priv double
getTitleRegionSize(double width)

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

private void
setExpanded(boolean expanded)

pack-priv void
private final void
setTransition(double value)

private final DoubleProperty
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
Inherited from javafx.scene.control.skin.LabeledSkinBase:
bottomLabelPaddingcomputeBaselineOffsetcomputeMaxHeightisIgnoreGraphicisIgnoreTextlayoutLabelInArealayoutLabelInArealeftLabelPaddingmnemonicTargetChangedqueryAccessibleAttributerightLabelPaddingtopLabelPaddingupdateDisplayedText

Field Detail

behaviorback to summary
private final TitledPaneBehavior behavior
CACHE_ANIMATIONback to summary
private static final boolean CACHE_ANIMATION
clipRectback to summary
private Rectangle clipRect
contentback to summary
private Node content
contentContainerback to summary
private final StackPane contentContainer
hposback to summary
private HPos hpos
posback to summary
private Pos pos
prefHeightFromAccordionback to summary
private double prefHeightFromAccordion
timelineback to summary
private Timeline timeline
titleRegionback to summary
private final TitledPaneSkin.TitleRegion titleRegion
transitionback to summary
private DoubleProperty transition
TRANSITION_DURATIONback to summary
private static final Duration TRANSITION_DURATION
transitionStartValueback to summary
private double transitionStartValue
vposback to summary
private VPos vpos

Constructor Detail

TitledPaneSkinback to summary
public TitledPaneSkin(final TitledPane control)

Creates a new TitledPaneSkin 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:TitledPane

The control that this skin should be installed onto.

Method Detail

computeMaxWidthback to summary
protected double computeMaxWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.skin.LabeledSkinBase.computeMaxWidth.

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

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

Parameters
height:double

Doc from javafx.scene.control.SkinBase.computeMaxWidth.

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

topInset:double

Doc from javafx.scene.control.SkinBase.computeMaxWidth.

the pixel snapped top inset

rightInset:double

Doc from javafx.scene.control.SkinBase.computeMaxWidth.

the pixel snapped right inset

bottomInset:double

Doc from javafx.scene.control.SkinBase.computeMaxWidth.

the pixel snapped bottom inset

leftInset:double

Doc from javafx.scene.control.SkinBase.computeMaxWidth.

the pixel snapped left inset

Returns:double

Doc from javafx.scene.control.SkinBase.computeMaxWidth.

A double representing the maximum width 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
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
doAnimationTransitionback to summary
private void doAnimationTransition()
getTitledPaneHeightForAccordionback to summary
pack-priv double getTitledPaneHeightForAccordion()
getTitleRegionSizeback to summary
pack-priv double getTitleRegionSize(double width)
getTransitionback to summary
private final double getTransition()
isInsideAccordionback to summary
private boolean isInsideAccordion()
layoutChildrenback to summary
protected void layoutChildren(final double x, 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
setExpandedback to summary
private void setExpanded(boolean expanded)
setMaxTitledPaneHeightForAccordionback to summary
pack-priv void setMaxTitledPaneHeightForAccordion(double height)
setTransitionback to summary
private final void setTransition(double value)
transitionPropertyback to summary
private final DoubleProperty transitionProperty()
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
updateClipback to summary
private void updateClip()
javafx.scene.control.skin back to summary

pack-priv Class TitledPaneSkin.TitleRegion

extends StackPane
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final StackPane

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
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.

private double
labelPrefHeight(double width)

private double
labelPrefWidth(double height)

protected void
layoutChildren()

Overrides javafx.scene.layout.StackPane.layoutChildren.

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

private void
Inherited from javafx.scene.layout.StackPane:
alignmentPropertyclearConstraintscomputeMinHeightcomputeMinWidthgetAlignmentgetAlignmentgetClassCssMetaDatagetContentBiasgetCssMetaDatagetMarginrequestLayoutsetAlignmentsetAlignmentsetMargin

Field Detail

arrowRegionback to summary
private final StackPane arrowRegion

Constructor Detail

TitleRegionback to summary
public TitleRegion()

Method Detail

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
labelPrefHeightback to summary
private double labelPrefHeight(double width)
labelPrefWidthback to summary
private double labelPrefWidth(double height)
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
updateback to summary
private void update()