Class ContextMenuEventBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.ContextMenuEventBuilder
The
ContextMenuEventBuilder
class constructs instances of the ContextMenuEvent
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 ContextMenuEvent
constructor
and returns an instance of the ContextMenuEventBuilder
.
You can use method chaining to call the builder methods for configuring the ContextMenuEvent
.
Finally, invoke the build
method to generate an instance of the ContextMenuEvent
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<ContextMenuEvent> func) Applies a function to the ContextMenuEvent instance being constructed.build()
Builds and returns an instance of theContextMenuEvent
class.static ContextMenuEventBuilder
create
(Object source, EventTarget target, EventType<ContextMenuEvent> eventType, double x, double y, double screenX, double screenY, boolean keyboardTrigger, PickResult pickResult) Accepts the constructor arguments ofContextMenuEvent(Object, EventTarget, EventType, double, double, double, double, boolean, PickResult)
and returns an instance ofContextMenuEventBuilder
.static ContextMenuEventBuilder
create
(EventType<ContextMenuEvent> eventType, double x, double y, double screenX, double screenY, boolean keyboardTrigger, PickResult pickResult) Accepts the constructor arguments ofContextMenuEvent(EventType, double, double, double, double, boolean, PickResult)
and returns an instance ofContextMenuEventBuilder
.
-
Method Details
-
create
public static ContextMenuEventBuilder create(Object source, EventTarget target, EventType<ContextMenuEvent> eventType, double x, double y, double screenX, double screenY, boolean keyboardTrigger, PickResult pickResult) Accepts the constructor arguments ofContextMenuEvent(Object, EventTarget, EventType, double, double, double, double, boolean, PickResult)
and returns an instance ofContextMenuEventBuilder
.- Returns:
- an instance of the
ContextMenuEventBuilder
.
-
create
public static ContextMenuEventBuilder create(EventType<ContextMenuEvent> eventType, double x, double y, double screenX, double screenY, boolean keyboardTrigger, PickResult pickResult) Accepts the constructor arguments ofContextMenuEvent(EventType, double, double, double, double, boolean, PickResult)
and returns an instance ofContextMenuEventBuilder
.- Returns:
- an instance of the
ContextMenuEventBuilder
.
-
build
Builds and returns an instance of theContextMenuEvent
class.Intermediate builder methods are not evaluated until the
build
method is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
ContextMenuEvent
class
-
apply
Applies a function to the ContextMenuEvent instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-