public class Util
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FIND_NODE_EXCLUDE
Tag used to exclude a node from finding
|
static boolean |
MNEMONICS_FIX
Boolean to indicate if mnemonic fixing is enabled
|
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static <T,E> Subscription |
bindContent(java.util.List<T> target,
javafx.collections.ObservableList<E> sourceList,
java.util.function.Function<E,T> converterFunction)
Deprecated.
use
FXObservableUtils#bindContent(List, ObservableList, Function) |
static javafx.beans.property.BooleanProperty |
createPseudoClassProperty(javafx.css.PseudoClass cls,
javafx.scene.Node node,
java.lang.String name,
boolean def)
creates a new pseudo class property.
|
static javafx.beans.property.BooleanProperty |
createPseudoClassProperty(java.lang.String pseudoClass,
javafx.scene.Node node,
java.lang.String name,
boolean def)
creates a new pseudo class property.
|
static javafx.beans.binding.DoubleBinding |
createTextHeightBinding(java.lang.String text,
javafx.beans.value.ObservableValue<javafx.scene.text.Font> font,
javafx.beans.value.ObservableValue<java.lang.Number> fontZoomFactor) |
static javafx.beans.binding.DoubleBinding |
createTextWidthBinding(javafx.beans.value.ObservableValue<java.lang.String> text,
javafx.beans.value.ObservableValue<javafx.scene.text.Font> font,
javafx.beans.value.ObservableValue<java.lang.Number> fontZoomFactor)
Create a binding for text width calculation.
|
static javafx.beans.binding.DoubleBinding |
createTextWidthBinding(java.lang.String text,
javafx.beans.value.ObservableValue<javafx.scene.text.Font> font,
javafx.beans.value.ObservableValue<java.lang.Number> fontZoomFactor) |
static java.lang.String |
dumpSceneGraph(javafx.scene.Node n)
Dump the scene graph to a formatted string
|
static void |
enterNestedEventLoop(java.lang.String id)
Enter a nested event loop
|
static void |
exitNestedEventLoop(java.lang.String id)
Exit the nested event loop
|
static javafx.scene.Node |
findNode(javafx.scene.Node n,
double screenX,
double screenY)
Find all node at the given x/y location starting the search from the given
node
|
static javafx.scene.Node |
findNode(javafx.stage.Window w,
double screenX,
double screenY)
Find a node in all windows
|
static javafx.scene.layout.Background |
getSimpleBackground(javafx.scene.paint.Paint p)
Create a simple background fill
|
static Size |
getSize(javafx.scene.text.Font font,
char c)
Get the size for the provided character
|
static double |
getTextHeight(java.lang.String text,
javafx.scene.text.Font font,
double fontZoomFactor) |
static double |
getTextWidth(java.lang.String text,
javafx.scene.text.Font font,
double fontZoomFactor)
Calculate the size of the text with the given font
|
static Subscription |
installHoverCallback(javafx.scene.Node node,
javafx.util.Duration delay,
java.util.function.Consumer<javafx.scene.input.MouseEvent> hoverConsumer)
Install a hover callback
|
static boolean |
isCopyEvent(javafx.scene.input.MouseEvent event) |
static javafx.scene.Node |
toNode(StyledString s)
Create a scenegraph node from the styled string
|
static <T,E> java.util.List<T> |
transformList(java.util.List<? extends E> list,
java.util.function.Function<E,T> converterFunction)
Transform the list to another list
|
static <T> T |
waitUntil(<any> blockCondition)
Deprecated.
deprecated since 3.0 to to be replaced by
ThreadSynchronize#block(BlockCondition) |
static javafx.beans.value.ObservableValue<javafx.stage.Window> |
windowProperty(javafx.scene.Node n)
Get the window property of a node
|
public static final java.lang.String FIND_NODE_EXCLUDE
public static final boolean MNEMONICS_FIX
public static java.lang.String dumpSceneGraph(javafx.scene.Node n)
n - the node to start withpublic static javafx.scene.Node toNode(StyledString s)
s - the stringpublic static javafx.scene.Node findNode(javafx.stage.Window w,
double screenX,
double screenY)
w - the preferred windowscreenX - the screen xscreenY - the screen ynullpublic static javafx.scene.Node findNode(javafx.scene.Node n,
double screenX,
double screenY)
n - the node to use as the startscreenX - the screen xscreenY - the screen ynullpublic static javafx.beans.value.ObservableValue<javafx.stage.Window> windowProperty(javafx.scene.Node n)
n - the node the window property to observepublic static <T,E> Subscription bindContent(java.util.List<T> target,
javafx.collections.ObservableList<E> sourceList,
java.util.function.Function<E,T> converterFunction)
FXObservableUtils#bindContent(List, ObservableList, Function)T - the target typeE - the source typetarget - the target listsourceList - the source listconverterFunction - the function used to convertpublic static <T,E> java.util.List<T> transformList(java.util.List<? extends E> list,
java.util.function.Function<E,T> converterFunction)
list - the listconverterFunction - the converter functionpublic static Subscription installHoverCallback(javafx.scene.Node node,
javafx.util.Duration delay,
java.util.function.Consumer<javafx.scene.input.MouseEvent> hoverConsumer)
node - the node the hover is installed ondelay - the delayhoverConsumer - the consumerpublic static void enterNestedEventLoop(java.lang.String id)
id - the id of the nested event looppublic static void exitNestedEventLoop(java.lang.String id)
id - the nested event loop@Deprecated public static <T> T waitUntil(<any> blockCondition)
ThreadSynchronize#block(BlockCondition)blockCondition - the conditionpublic static double getTextWidth(java.lang.String text,
javafx.scene.text.Font font,
double fontZoomFactor)
text - the textfont - the fontpublic static javafx.beans.binding.DoubleBinding createTextWidthBinding(javafx.beans.value.ObservableValue<java.lang.String> text,
javafx.beans.value.ObservableValue<javafx.scene.text.Font> font,
javafx.beans.value.ObservableValue<java.lang.Number> fontZoomFactor)
text - font - public static javafx.beans.binding.DoubleBinding createTextWidthBinding(java.lang.String text,
javafx.beans.value.ObservableValue<javafx.scene.text.Font> font,
javafx.beans.value.ObservableValue<java.lang.Number> fontZoomFactor)
public static double getTextHeight(java.lang.String text,
javafx.scene.text.Font font,
double fontZoomFactor)
public static javafx.beans.binding.DoubleBinding createTextHeightBinding(java.lang.String text,
javafx.beans.value.ObservableValue<javafx.scene.text.Font> font,
javafx.beans.value.ObservableValue<java.lang.Number> fontZoomFactor)
public static boolean isCopyEvent(javafx.scene.input.MouseEvent event)
public static Size getSize(javafx.scene.text.Font font,
char c)
font - the fontc - the characterpublic static javafx.scene.layout.Background getSimpleBackground(javafx.scene.paint.Paint p)
p - the paintpublic static javafx.beans.property.BooleanProperty createPseudoClassProperty(javafx.css.PseudoClass cls,
javafx.scene.Node node,
java.lang.String name,
boolean def)
A pseudo class property is a BooleanProperty which updates the containers pseudo class state on invalidation.
cls - the pseudo classnode - the container nodename - the properties name (not to confuse with the pseudo class name,
those may be different)def - the initial valuepublic static javafx.beans.property.BooleanProperty createPseudoClassProperty(java.lang.String pseudoClass,
javafx.scene.Node node,
java.lang.String name,
boolean def)
A pseudo class property is a BooleanProperty which updates the containers pseudo class state on invalidation.
Convenience method if you do not need to hold the instance of the PseudoClass
pseudoClass - the pseudo class stringnode - the container nodename - the properties name (not to confuse with the pseudo class name,
those may be different)def - the initial value