|
1 | 1 | /* |
2 | | - * Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
25 | 25 |
|
26 | 26 | package javafx.scene.control; |
27 | 27 |
|
28 | | -import com.sun.javafx.beans.IDProperty; |
29 | | -import com.sun.javafx.css.StyleManager; |
30 | | -import com.sun.javafx.scene.NodeHelper; |
31 | | -import com.sun.javafx.stage.PopupWindowHelper; |
32 | | - |
33 | | -import javafx.css.SimpleStyleableBooleanProperty; |
34 | | -import javafx.css.SimpleStyleableDoubleProperty; |
35 | | -import javafx.css.SimpleStyleableObjectProperty; |
36 | | -import javafx.css.StyleOrigin; |
37 | | -import javafx.css.StyleableObjectProperty; |
38 | | -import javafx.css.StyleableStringProperty; |
39 | | - |
40 | | -import javafx.css.converter.BooleanConverter; |
41 | | -import javafx.css.converter.EnumConverter; |
42 | | -import javafx.css.converter.SizeConverter; |
43 | | -import javafx.css.converter.StringConverter; |
44 | | -import javafx.css.converter.DurationConverter; |
45 | | -import javafx.scene.control.skin.TooltipSkin; |
46 | | - |
47 | 28 | import java.util.ArrayList; |
48 | 29 | import java.util.Collections; |
49 | 30 | import java.util.List; |
50 | | - |
51 | 31 | import javafx.animation.KeyFrame; |
52 | 32 | import javafx.animation.Timeline; |
53 | | -import javafx.beans.property.*; |
| 33 | +import javafx.application.Platform; |
| 34 | +import javafx.beans.property.BooleanProperty; |
| 35 | +import javafx.beans.property.DoubleProperty; |
| 36 | +import javafx.beans.property.ObjectProperty; |
| 37 | +import javafx.beans.property.ReadOnlyBooleanProperty; |
| 38 | +import javafx.beans.property.ReadOnlyBooleanWrapper; |
| 39 | +import javafx.beans.property.SimpleStringProperty; |
| 40 | +import javafx.beans.property.StringProperty; |
54 | 41 | import javafx.beans.value.WritableValue; |
55 | 42 | import javafx.css.CssMetaData; |
56 | 43 | import javafx.css.FontCssMetaData; |
| 44 | +import javafx.css.SimpleStyleableBooleanProperty; |
| 45 | +import javafx.css.SimpleStyleableDoubleProperty; |
| 46 | +import javafx.css.SimpleStyleableObjectProperty; |
| 47 | +import javafx.css.StyleOrigin; |
57 | 48 | import javafx.css.Styleable; |
| 49 | +import javafx.css.StyleableObjectProperty; |
58 | 50 | import javafx.css.StyleableProperty; |
| 51 | +import javafx.css.StyleableStringProperty; |
| 52 | +import javafx.css.converter.BooleanConverter; |
| 53 | +import javafx.css.converter.DurationConverter; |
| 54 | +import javafx.css.converter.EnumConverter; |
| 55 | +import javafx.css.converter.SizeConverter; |
| 56 | +import javafx.css.converter.StringConverter; |
59 | 57 | import javafx.event.EventHandler; |
60 | 58 | import javafx.geometry.NodeOrientation; |
61 | 59 | import javafx.scene.AccessibleRole; |
62 | 60 | import javafx.scene.Node; |
63 | 61 | import javafx.scene.Parent; |
64 | 62 | import javafx.scene.Scene; |
| 63 | +import javafx.scene.control.skin.TooltipSkin; |
65 | 64 | import javafx.scene.image.Image; |
66 | 65 | import javafx.scene.image.ImageView; |
67 | 66 | import javafx.scene.input.MouseEvent; |
68 | 67 | import javafx.scene.text.Font; |
69 | 68 | import javafx.scene.text.TextAlignment; |
70 | 69 | import javafx.stage.Window; |
71 | 70 | import javafx.util.Duration; |
| 71 | +import com.sun.javafx.beans.IDProperty; |
| 72 | +import com.sun.javafx.css.StyleManager; |
| 73 | +import com.sun.javafx.scene.NodeHelper; |
| 74 | +import com.sun.javafx.stage.PopupWindowHelper; |
72 | 75 |
|
73 | 76 | /** |
74 | 77 | * Tooltips are common UI elements which are typically used for showing |
@@ -769,8 +772,9 @@ public StyleableProperty<Duration> getStyleableProperty(Tooltip.CSSBridge cssBri |
769 | 772 | return getClassCssMetaData(); |
770 | 773 | } |
771 | 774 |
|
772 | | - @Override public Styleable getStyleableParent() { |
773 | | - if (BEHAVIOR.hoveredNode == null) { |
| 775 | + @Override |
| 776 | + public Styleable getStyleableParent() { |
| 777 | + if (!Platform.isFxApplicationThread() || (BEHAVIOR.hoveredNode == null)) { |
774 | 778 | return super.getStyleableParent(); |
775 | 779 | } |
776 | 780 | return BEHAVIOR.hoveredNode; |
|
0 commit comments