| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | addClassesIfAbsent(Styleable
The node to add the style classes to. node, String... The style classes to add. styleClasses)Adds a list of style classes to a node if they are not already present. |
| public static void | addClassIfAbsent(Styleable
The node to add the style class to. node, String The style class to add. styleClass)Adds a style class to a node if it is not already present. |
| public static String | Returns: A string in natural language format, with appropriate spaces and capitalization.The camelCase string to be converted. camelCaseString)Converts a camelCase string to a natural language expression. |
| public static <T extends Enum | clearStylesByEnum(Styleable
The Node to clear styles from. node, Class<T> The enum class whose associated styles will be removed.
enumClass)Example If Dir.class is passed, removes all styles {"up","down","left", "right"}. Removes all styles associated with a given enum class from a Node. |
| public static void | copyToClipboard(String
The content to be copied to the clipboard. copyContent)Copies the specified content to the clipboard. |
| public static double | |
| public static double | |
| public static boolean | Returns: true if the event is a single stable primary button click, false otherwise.The mouse event to check. Must not be null. event)Determines if the given mouse event is a primary button click that hasn't moved since it was pressed. |
| public static boolean | Returns: true if the event is a stable primary button click, false otherwise.The mouse event to check. Must not be null. event, boolean true if the event must be a single click, false otherwise.Determines if the given mouse clicked event is a primary button click that hasn't moved since it was pressed. |
| public static void | toggleClass(Styleable
The node to toggle the style on. node, String The style class to add or remove. styleClass)Toggles a style class on a node. |
| public static void | toggleClassBasedOnObservable(Styleable
The node to toggle the style on. node, String The style class to add or remove. styleClass, ObservableValue<Boolean> The observable value that determines whether to add or remove the style. booleanObservableValue)Toggles a style class on a node based on an observable value. |
| public static void | toggleClassOnCondition(Styleable
The node to toggle the style on. node, String The style class to add or remove. styleClass, boolean The condition that determines whether to add or remove the style. condition)Toggles a style class on a node based on a condition. |
| public static <T extends Enum | updateStyleFromEnum(Styleable
The Node to update. node, T The enum value determining the style to apply.
enumValue)Example If Dir.UP is passed, add "up" style and removes {"down", "left", "right"} styles. Applies a style derived from an enum value to a Node, removing other styles from the same enum class. |
| public static void | updateStyles(Styleable
The node whose styles are to be updated. node, List<String> A list of styles to be removed from the node, except for the styleToAdd. stylesToRemove, String The style to be added to the node, if it's not already present. styleToAdd)Optimizes style updates for a given node by first adding a specified style to ensure it's present, and then removing other specified styles, except the newly added one. |
| public static void | updateStyles(Styleable
The node whose styles are to be updated. node, String[] An array of styles to be removed from the node, except for the styleToAdd. stylesToRemove, String The style to be added to the node, if it's not already present. styleToAdd)Optimizes style updates for a given node by first adding a specified style to ensure it's present, and then removing other specified styles, except the newly added one. |
| UIUtil | back to summary |
|---|---|
| private UIUtil() | |
| addClassesIfAbsent | back to summary |
|---|---|
| public static void addClassesIfAbsent(Styleable node, String... styleClasses) Adds a list of style classes to a node if they are not already present. | |
| addClassIfAbsent | back to summary |
|---|---|
| public static void addClassIfAbsent(Styleable node, String styleClass) Adds a style class to a node if it is not already present. | |
| camelCaseToNaturalCase | back to summary |
|---|---|
| public static String camelCaseToNaturalCase(String camelCaseString) Converts a camelCase string to a natural language expression. This method is designed to transform strings formatted in camelCase, commonly used in programming, into a more readable format that is suitable for display in user interfaces. It inserts spaces between words and ensures that acronyms remain capitalized while the first letter of the resulting string is also capitalized. Example: "ONSCode" becomes "ONS Code" "customerServiceOrder" becomes "Customer Service Order" | |
| clearStylesByEnum | back to summary |
|---|---|
| public static <T extends Enum Removes all styles associated with a given enum class from a Node. | |
| copyToClipboard | back to summary |
|---|---|
| public static void copyToClipboard(String copyContent) Copies the specified content to the clipboard.
| |
| getInsetsHeight | back to summary |
|---|---|
| public static double getInsetsHeight(Insets insets) Returns the height of the top and bottom insets combined. | |
| getInsetsWidth | back to summary |
|---|---|
| public static double getInsetsWidth(Insets insets) Returns the width of the left and right insets combined. | |
| isClickOnNode | back to summary |
|---|---|
| public static boolean isClickOnNode(MouseEvent event) Determines if the given mouse event is a primary button click that hasn't moved since it was pressed. This method checks if the mouse event satisfies the following conditions:
| |
| isClickOnNode | back to summary |
|---|---|
| public static boolean isClickOnNode(MouseEvent event, boolean isSingleClick) Determines if the given mouse clicked event is a primary button click that hasn't moved since it was pressed. This method checks if the mouse event satisfies the following conditions:
| |
| toggleClass | back to summary |
|---|---|
| public static void toggleClass(Styleable node, String styleClass) Toggles a style class on a node. If the style class is present, it is removed. If it is not present, it is added. | |
| toggleClassBasedOnObservable | back to summary |
|---|---|
| public static void toggleClassBasedOnObservable(Styleable node, String styleClass, ObservableValue<Boolean> booleanObservableValue) Toggles a style class on a node based on an observable value. If the observable value is true, the style class is added. If the observable value is false, the style class is removed.
| |
| toggleClassOnCondition | back to summary |
|---|---|
| public static void toggleClassOnCondition(Styleable node, String styleClass, boolean condition) Toggles a style class on a node based on a condition. If the condition is true, the style class is added. If the condition is false, the style class is removed. | |
| updateStyleFromEnum | back to summary |
|---|---|
| public static <T extends Enum Applies a style derived from an enum value to a Node, removing other styles from the same enum class.
| |
| updateStyles | back to summary |
|---|---|
| public static void updateStyles(Styleable node, List<String> stylesToRemove, String styleToAdd) Optimizes style updates for a given node by first adding a specified style to ensure it's present, and then removing other specified styles, except the newly added one. This approach helps in preventing unnecessary UI flicker by avoiding the removal of a style that needs to be present. | |
| updateStyles | back to summary |
|---|---|
| public static void updateStyles(Styleable node, String[] stylesToRemove, String styleToAdd) Optimizes style updates for a given node by first adding a specified style to ensure it's present, and then removing other specified styles, except the newly added one. This approach helps in preventing unnecessary UI flicker by avoiding the removal of a style that needs to be present. | |