Top Description Inners Fields Constructors Methods
com.sun.javafx.scene.control.inputmap

public Class InputMap<N extends Node>

extends Object
implements EventHandler<Event>
Class Inheritance
All Implemented Interfaces
javafx.event.EventHandler, java.util.EventListener
Type Parameters
<N>
The type of the Node that the InputMap is installed in.
Imports
javafx.beans.property.BooleanProperty, .ObjectProperty, .ReadOnlyObjectProperty, .ReadOnlyObjectWrapper, .SimpleBooleanProperty, .SimpleObjectProperty, javafx.collections.FXCollections, .ListChangeListener, .ObservableList, javafx.event.Event, .EventHandler, .EventType, javafx.scene.Node, javafx.scene.input.KeyCode, .KeyEvent, .MouseEvent, javafx.util.Pair, java.util.ArrayList, .Collections, .HashMap, .List, .Map, .Objects, .Optional, java.util.function.Predicate, java.util.stream.Collectors

InputMap is a class that is set on a given Node. When the Node receives an input event from the system, it passes this event in to the InputMap where the InputMap can check all installed mappings to see if there is any suitable mapping, and if so, fire the provided EventHandler.
Since
9

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
InputMap.KeyMapping

The KeyMapping class provides API to specify mappings related to key input.

public static class
InputMap.KeyMappingInterceptor

Convenience class that can act as an keyboard input interceptor, either at a input map level or a mapping level.

public abstract static class
InputMap.Mapping<
The type of Event the mapping represents.
T extends Event
>

Abstract base class for all input mappings as used by the InputMap class.

public static class
InputMap.MouseMapping

The MouseMapping class provides API to specify mappings related to mouse input.

public static class
InputMap.MouseMappingInterceptor

Convenience class that can act as a mouse input interceptor, either at a input map level or a mapping level.

Field Summary

Modifier and TypeField and Description
private final ObservableList<InputMap<N>>
private final Map<EventType<T extends Event>, List<InputMap.Mapping<T extends Event>>>
private final Map<EventType<?>, List<EventHandler<? super Event>>>
private ObjectProperty<Predicate<? extends Event>>
interceptor

The role of the interceptor is to block the InputMap on which it is set from executing any mappings (contained within itself, or within a child InputMap, whenever the interceptor returns true.

private final ObservableList<InputMap.Mapping<?>>
private final N
node

* Private fields * *

private ReadOnlyObjectWrapper<InputMap<N>>
parentInputMap

* Properties * *

Constructor Summary

AccessConstructor and Description
public
InputMap(N
The Node for which this InputMap is attached.
node
)

Creates the new InputMap instance which is related specifically to the given Node.

Method Summary

Modifier and TypeMethod and Description
private void
private void
public void
dispose()

Disposes all child InputMaps, removes all event handlers from the Node, and clears the mappings list.

public ObservableList<InputMap<N>>
getChildInputMaps()

A mutable list of child InputMaps.

public final Predicate<? extends Event>
public ObservableList<InputMap.Mapping<?>>
getMappings()

A mutable list of input mappings.

public final N
getNode()

The Node for which this InputMap is attached.

private final InputMap<N>
private InputMap<N>
public void
handle(Event
the event which occurred
e
)

Implements javafx.event.EventHandler.handle.

Invoked when a specific event of the type for which this handler is registered happens.

public final ObjectProperty<Predicate<? extends Event>>
private List<InputMap.Mapping<?>>
lookup(Event event, boolean testInterceptors)

public Optional<InputMap.Mapping<?>>
lookupMapping(Object mappingKey)

Looks up the most specific mapping given the input, ignoring all interceptors.

private List<Pair<Integer, InputMap.Mapping<?>>>
lookupMappingAndSpecificity(final Event event, final int minSpecificity)

private List<InputMap.Mapping<?>>
lookupMappingKey(Object mappingKey)

* Private implementation * *

private final ReadOnlyObjectProperty<InputMap<N>>
private void
private void
private void
private int
scanRecursively(InputMap<?> inputMap, Event event, boolean testInterceptors, int minSpecificity, List<InputMap.Mapping<?>> mappings)

public final void
setInterceptor(Predicate<? extends Event> value)

private final void
private boolean
testInterceptor(Event e, Predicate<T> interceptor)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait