Example usage for javafx.scene Node getParent

List of usage examples for javafx.scene Node getParent

Introduction

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

Prototype

public final Parent getParent() 

Source Link

Usage

From source file:Main.java

/**
 * Utility method to remove a node. In particular, a full pane can be removed.
 *
 * @param node//from w w w .  jav  a2 s . co m
 *            The node to be removed.
 */
public static void remove(final Node node) {
    if (node.getParent() != null && node.getParent() instanceof Pane) {
        ((Pane) node.getParent()).getChildren().remove(node);
    }
}

From source file:com.eviware.loadui.ui.fx.util.NodeUtils.java

public static boolean isDescendant(Node ancestor, Node descendant) {
    Node current = descendant;
    while (current != null) {
        if (current == ancestor) {
            return true;
        }/*  w ww.  java2 s . c  om*/

        current = current.getParent();
    }

    return false;
}

From source file:ambroafb.general.AnnotiationUtils.java

private static void changeNodeTitleLabelVisual(Node node, String explain) {
    Parent parent = node.getParent();
    Label nodeTitleLabel = (Label) parent.lookup(".validationMessage");

    if (explain.isEmpty()) {
        if (default_colors_map.containsKey(nodeTitleLabel)) {// This order of 'if' statements is correct!
            nodeTitleLabel.setTextFill(default_colors_map.get(nodeTitleLabel));
            default_colors_map.remove(nodeTitleLabel);
            Tooltip.uninstall(nodeTitleLabel, toolTip);
        }/*from   w w w .  j  a v  a 2  s  .  c o m*/
    } else {
        node.requestFocus();
        toolTip.setText(GeneralConfig.getInstance().getTitleFor(explain));
        toolTip.setStyle("-fx-background-color: gray; -fx-font-size: 8pt;");
        Tooltip.install(nodeTitleLabel, toolTip);
        default_colors_map.putIfAbsent(nodeTitleLabel, nodeTitleLabel.getTextFill());
        nodeTitleLabel.setTextFill(Color.RED);
    }
}