Example usage for javafx.scene Node getLayoutX

List of usage examples for javafx.scene Node getLayoutX

Introduction

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

Prototype

public final double getLayoutX() 

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  w w .  ja  va  2s.c  om

        // 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);
    }
}