Class KeyEventBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.KeyEventBuilder
The
KeyEventBuilder
class constructs instances of the KeyEvent
class
and offers a fluent interface for creating and configuring it.
This class includes a static create
method that accepts the same arguments as the original KeyEvent
constructor
and returns an instance of the KeyEventBuilder
.
You can use method chaining to call the builder methods for configuring the KeyEvent
.
Finally, invoke the build
method to generate an instance of the KeyEvent
class.
Note that intermediate builder methods are not evaluated until the build
method
is called, meaning they are evaluated lazily.
- Author:
- Hidekazu Kubota <hidekazu.kubota@gmail.com>
-
Method Summary
Modifier and TypeMethodDescriptionApplies a function to the KeyEvent instance being constructed.build()
Builds and returns an instance of theKeyEvent
class.static KeyEventBuilder
create
(Object source, EventTarget target, EventType<KeyEvent> eventType, String character, String text, KeyCode code, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown) Accepts the constructor arguments ofKeyEvent(Object, EventTarget, EventType, String, String, KeyCode, boolean, boolean, boolean, boolean)
and returns an instance ofKeyEventBuilder
.static KeyEventBuilder
create
(EventType<KeyEvent> eventType, String character, String text, KeyCode code, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown) Accepts the constructor arguments ofKeyEvent(EventType, String, String, KeyCode, boolean, boolean, boolean, boolean)
and returns an instance ofKeyEventBuilder
.
-
Method Details
-
create
public static KeyEventBuilder create(Object source, EventTarget target, EventType<KeyEvent> eventType, String character, String text, KeyCode code, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown) Accepts the constructor arguments ofKeyEvent(Object, EventTarget, EventType, String, String, KeyCode, boolean, boolean, boolean, boolean)
and returns an instance ofKeyEventBuilder
.- Returns:
- an instance of the
KeyEventBuilder
.
-
create
public static KeyEventBuilder create(EventType<KeyEvent> eventType, String character, String text, KeyCode code, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown) Accepts the constructor arguments ofKeyEvent(EventType, String, String, KeyCode, boolean, boolean, boolean, boolean)
and returns an instance ofKeyEventBuilder
.- Returns:
- an instance of the
KeyEventBuilder
.
-
build
-
apply
Applies a function to the KeyEvent instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-