public abstract class LabeledSkinBase<C extends Labeled,B extends BehaviorBase<C>> extends BehaviorSkinBase<C,B>
Modifier and Type | Field and Description |
---|---|
TextBinding |
bindings |
IS_TOUCH_SUPPORTED
Constructor and Description |
---|
LabeledSkinBase(C labeled,
B behavior)
Constructor for LabeledSkinBase.
|
Modifier and Type | Method and Description |
---|---|
protected double |
bottomLabelPadding() |
double |
computeBaselineOffset(double topInset,
double rightInset,
double bottomInset,
double leftInset)
Calculates the baseline offset based on the first managed child.
|
protected double |
computeMaxHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Computes the maximum allowable height of the Skin, based on the provided
width.
|
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 . |
protected void |
handleControlPropertyChanged(String p)
*
Control State Changes *
*
|
protected boolean |
isIgnoreGraphic()
Gets whether for various computations we can ignore the presence of the graphic
(or lack thereof).
|
protected boolean |
isIgnoreText()
Gets whether for various computations we can ignore the presence of the text.
|
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
|
protected void |
layoutLabelInArea(double x,
double y,
double w,
double h)
Performs the actual layout of the label content within the area given.
|
protected void |
layoutLabelInArea(double x,
double y,
double w,
double h,
Pos alignment)
Performs the actual layout of the label content within the area given.
|
protected double |
leftLabelPadding() |
protected void |
mnemonicTargetChanged() |
protected Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
Object... parameters) |
protected double |
rightLabelPadding() |
protected double |
topLabelPadding() |
protected void |
updateChildren()
Updates the children managed by LabeledSkinBase, which can be the Labeled
graphic and/or a Text node.
|
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 TextBinding bindings
public LabeledSkinBase(C labeled, B behavior)
labeled
- protected void handleControlPropertyChanged(String p)
handleControlPropertyChanged
in class BehaviorSkinBase<C extends Labeled,B extends BehaviorBase<C>>
protected double topLabelPadding()
protected double bottomLabelPadding()
protected double leftLabelPadding()
protected double rightLabelPadding()
protected void mnemonicTargetChanged()
protected void updateChildren()
protected boolean isIgnoreGraphic()
protected boolean isIgnoreText()
protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
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 SkinBase<C extends Labeled>
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 SkinBase<C extends Labeled>
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 SkinBase<C extends Labeled>
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 SkinBase<C extends Labeled>
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 SkinBase<C extends Labeled>
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 insetprotected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
computeMaxHeight
in class SkinBase<C extends Labeled>
width
- The width of the Skin, in case this value might dictate
the maximum height.topInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetpublic double computeBaselineOffset(double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
Node.getBaselineOffset()
.computeBaselineOffset
in class SkinBase<C extends Labeled>
topInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected void layoutChildren(double x, double y, double w, double h)
layoutChildren
in class SkinBase<C extends Labeled>
protected void layoutLabelInArea(double x, double y, double w, double h)
x
- The x position of the label part of the control, inside paddingy
- The y position of the label part of the control, inside paddingw
- The width of the label part of the control, not including paddingh
- The height of the label part of the control, not including paddingprotected void layoutLabelInArea(double x, double y, double w, double h, Pos alignment)
x
- The x position of the label part of the control, inside paddingy
- The y position of the label part of the control, inside paddingw
- The width of the label part of the control, not including paddingh
- The height of the label part of the control, not including paddingalignment
- The alignment of the label part of the control within the given area. If null, then the control's alignment will be used.protected Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
queryAccessibleAttribute
in class SkinBase<C extends Labeled>
Node.queryAccessibleAttribute(javafx.scene.AccessibleAttribute, java.lang.Object...)
Copyright © 2020. All rights reserved.