Package rsb.event
Class EventMulticaster
java.lang.Object
rsb.event.EventMulticaster
- All Implemented Interfaces:
EventListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the listener to the tree with a default mask.void
addListener
(EventListener el, long mask) Adds the listener with the specified mask.void
Fires an event to all applicable listeners.void
fireEvent
(EventObject e, long mask) Fires an event to all listeners, restricted by the mask.static long
Gets the default mask for an event listener.static long
Gets the default mask for an event.long
Gets the masks enabled for this multicaster.Returns an unmodifiable list of the backing list of listeners.final boolean
isEnabled
(long mask) Returns whether the mask is enabled on this multicaster.void
Removes a listener.
-
Field Details
-
FOCUS_EVENT
public static final long FOCUS_EVENT- See Also:
-
KEY_EVENT
public static final long KEY_EVENT- See Also:
-
MOUSE_EVENT
public static final long MOUSE_EVENT- See Also:
-
MOUSE_MOTION_EVENT
public static final long MOUSE_MOTION_EVENT- See Also:
-
MOUSE_WHEEL_EVENT
public static final long MOUSE_WHEEL_EVENT- See Also:
-
CHARACTER_MOVED_EVENT
public static final long CHARACTER_MOVED_EVENT- See Also:
-
SERVER_MESSAGE_EVENT
public static final long SERVER_MESSAGE_EVENT- See Also:
-
MESSAGE_EVENT
public static final long MESSAGE_EVENT- See Also:
-
PAINT_EVENT
public static final long PAINT_EVENT- See Also:
-
TEXT_PAINT_EVENT
public static final long TEXT_PAINT_EVENT- See Also:
-
-
Constructor Details
-
EventMulticaster
public EventMulticaster()
-
-
Method Details
-
getDefaultMask
Gets the default mask for an event listener.- Parameters:
el
- an EventListener- Returns:
- the integer value representing the mask for this object
-
getDefaultMask
Gets the default mask for an event.- Parameters:
e
- an EventObject- Returns:
- the integer value representing the mask for this object
-
addListener
Adds the listener to the tree with a default mask.- Parameters:
el
- an EventListener to add
-
addListener
Adds the listener with the specified mask. If it is an EventMulticaster the specified mask will be ignored.- Parameters:
el
- an EventListener to addmask
- a mask to assign to the EventListener
-
fireEvent
Fires an event to all applicable listeners.- Parameters:
e
- an EventObject to trigger
-
fireEvent
Fires an event to all listeners, restricted by the mask.- Parameters:
e
- an EventObject to triggermask
- a mask to act as a filter to prevent unwanted firing
-
getEnabledMask
public long getEnabledMask()Gets the masks enabled for this multicaster.- Returns:
- the mask for the multicaster
-
getListeners
Returns an unmodifiable list of the backing list of listeners.- Returns:
- the listeners on this multicaster
-
isEnabled
public final boolean isEnabled(long mask) Returns whether the mask is enabled on this multicaster.- Parameters:
mask
- the mask to check for on the multicaster- Returns:
true
if the mask is found; otherwisefalse
-
removeListener
Removes a listener. Cleans up the masks.- Parameters:
el
- an EventListener to remove
-