public abstract class LabeledSkinBase<C extends Labeled>
extends <any>
Labeled
.Labeled
Modifier and Type | Field and Description |
---|---|
private TextBinding |
bindings |
private boolean |
containsMnemonic |
(package private) double |
ellipsisWidth
The cached width of the ellipsis string.
|
(package private) Node |
graphic
A reference to the last-known graphic on the Labeled.
|
(package private) InvalidationListener |
graphicPropertyChangedListener
A listener which is applied to the graphic whenever the graphic is set
and is visible within the labeled.
|
(package private) boolean |
invalidText
Indicates that the text content is invalid and needs to be updated.
|
private Node |
labeledNode |
private Line |
mnemonic_underscore |
private KeyCombination |
mnemonicCode |
private Scene |
mnemonicScene |
(package private) LabeledText |
text
The Text node used to display the text.
|
private Rectangle |
textClip |
(package private) double |
textWidth
The cached full width of the non-truncated text.
|
private double |
wrapHeight |
private double |
wrapWidth |
Constructor and Description |
---|
LabeledSkinBase(C labeled)
Constructor for LabeledSkinBase.
|
Modifier and Type | Method and Description |
---|---|
private void |
addMnemonic() |
(package private) double |
bottomLabelPadding() |
double |
computeBaselineOffset(double topInset,
double rightInset,
double bottomInset,
double leftInset) |
protected double |
computeMaxHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset) |
protected double |
computeMaxWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset) |
protected double |
computeMinHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset) |
private double |
computeMinLabeledPartHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset) |
private double |
computeMinLabeledPartWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
*
Private implementation *
*
|
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) |
protected double |
computePrefWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset) |
private void |
invalidateWidths()
Marks minWidth as being invalid and in need of recomputation.
|
(package private) boolean |
isIgnoreGraphic()
Gets whether for various computations we can ignore the presence of the graphic
(or lack thereof).
|
(package private) 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.
|
(package private) double |
leftLabelPadding() |
(package private) void |
mnemonicTargetChanged() |
protected java.lang.Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
java.lang.Object... parameters) |
private void |
removeMnemonic() |
(package private) double |
rightLabelPadding() |
private void |
sceneChanged() |
private void |
textMetricsChanged()
Called whenever some state has changed that affects the text metrics.
|
(package private) double |
topLabelPadding() |
protected void |
updateChildren()
Updates the children managed by LabeledSkinBase, which can be the Labeled
graphic and/or a Text node.
|
(package private) void |
updateDisplayedText()
Updates the content of the underlying Text node.
|
private void |
updateDisplayedText(double w,
double h) |
private void |
updateWrappingWidth()
Updates the wrapping width of the text node.
|
LabeledText text
boolean invalidText
Node graphic
double textWidth
double ellipsisWidth
final InvalidationListener graphicPropertyChangedListener
private Rectangle textClip
private double wrapWidth
private double wrapHeight
private TextBinding bindings
private Line mnemonic_underscore
private boolean containsMnemonic
private Scene mnemonicScene
private KeyCombination mnemonicCode
private Node labeledNode
public LabeledSkinBase(C labeled)
labeled
- The labeled that this skin should be installed onto.protected void updateChildren()
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.
protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
protected double computeMaxWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
protected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
public double computeBaselineOffset(double topInset, double rightInset, double bottomInset, double leftInset)
protected void layoutChildren(double x, double y, double w, double h)
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 java.lang.Object queryAccessibleAttribute(AccessibleAttribute attribute, java.lang.Object... parameters)
private double computeMinLabeledPartWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
private double computeMinLabeledPartHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
double topLabelPadding()
double bottomLabelPadding()
double leftLabelPadding()
double rightLabelPadding()
private void textMetricsChanged()
void mnemonicTargetChanged()
private void sceneChanged()
private void invalidateWidths()
void updateDisplayedText()
private void updateDisplayedText(double w, double h)
private void addMnemonic()
private void removeMnemonic()
private void updateWrappingWidth()
boolean isIgnoreGraphic()
boolean isIgnoreText()