Event
abstract class Event
Known subtypes: TweenEvent, NodeEvent, UIEvent, ShortcutEvent, TaskEvent
Package: dev.joid.lib.ui.event · Module: core · Source: Event.java
The base class of every event that a listener receives.
Description
Section titled “Description”An event holds what happened: the node or the UI it concerns and the values of the change or of the input.
A listener of the priority EventPriority.MONITOR receives it read-only: a subclass that changes its event, such as one that cancels or consumes it, calls checkWritable first.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| Event() | Creates an event, for a subclass. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | monitor(boolean monitor) protected | Marks the event read-only while the MONITOR listeners of an EventBus run, and writable again after them. |
void | checkWritable(String verb) protected | Throws an IllegalStateException when a MONITOR listener receives the event. |
Creation details
Section titled “Creation details”Event()
Creates an event, for a subclass.
Method details
Section titled “Method details”monitor
Section titled “monitor”void monitor(boolean monitor) protected
Marks the event read-only while the MONITOR listeners of an EventBus run, and writable again after them.
EventBus.fireMonitor calls it.
checkWritable
Section titled “checkWritable”void checkWritable(String verb) protected
Throws:
IllegalStateException: A MONITOR listener only reads …, it cannot call …(): listen with another priority to … it
Throws an IllegalStateException when a MONITOR listener receives the event.
Call it at the start of every method that changes the event; verb names that method in the message.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
