Class TouchEventBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.TouchEventBuilder
The
TouchEventBuilder class constructs instances of the TouchEvent 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 TouchEvent constructor
and returns an instance of the TouchEventBuilder.
You can use method chaining to call the builder methods for configuring the TouchEvent.
Finally, invoke the build method to generate an instance of the TouchEvent 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 TypeMethodDescriptionapply(Consumer<TouchEvent> func) Applies a function to the TouchEvent instance being constructed.build()Builds and returns an instance of theTouchEventclass.static TouchEventBuildercreate(Object source, EventTarget target, EventType<TouchEvent> eventType, TouchPoint touchPoint, List<TouchPoint> touchPoints, int eventSetId, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown) Accepts the constructor arguments ofTouchEvent(Object, EventTarget, EventType, TouchPoint, List, int, boolean, boolean, boolean, boolean)and returns an instance ofTouchEventBuilder.static TouchEventBuildercreate(EventType<TouchEvent> eventType, TouchPoint touchPoint, List<TouchPoint> touchPoints, int eventSetId, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown) Accepts the constructor arguments ofTouchEvent(EventType, TouchPoint, List, int, boolean, boolean, boolean, boolean)and returns an instance ofTouchEventBuilder.
-
Method Details
-
create
public static TouchEventBuilder create(Object source, EventTarget target, EventType<TouchEvent> eventType, TouchPoint touchPoint, List<TouchPoint> touchPoints, int eventSetId, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown) Accepts the constructor arguments ofTouchEvent(Object, EventTarget, EventType, TouchPoint, List, int, boolean, boolean, boolean, boolean)and returns an instance ofTouchEventBuilder.- Returns:
- an instance of the
TouchEventBuilder.
-
create
public static TouchEventBuilder create(EventType<TouchEvent> eventType, TouchPoint touchPoint, List<TouchPoint> touchPoints, int eventSetId, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown) Accepts the constructor arguments ofTouchEvent(EventType, TouchPoint, List, int, boolean, boolean, boolean, boolean)and returns an instance ofTouchEventBuilder.- Returns:
- an instance of the
TouchEventBuilder.
-
build
Builds and returns an instance of theTouchEventclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
TouchEventclass
-
apply
Applies a function to the TouchEvent instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-