Top Description Fields Constructors Methods
org.fxmisc.wellbehaved.event

public Class Nodes

extends Object
Class Inheritance
Imports
java.util.AbstractMap.SimpleEntry, .ArrayList, .List, .Map, .Map.Entry, .Stack, javafx.collections.MapChangeListener, .ObservableMap, javafx.event.Event, .EventHandler, .EventType, javafx.scene.Node, org.fxmisc.wellbehaved.event.InputMap.HandlerConsumer

Helper class for "installing/uninstalling" an InputMap into a Node.

Method Summary

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
addFallbackInputMap(Node node, InputMap<?> im)

Adds the given input map to the end of the node's list of input maps, so that an event will be pattern-matched against all other input maps currently "installed" in the node before being pattern-matched against the given input map.

public static void
addInputMap(Node node, InputMap<?> im)

Adds the given input map to the start of the node's list of input maps, so that an event will be pattern-matched against the given input map before being pattern-matched against any other input maps currently "installed" in the node.

private static List<Map.Entry<EventType<?>, EventHandler<?>>>
public static InputMap<?>
getInputMap(Node node)

Gets the InputMap for the given node or InputMap#empty() if there is none.

private static InputMap<?>
getInputMapUnsafe(Node node)

Expects a init(Node) call with the given node before this one is called

private static ObservableMap<Object, Object>
private static Stack<InputMap<?>>
getStack(Node node)

private static void
init(Node node)

public static boolean
popInputMap(Node node)

If the internal stack has an InputMap, removes the current InputMap that was installed on the give node via pushInputMap(Node, InputMap), reinstalls the previous InputMap, and then returns true.

public static void
pushInputMap(Node node, InputMap<?> im)

Removes the currently installed InputMap (InputMap1) on the given node and installs the im (InputMap2) in its place.

public static void
removeInputMap(Node node, InputMap<?> im)

Removes (or uninstalls) the given input map from the node.

private static void
setInputMapUnsafe(Node node, InputMap<?> im)

Expects a init(Node) call with the given node before this one is called

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

P_HANDLERSback to summary
private static final String P_HANDLERS
P_INPUTMAPback to summary
private static final String P_INPUTMAP
P_STACKback to summary
private static final String P_STACK

Constructor Detail

Nodesback to summary
public Nodes()

Method Detail

addFallbackInputMapback to summary
public static void addFallbackInputMap(Node node, InputMap<?> im)

Adds the given input map to the end of the node's list of input maps, so that an event will be pattern-matched against all other input maps currently "installed" in the node before being pattern-matched against the given input map.

addInputMapback to summary
public static void addInputMap(Node node, InputMap<?> im)

Adds the given input map to the start of the node's list of input maps, so that an event will be pattern-matched against the given input map before being pattern-matched against any other input maps currently "installed" in the node.

getHandlersback to summary
private static List<Map.Entry<EventType<?>, EventHandler<?>>> getHandlers(Node node)
getInputMapback to summary
public static InputMap<?> getInputMap(Node node)

Gets the InputMap for the given node or InputMap#empty() if there is none.

getInputMapUnsafeback to summary
private static InputMap<?> getInputMapUnsafe(Node node)

Expects a init(Node) call with the given node before this one is called

getPropertiesback to summary
private static ObservableMap<Object, Object> getProperties(Node node)
getStackback to summary
private static Stack<InputMap<?>> getStack(Node node)
initback to summary
private static void init(Node node)
popInputMapback to summary
public static boolean popInputMap(Node node)

If the internal stack has an InputMap, removes the current InputMap that was installed on the give node via pushInputMap(Node, InputMap), reinstalls the previous InputMap, and then returns true. If the stack is empty, returns false.

pushInputMapback to summary
public static void pushInputMap(Node node, InputMap<?> im)

Removes the currently installed InputMap (InputMap1) on the given node and installs the im (InputMap2) in its place. When finished, InputMap2 can be uninstalled and InputMap1 reinstalled via popInputMap(Node). Multiple InputMaps can be installed so that InputMap(n) will be installed over InputMap(n-1)

removeInputMapback to summary
public static void removeInputMap(Node node, InputMap<?> im)

Removes (or uninstalls) the given input map from the node.

setInputMapUnsafeback to summary
private static void setInputMapUnsafe(Node node, InputMap<?> im)

Expects a init(Node) call with the given node before this one is called