public class FXUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
FXUtils.ConditionHandler<T>
A simple handler used by setRecursively.
|
static interface |
FXUtils.GetHandler<T>
A simple handler used by getRecursively.
|
static interface |
FXUtils.Handler<T>
A simple handler used by setRecursively.
|
| Constructor and Description |
|---|
FXUtils() |
| Modifier and Type | Method and Description |
|---|---|
static javafx.geometry.Insets |
add(javafx.geometry.Insets insets1,
javafx.geometry.Insets insets2) |
static javafx.scene.Node |
findAncestor(javafx.scene.Node node,
java.lang.Class classToFind,
java.lang.Class classToStop)
Finds the ancestor of the node which is the type of the classToFind and before it reaches a node that is of type
classToStop.
|
static javafx.scene.Node |
findAncestor(javafx.scene.Node node,
java.lang.String classNameEndWith,
java.lang.Class classToStop)
Finds the ancestor of the node which its type class name ends with String classNameEndWith and before it reaches
a node that is of type classToStop.
|
static <T> java.lang.Object |
getRecursively(T c,
FXUtils.GetHandler<T> handler)
Gets to a child of a Node recursively based on certain condition.
|
static javafx.geometry.Rectangle2D |
getScreenBounds(javafx.geometry.Point2D point) |
static boolean |
isAncestor(javafx.scene.Node node,
javafx.scene.Node ancestorNode)
determine if the
Node is the ancestorNode of another Node or the same. |
static javafx.geometry.Point2D |
pointRelativeTo(javafx.stage.PopupWindow window,
javafx.geometry.Point2D windowPoint,
javafx.scene.Node parent,
javafx.geometry.Point2D parentPoint)
calculate the layout point for a popup window based on the two points, windowPoint from popup window and
parentPoint from parent node
|
static void |
runThreadSafe(java.lang.Runnable runnable)
Runs the runnable using Platform.runLater if the current thread is not on JavaFX Application Thread.
|
static <T> void |
setRecursively(T c,
FXUtils.Handler<T> handler)
Calls the handler recursively on a Node.
|
public static javafx.geometry.Rectangle2D getScreenBounds(javafx.geometry.Point2D point)
public static javafx.geometry.Insets add(javafx.geometry.Insets insets1,
javafx.geometry.Insets insets2)
public static boolean isAncestor(javafx.scene.Node node,
javafx.scene.Node ancestorNode)
Node is the ancestorNode of another Node or the same.node - the nodeancestorNode - the possible ancestorNode nodepublic static javafx.scene.Node findAncestor(javafx.scene.Node node,
java.lang.Class classToFind,
java.lang.Class classToStop)
node - the node that we will look for the ancestor.classToFind - the ancestor type we will try to look forclassToStop - the ancestor type which will stop looking for further if seeing a node of this type.public static javafx.scene.Node findAncestor(javafx.scene.Node node,
java.lang.String classNameEndWith,
java.lang.Class classToStop)
node - the node that we will look for the ancestor.classNameEndWith - the ancestor class name that ends with this StringclassToStop - the ancestor type which will stop looking for further if seeing a node of this type.public static <T> void setRecursively(T c,
FXUtils.Handler<T> handler)
T - the type of the Node.c - Nodehandler - handler to be calledpublic static <T> java.lang.Object getRecursively(T c,
FXUtils.GetHandler<T> handler)
T - the type of the Node.c - Nodehandler - handler to be calledpublic static javafx.geometry.Point2D pointRelativeTo(javafx.stage.PopupWindow window,
javafx.geometry.Point2D windowPoint,
javafx.scene.Node parent,
javafx.geometry.Point2D parentPoint)
window - the popup windowwindowPoint - align point inside popup windowparent - parent node with which the popup window try to alignparentPoint - align point inside parent nodepublic static void runThreadSafe(java.lang.Runnable runnable)
runnable - runnable to run