Package com.luciad.view
Class TLcdFXEventFilterBuilder
java.lang.Object
com.luciad.view.TLcdFXEventFilterBuilder
A builder to create JavaFX Event
filters. Event filters can be useful when constructing
controller chains (see ALspController.setFXFilter(ILcdFilter)
).
Filters can be combined using the operators
and()
and or()
. By using openBrackets()
and closeBrackets()
it is possible to control which operators will be evaluated first. Operators between brackets
will be evaluated before any others, otherwise and
will be evaluated before
or
. For instance the following statement:
TLcdFXEventFilterBuilder
.newBuilder()
.openBrackets().leftMouseButton().or().rightMouseButton().closeBrackets()
.and()
.altFilter(true)
.build();
The AWT equivalent of this class is TLcdAWTEventFilterBuilder
.
- Since:
- 2020.0
-
Method Summary
Modifier and TypeMethodDescriptionaltFilter
(boolean aAltDown) Adds a alt down InputEvent filter.and()
Operator to be called between two filter calls to indicate the event must pass both filters.build()
Builds the filter.Ends a new subfilter, all filters and operators called between this call and the previous call toopenBrackets
will be evaluated together before operators and filters outside the brackets are evaluated.ctrlFilter
(boolean aCtrlDown) Adds a ctrl (cmd on macOS) down InputEvent filter.customFilter
(ILcdFilter<Event> aFilter) Adds a custom filter.A filter that only allows key events to pass.Adds a left mouse button filter.Adds a middle mouse button filter.A filter that only allows mouse and scroll events to pass.A filter that only allows mouse wheel events to pass.static TLcdFXEventFilterBuilder
Returns a new JavaFX event filter builder.Starts a new subfilter, all filters and operators called between this call and the next call tocloseBrackets
will be evaluated together before operators and filters outside the brackets are evaluated.or()
Operator to be called between two filter calls to indicate the event must pass one of the two filters.Adds a right mouse button filter.shiftFilter
(boolean aShiftDown) Adds a shift down InputEvent filter.A filter that only allows touch events to pass.
-
Method Details
-
newBuilder
Returns a new JavaFX event filter builder.- Returns:
- a new builder
-
or
Operator to be called between two filter calls to indicate the event must pass one of the two filters.- Returns:
- this builder.
-
and
Operator to be called between two filter calls to indicate the event must pass both filters.- Returns:
- this builder.
-
openBrackets
Starts a new subfilter, all filters and operators called between this call and the next call tocloseBrackets
will be evaluated together before operators and filters outside the brackets are evaluated.- Returns:
- the sub-filter.
-
closeBrackets
Ends a new subfilter, all filters and operators called between this call and the previous call toopenBrackets
will be evaluated together before operators and filters outside the brackets are evaluated.- Returns:
- the parent of the current sub-filter.
-
build
Builds the filter.- Returns:
- an Event filter.
-
customFilter
Adds a custom filter.- Parameters:
aFilter
- the filter to add to this builder.- Returns:
- this builder.
-
leftMouseButton
Adds a left mouse button filter. On macOS, this does not filter ctrl + left mouse button, because this is interpreted as a right mouse button.- Returns:
- this builder.
-
middleMouseButton
Adds a middle mouse button filter.- Returns:
- this builder.
-
rightMouseButton
Adds a right mouse button filter. On macOS, this also filters ctrl + left mouse button.- Returns:
- this builder.
-
ctrlFilter
Adds a ctrl (cmd on macOS) down InputEvent filter.- Parameters:
aCtrlDown
- if true only events with a ctrl down mask pass, otherwise only events without ctrl down mask.- Returns:
- this builder.
-
altFilter
Adds a alt down InputEvent filter.- Parameters:
aAltDown
- if true only events with a alt down mask pass, otherwise only events without alt down mask.- Returns:
- this builder.
-
shiftFilter
Adds a shift down InputEvent filter.- Parameters:
aShiftDown
- if true only events with a shift down mask pass, otherwise only events without shift down mask.- Returns:
- this builder.
-
mouseWheelFilter
A filter that only allows mouse wheel events to pass.- Returns:
- this builder.
-
touchEvents
A filter that only allows touch events to pass.- Returns:
- this builder.
-
mouseEvents
A filter that only allows mouse and scroll events to pass.- Returns:
- this builder.
-
keyEvents
A filter that only allows key events to pass.- Returns:
- this builder.
-