public class TitledPaneSkin extends LabeledSkinBase<TitledPane,TitledPaneBehavior>
Modifier and Type | Class and Description |
---|---|
(package private) class |
TitledPaneSkin.TitleRegion |
Modifier and Type | Field and Description |
---|---|
private static boolean |
CACHE_ANIMATION |
private Rectangle |
clipRect |
private Node |
content |
private StackPane |
contentContainer |
private HPos |
hpos |
private Pos |
pos |
private double |
prefHeightFromAccordion |
private Timeline |
timeline |
private TitledPaneSkin.TitleRegion |
titleRegion |
private DoubleProperty |
transition |
static Duration |
TRANSITION_DURATION |
private double |
transitionStartValue |
private VPos |
vpos |
bindings, ellipsisWidth, graphic, graphicPropertyChangedListener, invalidText, mnemonic_underscore, text, textWidth
IS_TOUCH_SUPPORTED
Constructor and Description |
---|
TitledPaneSkin(TitledPane titledPane) |
Modifier and Type | Method and Description |
---|---|
protected double |
computeMaxWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Computes the maximum allowable width of the Skin, based on the provided
height.
|
protected double |
computeMinHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Computes the minimum allowable height of the Skin, based on the provided
width.
|
protected double |
computeMinWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Compute and return the minimum width of this Labeled.
|
protected double |
computePrefHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Calculates the preferred height of this
SkinBase . |
protected double |
computePrefWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Calculates the preferred width of this
SkinBase . |
private void |
doAnimationTransition() |
StackPane |
getContentContainer() |
(package private) double |
getTitledPaneHeightForAccordion() |
(package private) double |
getTitleRegionSize(double width) |
private double |
getTransition() |
protected void |
handleControlPropertyChanged(java.lang.String property)
*
Control State Changes *
*
|
private boolean |
isInsideAccordion() |
protected void |
layoutChildren(double x,
double y,
double w,
double h)
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) |
(package private) void |
setMaxTitledPaneHeightForAccordion(double height) |
private void |
setTransition(double value) |
private DoubleProperty |
transitionProperty() |
protected void |
updateChildren()
Updates the children managed by LabeledSkinBase, which can be the Labeled
graphic and/or a Text node.
|
bottomLabelPadding, computeBaselineOffset, computeMaxHeight, isIgnoreGraphic, isIgnoreText, layoutLabelInArea, layoutLabelInArea, leftLabelPadding, mnemonicTargetChanged, queryAccessibleAttribute, rightLabelPadding, topLabelPadding, updateDisplayedText
dispose, getBehavior, registerChangeListener, unregisterChangeListener
consumeMouseEvents, executeAccessibleAction, getChildren, getClassCssMetaData, getCssMetaData, getNode, getSkinnable, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpace
public static final Duration TRANSITION_DURATION
private static final boolean CACHE_ANIMATION
private final TitledPaneSkin.TitleRegion titleRegion
private final StackPane contentContainer
private Node content
private Timeline timeline
private double transitionStartValue
private Rectangle clipRect
private Pos pos
private HPos hpos
private VPos vpos
private DoubleProperty transition
private double prefHeightFromAccordion
public TitledPaneSkin(TitledPane titledPane)
public StackPane getContentContainer()
protected void handleControlPropertyChanged(java.lang.String property)
LabeledSkinBase
handleControlPropertyChanged
in class LabeledSkinBase<TitledPane,TitledPaneBehavior>
protected void updateChildren()
LabeledSkinBase
updateChildren
in class LabeledSkinBase<TitledPane,TitledPaneBehavior>
private void setExpanded(boolean expanded)
private void setTransition(double value)
private double getTransition()
private DoubleProperty transitionProperty()
private boolean isInsideAccordion()
protected void layoutChildren(double x, double y, double w, double h)
LabeledSkinBase
layoutChildren
in class LabeledSkinBase<TitledPane,TitledPaneBehavior>
protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
LabeledSkinBase
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.
computeMinWidth
in class LabeledSkinBase<TitledPane,TitledPaneBehavior>
height
- The height of the Skin, in case this value might dictate
the minimum width.topInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
computeMinHeight
in class LabeledSkinBase<TitledPane,TitledPaneBehavior>
width
- The width of the Skin, in case this value might dictate
the minimum height.topInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
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.computePrefWidth
in class LabeledSkinBase<TitledPane,TitledPaneBehavior>
height
- the height that should be used if preferred width depends on ittopInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
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.computePrefHeight
in class LabeledSkinBase<TitledPane,TitledPaneBehavior>
width
- the width that should be used if preferred height depends on ittopInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected double computeMaxWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
computeMaxWidth
in class LabeledSkinBase<TitledPane,TitledPaneBehavior>
height
- The height of the Skin, in case this value might dictate
the maximum width.topInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetdouble getTitleRegionSize(double width)
void setMaxTitledPaneHeightForAccordion(double height)
double getTitledPaneHeightForAccordion()
private void doAnimationTransition()