Labeled.
Labeled
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| pack-priv double | ellipsisWidth
The cached width of the ellipsis string. |
| pack-priv Node | graphic
A reference to the last-known graphic on the Labeled. |
| pack-priv final InvalidationListener | graphicPropertyChangedListener
A listener which is applied to the graphic whenever the graphic is set and is visible within the labeled. |
| pack-priv boolean | invalidText
Indicates that the text content is invalid and needs to be updated. |
| private Node | |
| private Line | |
| private KeyCombination | |
| private MnemonicInfo | |
| private Scene | |
| pack-priv LabeledText | text
The Text node used to display the text. |
| private Rectangle | |
| private final AtomicBoolean | |
| pack-priv double | textWidth
The cached full width of the non-truncated text. |
| private double | |
| private double |
| Access | Constructor and Description |
|---|---|
| public | LabeledSkinBase(final C
The labeled that this skin should be installed onto. labeled)Constructor for LabeledSkinBase. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| pack-priv double | |
| public double | computeBaselineOffset(double topInset, double rightInset, double bottomInset, double leftInset)
Overrides javafx. Calculates the baseline offset based on the first managed child. |
| protected double | computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
Overrides javafx. 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)
Overrides javafx. 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)
Overrides javafx. Computes the minimum allowable height of the Skin, based on the provided width. |
| 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)
|
| protected double | computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
Overrides javafx. Compute and return the minimum width of this Labeled. |
| protected double | computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
Overrides javafx. Calculates the preferred height of this |
| protected double | computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
Overrides javafx. Calculates the preferred width of this |
| public void | dispose()
Overrides javafx. Implements javafx. Called when a previously installed skin is about to be removed from its associated control. |
| private String | getCleanText()
Gets the clean text, which is the source text after mnemonic symbols have been removed. |
| private void | |
| pack-priv boolean | isIgnoreGraphic()
Gets whether for various computations we can ignore the presence of the graphic (or lack thereof). |
| pack-priv boolean | |
| protected void | layoutChildren(final double x, final double y, final double w, final double h)
Overrides javafx. 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
The x position of the label part of the control, inside padding x, double The y position of the label part of the control, inside padding y, double The width of the label part of the control, not including padding w, double The height of the label part of the control, not including padding h)Performs the actual layout of the label content within the area given. |
| protected void | layoutLabelInArea(double
The x position of the label part of the control, inside padding x, double The y position of the label part of the control, inside padding y, double The width of the label part of the control, not including padding w, double The height of the label part of the control, not including padding h, Pos The alignment of the label part of the control within the given area. If null, then the control's alignment will be used. alignment)Performs the actual layout of the label content within the area given. |
| pack-priv double | |
| pack-priv void | |
| protected Object | queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
Overrides javafx. This method is called by the assistive technology to request the value for an attribute. |
| private void | |
| pack-priv double | |
| private void | |
| private void | |
| pack-priv double | |
| protected void | updateChildren()
Updates the children managed by LabeledSkinBase, which can be the Labeled graphic and/or a Text node. |
| pack-priv void | |
| private void | |
| private void |
| containsMnemonic | back to summary |
|---|---|
| private boolean containsMnemonic | |
| ellipsisWidth | back to summary |
|---|---|
| pack-priv double ellipsisWidth The cached width of the ellipsis string. This will be recomputed if the font or the ellipsisString property have changed. This is package private ONLY FOR THE SAKE OF TESTING | |
| graphic | back to summary |
|---|---|
| pack-priv Node graphic A reference to the last-known graphic on the Labeled. This reference is kept so that we can remove listeners from the old graphic later | |
| graphicPropertyChangedListener | back to summary |
|---|---|
| pack-priv final InvalidationListener graphicPropertyChangedListener A listener which is applied to the graphic whenever the graphic is set and is visible within the labeled. For example, if there is a graphic defined on the Labeled but the ContentDisplay is set to TEXT_ONLY, then we will not bother installing this listener on the graphic. In all other cases, if the graphic is defined, it will have this listener added to it, which ensures that if the graphic's layout bounds change, we end up performing a layout and potentially update the visible text. This is package private ONLY FOR THE SAKE OF TESTING | |
| invalidText | back to summary |
|---|---|
| pack-priv boolean invalidText Indicates that the text content is invalid and needs to be updated. This is package private only for the sake of testing. | |
| labeledNode | back to summary |
|---|---|
| private Node labeledNode | |
| mnemonic_underscore | back to summary |
|---|---|
| private Line mnemonic_underscore | |
| mnemonicCode | back to summary |
|---|---|
| private KeyCombination mnemonicCode | |
| mnemonicInfo | back to summary |
|---|---|
| private MnemonicInfo mnemonicInfo | |
| mnemonicScene | back to summary |
|---|---|
| private Scene mnemonicScene | |
| text | back to summary |
|---|---|
| pack-priv LabeledText text The Text node used to display the text. This is package only for the sake of testing! | |
| textClip | back to summary |
|---|---|
| private Rectangle textClip | |
| textTruncated | back to summary |
|---|---|
| private final AtomicBoolean textTruncated | |
| textWidth | back to summary |
|---|---|
| pack-priv double textWidth The cached full width of the non-truncated text. We only want to recompute this if the text has itself changed, or if the font has changed. This is package private ONLY FOR THE SAKE OF TESTING | |
| wrapHeight | back to summary |
|---|---|
| private double wrapHeight | |
| wrapWidth | back to summary |
|---|---|
| private double wrapWidth | |
| LabeledSkinBase | back to summary |
|---|---|
| public LabeledSkinBase(final C labeled) Constructor for LabeledSkinBase. The Labeled must be specified, and cannot be null. At the conclusion of the constructor call, the skin will be marked as needsLayout, and will be fully configured based on the current state of the labeled. Any subsequent changes to the Labeled will be handled via listeners and applied appropriately.
| |
| addMnemonic | back to summary |
|---|---|
| private void addMnemonic() | |
| bottomLabelPadding | back to summary |
|---|---|
| pack-priv double bottomLabelPadding() | |
| computeBaselineOffset | back to summary |
|---|---|
| public double computeBaselineOffset(double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Calculates the baseline offset based on the first managed child. If there
is no such child, returns
| |
| computeMaxHeight | back to summary |
|---|---|
| protected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Computes the maximum allowable height of the Skin, based on the provided width.
| |
| computeMaxWidth | back to summary |
|---|---|
| protected double computeMaxWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Computes the maximum allowable width of the Skin, based on the provided height.
| |
| computeMinHeight | back to summary |
|---|---|
| protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Computes the minimum allowable height of the Skin, based on the provided width.
| |
| computeMinLabeledPartHeight | back to summary |
|---|---|
| private double computeMinLabeledPartHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) | |
| computeMinLabeledPartWidth | back to summary |
|---|---|
| private double computeMinLabeledPartWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) | |
| computeMinWidth | back to summary |
|---|---|
| protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. 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.
| |
| computePrefHeight | back to summary |
|---|---|
| protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Calculates the preferred height of this
| |
| computePrefWidth | back to summary |
|---|---|
| protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Calculates the preferred width of this
| |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides javafx. Implements javafx. Doc from javafx. 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,
Calling
| |
| getCleanText | back to summary |
|---|---|
| private String getCleanText() Gets the clean text, which is the source text after mnemonic symbols have been removed. | |
| invalidateWidths | back to summary |
|---|---|
| private void invalidateWidths() Marks minWidth as being invalid and in need of recomputation. | |
| isIgnoreGraphic | back to summary |
|---|---|
| pack-priv boolean isIgnoreGraphic() Gets whether for various computations we can ignore the presence of the graphic (or lack thereof). | |
| isIgnoreText | back to summary |
|---|---|
| pack-priv boolean isIgnoreText() Gets whether for various computations we can ignore the presence of the text. | |
| layoutChildren | back to summary |
|---|---|
| protected void layoutChildren(final double x, final double y, final double w, final double h) Overrides javafx. 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
| |
| layoutLabelInArea | back to summary |
|---|---|
| protected void layoutLabelInArea(double x, double y, double w, double h) Performs the actual layout of the label content within the area given. This method is called by subclasses that override layoutChildren().
| |
| layoutLabelInArea | back to summary |
|---|---|
| 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. This method is called by subclasses that override layoutChildren().
| |
| leftLabelPadding | back to summary |
|---|---|
| pack-priv double leftLabelPadding() | |
| mnemonicTargetChanged | back to summary |
|---|---|
| pack-priv void mnemonicTargetChanged() | |
| queryAccessibleAttribute | back to summary |
|---|---|
| protected Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) Overrides javafx. Doc from javafx. 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.
| |
| removeMnemonic | back to summary |
|---|---|
| private void removeMnemonic() | |
| rightLabelPadding | back to summary |
|---|---|
| pack-priv double rightLabelPadding() | |
| sceneChanged | back to summary |
|---|---|
| private void sceneChanged() | |
| textMetricsChanged | back to summary |
|---|---|
| private void textMetricsChanged() Called whenever some state has changed that affects the text metrics. Changes here will involve invalidating the display text so the next call to updateDisplayedText computes a new value, and call requestLayout. | |
| topLabelPadding | back to summary |
|---|---|
| pack-priv double topLabelPadding() | |
| updateChildren | back to summary |
|---|---|
| protected void 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. | |
| updateDisplayedText | back to summary |
|---|---|
| pack-priv void updateDisplayedText() Updates the content of the underlying Text node. This method should only be called when necessary. If the invalidText flag is not set, then the method is a no-op. This care is taken because recomputing the text to display is an expensive operation. Package private ONLY FOR THE SAKE OF TESTING. | |
| updateDisplayedText | back to summary |
|---|---|
| private void updateDisplayedText(double w, double h) | |
| updateWrappingWidth | back to summary |
|---|---|
| private void updateWrappingWidth() Updates the wrapping width of the text node. Although changing the font does affect the metrics used for text layout, this method does not call requestLayout or invalidate the text, since it may be called from the constructor and such work would be duplicative and wasted. | |