Top Description Inners Fields Constructors Methods
com.sun.jfx.incubator.scene.control.input

public abstract sealed Class SkinInputMap

extends Object
permits Stateful, SkinInputMap.Stateless<C>
Class Inheritance
Known Direct Subclasses
com.sun.jfx.incubator.scene.control.input.SkinInputMap.Stateful, com.sun.jfx.incubator.scene.control.input.SkinInputMap.Stateless
Imports
java.util.HashMap, .HashSet, .Iterator, .Map, .Set, java.util.function.BooleanSupplier, javafx.event.Event, .EventHandler, .EventType, javafx.scene.control.Control, javafx.scene.input.KeyCode, jfx.incubator.scene.control.input.FunctionTag, .KeyBinding

The Input Map for use by the Skin.

Skins whose behavior encapsulates state information must use a Stateful variant obtained with the create() factory method.

Skins whose behavior requires no state, or when state is fully encapsulated by the Control itself, could use a Stateless variant obtained with the createStateless() method.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
SkinInputMap.Stateful

SkinInputMap for skins that maintain stateful behaviors

public static class
SkinInputMap.Stateless<
the type of Control
C extends Control
>

SkinInputMap for skins that either encapsulate the state fully in their Controls, or don't require a state at all.

public static interface

Field Summary

Modifier and TypeField and Description
public final KeyEventMapper
pack-priv final HashMap<Object, Object>
map

 KeyBinding -> FunctionTag
FunctionTag -> Runnable or FunctionHandler
EventType -> PHList

Constructor Summary

AccessConstructor and Description
public
SkinInputMap()

Creates a skin input map.

Method Summary

Modifier and TypeMethod and Description
public final <
the actual event type
T extends Event
>
void
addHandler(EventType<T>
the event type
type
,
EventHandler<T>
the event handler
handler
)

Adds an event handler for the specified event type, in the context of this skin.

public final <
the actual event type
T extends Event
>
void
addHandler(EventCriteria<T>
the matching criteria
criteria
,
EventHandler<T>
the event handler
handler
)

Adds an event handler for the specific event criteria, in the context of this skin.

public Set<KeyBinding>
public static SkinInputMap.Stateful

Returns:

the stateful SkinInputMap
create
()

Creates the stateful SkinInputMap.

public static <
the type of Control
C extends Control
>
SkinInputMap.Stateless<C>

Returns:

the stateless SkinInputMap
createStateless
()

Creates the stateless SkinInputMap.

public final void
duplicateMapping(KeyBinding
the existing key binding
existing
,
KeyBinding
the new key binding
newk
)

This convenience method registers a copy of the behavior-specific mappings from one key binding to another.

public final boolean
execute(Object source, FunctionTag tag)

public void
public final Set<KeyBinding>

Returns:

a Set of key bindings
getKeyBindings
()

Collects the key bindings mapped by the skin.

public final Set<KeyBinding>

Returns:

the set of KeyBindings
getKeyBindingsFor
(FunctionTag
the function tag
tag
)

Returns the set of key bindings mapped to the specified function tag.

private <T extends Event> void
public final void
registerKey(KeyBinding
the key binding
k
,
FunctionTag
the function tag
tag
)

Maps a key binding to the specified function tag.

public final void
registerKey(KeyCode
the key code to construct a KeyBinding
code
,
FunctionTag
the function tag
tag
)

Maps a key binding to the specified function tag.

public Object
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

kmapperback to summary
public final KeyEventMapper kmapper
mapback to summary
pack-priv final HashMap<Object, Object> map
 KeyBinding -> FunctionTag
FunctionTag -> Runnable or FunctionHandler
EventType -> PHList

Constructor Detail

SkinInputMapback to summary
public SkinInputMap()

Creates a skin input map.

Method Detail

addHandlerback to summary
public final <T extends Event> void addHandler(EventType<T> type, EventHandler<T> handler)

Adds an event handler for the specified event type, in the context of this skin.

Parameters
<T>
the actual event type
type:EventType<T>

the event type

handler:EventHandler<T>

the event handler

addHandlerback to summary
public final <T extends Event> void addHandler(EventCriteria<T> criteria, EventHandler<T> handler)

Adds an event handler for the specific event criteria, in the context of this skin. This is a more specific version of addHandler(EventType, EventHandler) method.

Parameters
<T>
the actual event type
criteria:EventCriteria<T>

the matching criteria

handler:EventHandler<T>

