public interface NodeUtils
Utility class for working with nodes.
- Author:
- Besmir Beqiri, Indrit Beqiri
-
Field Summary
Fields -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T extends javafx.event.Event>
voidaddEventHandler(javafx.scene.Node node, javafx.event.EventType<T> eventType, javafx.event.EventHandler<? super T> eventHandler) Adds an event handler to the specified node for the given event type.static <K,V> V getPropertyValue(javafx.scene.Node node, K key, V defaultValue) Retrieves the value of a property associated with the given key from a node.
-
Field Details
-
MULTI_FILE_UPLOADER_KEY
-
EVENT_HANDLER_KEY
-
-
Method Details
-
getPropertyValue
static <K,V> V getPropertyValue(javafx.scene.Node node, K key, V defaultValue) Retrieves the value of a property associated with the given key from a node.- Type Parameters:
K- the type of the keyV- the type of the value- Parameters:
node- the node to retrieve the property value fromkey- the key of the property to retrievedefaultValue- the default value to return if the property does not exist- Returns:
- the value of the property associated with the given key, or the default value if the property does not exist
-
addEventHandler
static <T extends javafx.event.Event> void addEventHandler(javafx.scene.Node node, javafx.event.EventType<T> eventType, javafx.event.EventHandler<? super T> eventHandler) Adds an event handler to the specified node for the given event type. If an event handler for the event type is already added, it will not add another one.- Type Parameters:
T- the type of the event- Parameters:
node- the node to which the event handler will be addedeventType- the type of the event to handleeventHandler- the event handler to be added
-