RT-26147: Tooltip layout issue in RTL orientation. diff -r f4084b9ecd79 javafx-ui-controls/src/javafx/scene/control/Tooltip.java --- a/javafx-ui-controls/src/javafx/scene/control/Tooltip.java Thu Feb 28 15:54:20 2013 -0500 +++ b/javafx-ui-controls/src/javafx/scene/control/Tooltip.java Fri Mar 15 15:51:43 2013 -0700 @@ -50,6 +50,7 @@ import javafx.css.StyleableProperty; import javafx.event.ActionEvent; import javafx.event.EventHandler; +import javafx.geometry.NodeOrientation; import javafx.scene.Node; import javafx.scene.Parent; import javafx.scene.Scene; @@ -762,7 +763,21 @@ // ACTIVATED_TIMER expire, and wait until the next mouse // the movement to start it again. if (owner != null && owner.isShowing() && treeVisible) { - activatedTooltip.show(owner, lastMouseX, lastMouseY); + double x = lastMouseX; + double y = lastMouseY; + + // The tooltip always inherits the nodeOrientation of + // the Node that it is attached to (see RT-26147). It + // is possible to override this for the Tooltip content + // (but not the popup placement) by setting the + // nodeOrientation on tooltip.getScene().getRoot(). + NodeOrientation nodeOrientation = hoveredNode.getEffectiveNodeOrientation(); + activatedTooltip.getScene().setNodeOrientation(nodeOrientation); + if (nodeOrientation == NodeOrientation.RIGHT_TO_LEFT) { + x -= activatedTooltip.getWidth(); + } + + activatedTooltip.show(owner, x, y); visibleTooltip = activatedTooltip; hoveredNode = null; hideTimer.playFromStart();