the event handler

collectKeyBindingsback to summary
public Set<KeyBinding> collectKeyBindings(Set<KeyBinding> bindings, FunctionTag tag)
createback to summary
public static SkinInputMap.Stateful create()

Creates the stateful SkinInputMap.

Returns:SkinInputMap.Stateful

the stateful SkinInputMap

createStatelessback to summary
public static <C extends Control> SkinInputMap.Stateless<C> createStateless()

Creates the stateless SkinInputMap.

Parameters
<C>
the type of Control
Returns:SkinInputMap.Stateless<C>

the stateless SkinInputMap

duplicateMappingback to summary
public final void duplicateMapping(KeyBinding existing, KeyBinding newk)

This convenience method registers a copy of the behavior-specific mappings from one key binding to another. The method does nothing if no behavior specific mapping can be found.

Parameters
existing:KeyBinding

the existing key binding

newk:KeyBinding

the new key binding

executeback to summary
public final boolean execute(Object source, FunctionTag tag)
forEachback to summary
public void forEach(SkinInputMap.TriConsumer<T extends Event> client)
getKeyBindingsback to summary
public final Set<KeyBinding> getKeyBindings()

Collects the key bindings mapped by the skin.

Returns:Set<KeyBinding>

a Set of key bindings

getKeyBindingsForback to summary
public final Set<KeyBinding> getKeyBindingsFor(FunctionTag tag)

Returns the set of key bindings mapped to the specified function tag.

Parameters
tag:FunctionTag

the function tag

Returns:Set<KeyBinding>

the set of KeyBindings

putHandlerback to summary
private <T extends Event> void putHandler(EventType<T> type, EventHandlerPriority pri, EventHandler<T> handler)
registerKeyback to summary
public final void registerKey(KeyBinding k, FunctionTag tag)

Maps a key binding to the specified function tag.

Parameters
k:KeyBinding

the key binding

tag:FunctionTag

the function tag

registerKeyback to summary
public final void registerKey(KeyCode code, FunctionTag tag)

Maps a key binding to the specified function tag.

Parameters
code:KeyCode

the key code to construct a KeyBinding

tag:FunctionTag

the function tag

resolveback to summary
public Object resolve(KeyBinding k)
unbindback to summary
public void unbind(FunctionTag tag)
com.sun.jfx.incubator.scene.control.input back to summary

public final Class SkinInputMap.Stateful

extends SkinInputMap
Class Inheritance

SkinInputMap for skins that maintain stateful behaviors

Field Summary

Inherited from com.sun.jfx.incubator.scene.control.input.SkinInputMap:
kmappermap

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final void
register(FunctionTag
the function tag
tag
,
KeyBinding
the key binding
k
,
Runnable
the function
func
)

This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag.

public final void
register(FunctionTag
the function tag
tag
,
KeyCode
the key code
code
,
Runnable
the function
func
)

This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag.

public final void
registerFunction(FunctionTag
the function tag
tag
,
Runnable
the function
function
)

Maps a function to the specified function tag.

public final void
registerFunction(FunctionTag
the function tag
tag
,
BooleanSupplier
the function
function
)

Maps a function to the specified function tag.

Inherited from com.sun.jfx.incubator.scene.control.input.SkinInputMap:
addHandleraddHandlercollectKeyBindingscreatecreateStatelessduplicateMappingexecuteforEachgetKeyBindingsgetKeyBindingsForregisterKeyregisterKeyresolveunbind

Constructor Detail

Statefulback to summary
pack-priv Stateful()

Method Detail

registerback to summary
public final void register(FunctionTag tag, KeyBinding k, Runnable func)

This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag.

Parameters
tag:FunctionTag

the function tag

k:KeyBinding

the key binding

func:Runnable

the function

registerback to summary
public final void register(FunctionTag tag, KeyCode code, Runnable func)

This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag.

Parameters
tag:FunctionTag

the function tag

code:KeyCode

the key code

func:Runnable

the function

registerFunctionback to summary
public final void registerFunction(FunctionTag tag, Runnable function)

Maps a function to the specified function tag.

Parameters
tag:FunctionTag

the function tag

function:Runnable

the function

registerFunctionback to summary
public final void registerFunction(FunctionTag tag, BooleanSupplier function)

Maps a function to the specified function tag.

The event which triggered execution of the function will be consumed if the function returns true.

Parameters
tag:FunctionTag

the function tag

