Skip to content

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.

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.

ReturnsSignatureSummary
Event()Creates an event, for a subclass.

ReturnsSignatureSummary
voidmonitor(boolean monitor) protectedMarks the event read-only while the MONITOR listeners of an EventBus run, and writable again after them.
voidcheckWritable(String verb) protectedThrows an IllegalStateException when a MONITOR listener receives the event.

Event()

Creates an event, for a subclass.

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.

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

Report a problem with this page