public class NodeUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addToParent(Parent p,
Node n)
Adds the given node to the specified parent.
|
static void |
addToParent(Parent p,
Node n,
int index)
Adds the given node to the specified parent.
|
static List<Parent> |
getAncestors(Node n)
Returns all ancestors of the specified node.
|
static List<Parent> |
getAncestors(Node n,
Parent parent)
Returns all ancestors of the specified node till the specified one is
reached.
|
static List<Parent> |
getCommonAncestors(Node n1,
Node n2)
Returns all common ancestors of the specified nodes.
|
static Node |
getNode(Parent p,
double sceneX,
double sceneY,
Class<?>... nodeClasses)
Returns the first node at the given location that is an instance of the
specified class object.
|
static Node |
getNode(Parent p,
double sceneX,
double sceneY,
Class<?> nodeClass)
Returns the first node at the given location that is an instance of the
specified class object.
|
static List<String> |
getStylesheetsOfAncestors(Node n)
Returns the stylesheets of the node and all ancestors of the specified
node.
|
static eu.mihosoft.vrl.workflow.MouseButton |
mouseBtnFromEvent(MouseEvent t) |
static List<Node> |
nodesThatImplement(List<Node> nodes,
Class<?> cls) |
static List<Node> |
nodesWithParent(Parent p,
List<Node> nodes) |
static void |
removeFromParent(Node n)
Removes the specified node from its parent.
|
static double |
screenX(Node node) |
static double |
screenY(Node node) |
static Point2D |
transformCoordinates(double x,
double y,
Node from,
Node to) |
public static double screenX(Node node)
node - public static double screenY(Node node)
node - public static Point2D transformCoordinates(double x, double y, Node from, Node to)
public static List<Parent> getCommonAncestors(Node n1, Node n2)
n1 - first scene graph noden2 - second scene graph nodepublic static List<Parent> getAncestors(Node n)
n - scene graph nodepublic static List<String> getStylesheetsOfAncestors(Node n)
n - scene graph nodepublic static List<Parent> getAncestors(Node n, Parent parent)
n - scene graph nodeparent - scene graph parentpublic static void removeFromParent(Node n)
n - the node to removeIllegalArgumentException - if an unsupported parent class has been
specified or the parent is nullpublic static void addToParent(Parent p, Node n)
p - parentn - nodeIllegalArgumentException - if an unsupported parent class has been
specified or the parent is nullpublic static void addToParent(Parent p, Node n, int index)
p - parentn - nodeindex - child index (z buffer)IllegalArgumentException - if an unsupported parent class has been
specified or the parent is nullpublic static Node getNode(Parent p, double sceneX, double sceneY, Class<?> nodeClass)
p - parent nodesceneX - x coordinatesceneY - y coordinatenodeClass - node class to search fornull if no such node
existpublic static Node getNode(Parent p, double sceneX, double sceneY, Class<?>... nodeClasses)
p - parent nodesceneX - x coordinatesceneY - y coordinatenodeClasses - node classes to search fornull if no such node
existpublic static eu.mihosoft.vrl.workflow.MouseButton mouseBtnFromEvent(MouseEvent t)