Example usage for javafx.scene Node getLayoutY

List of usage examples for javafx.scene Node getLayoutY

Introduction

In this page you can find the example usage for javafx.scene Node getLayoutY.

Prototype

public final double getLayoutY() 

Source Link

Usage

From source file:Main.java

public void focusChanged(ObservableValue<? extends Node> value, Node oldNode, Node newNode) {
    // Focus has changed to a new node
    String microHelpText = (String) newNode.getProperties().get("microHelpText");

    if (microHelpText != null && microHelpText.trim().length() > 0) {
        helpText.setText(microHelpText);
        helpText.setVisible(true);/*from   w  ww.  j  a v a 2s. co m*/

        // Position the help text node
        double x = newNode.getLayoutX() + newNode.getLayoutBounds().getMinX()
                - helpText.getLayoutBounds().getMinX();
        double y = newNode.getLayoutY() + newNode.getLayoutBounds().getMinY()
                + newNode.getLayoutBounds().getHeight() - helpText.getLayoutBounds().getMinX();

        helpText.setLayoutX(x);
        helpText.setLayoutY(y);
        helpText.setWrappingWidth(newNode.getLayoutBounds().getWidth());
    } else {
        helpText.setVisible(false);
    }
}