function:BooleanSupplier

the function

com.sun.jfx.incubator.scene.control.input back to summary

public final Class SkinInputMap.Stateless<C extends Control>

extends SkinInputMap
Class Inheritance
Type Parameters
<C>
the type of Control

SkinInputMap for skins that either encapsulate the state fully in their Controls, or don't require a state at all.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
SkinInputMap.Stateless.FHandler<
the type of Control
C
>

The function handler that always consumes the corresponding event.

public static interface
SkinInputMap.Stateless.FHandlerConditional<
the type of Control
C
>

The function handler that allows to control whether the corresponding event will get consumed.

Field Summary

Inherited from com.sun.jfx.incubator.scene.control.input.SkinInputMap:
kmappermap

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final void
register(FunctionTag
the function tag
tag
,
KeyBinding
the key binding
k
,
SkinInputMap.Stateless.FHandler<C>
the function
func
)

This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag.

public final void
register(FunctionTag
the function tag
tag
,
KeyCode
the key code
code
,
SkinInputMap.Stateless.FHandler<C>
the function
func
)

This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag.

public final void
registerFunction(FunctionTag
the function tag
tag
,
SkinInputMap.Stateless.FHandler<C>
the function
function
)

Maps a function to the specified function tag.

public final void
registerFunction(FunctionTag
the function tag
tag
,
SkinInputMap.Stateless.FHandlerConditional<C>
the function
function
)

Maps a function to the specified function tag.

Inherited from com.sun.jfx.incubator.scene.control.input.SkinInputMap:
addHandleraddHandlercollectKeyBindingscreatecreateStatelessduplicateMappingexecuteforEachgetKeyBindingsgetKeyBindingsForregisterKeyregisterKeyresolveunbind

Constructor Detail

Statelessback to summary
pack-priv Stateless()

Method Detail

registerback to summary
public final void register(FunctionTag tag, KeyBinding k, SkinInputMap.Stateless.FHandler<C> func)

This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag.

Parameters
tag:FunctionTag

the function tag

k:KeyBinding

the key binding

func:SkinInputMap.Stateless.FHandler<C>

the function

registerback to summary
public final void register(FunctionTag tag, KeyCode code, SkinInputMap.Stateless.FHandler<C> func)

This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag.

Parameters
tag:FunctionTag

the function tag

code:KeyCode

the key code

func:SkinInputMap.Stateless.FHandler<C>

the function

registerFunctionback to summary
public final void registerFunction(FunctionTag tag, SkinInputMap.Stateless.FHandler<C> function)

Maps a function to the specified function tag.

Parameters
tag:FunctionTag

the function tag

function:SkinInputMap.Stateless.FHandler<C>

the function

registerFunctionback to summary
public final void registerFunction(FunctionTag tag, SkinInputMap.Stateless.FHandlerConditional<C> function)

Maps a function to the specified function tag. This method allows for controlling whether the matching event will be consumed or not.

Parameters
tag:FunctionTag

the function tag

function:SkinInputMap.Stateless.FHandlerConditional<C>

the function

com.sun.jfx.incubator.scene.control.input back to summary

public Interface SkinInputMap.Stateless.FHandler<C>

Type Parameters
<C>
the type of Control

The function handler that always consumes the corresponding event.

Method Summary

Modifier and TypeMethod and Description
public void
handleFunction(C
the instance of Control
control
)

The function mapped to a key binding.

Method Detail

handleFunctionback to summary
public void handleFunction(C control)

The function mapped to a key binding.

Parameters
control:C

the instance of Control

com.sun.jfx.incubator.scene.control.input back to summary

public Interface SkinInputMap.Stateless.FHandlerConditional<C>

Type Parameters
<C>
the type of Control

The function handler that allows to control whether the corresponding event will get consumed.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true to consume the event, false otherwise
handleFunction
(C
the instance of Control
control
)

The function mapped to a key binding.

Method Detail

handleFunctionback to summary
public boolean handleFunction(C control)

The function mapped to a key binding. The return value instructs the owning InputMap to consume the triggering event or not.

Parameters
control:C

the instance of Control

Returns:boolean

true to consume the event, false otherwise

com.sun.jfx.incubator.scene.control.input back to summary

public Interface SkinInputMap.TriConsumer<T extends Event>

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public void

Method Detail

acceptback to summary
public void accept(EventType<T> type, EventHandlerPriority pri, EventHandler<T> h)