public class EventDispatcher extends Object
Constructor and Description |
---|
EventDispatcher() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(Object listener)
Add a listener to the dispatcher that would receive the events when they occurs
|
void |
fireActionEvent(ActionEvent ev)
Fires the event safely on the EDT without risk of concurrency errors
|
void |
fireDataChangeEvent(int index,
int type)
Fires the event safely on the EDT without risk of concurrency errors
|
void |
fireFocus(Component c)
Fires the event safely on the EDT without risk of concurrency errors
|
void |
fireSelectionEvent(int oldSelection,
int newSelection)
Fires the event safely on the EDT without risk of concurrency errors
|
void |
fireStyleChangeEvent(String property,
Style source)
Fires the style change even to the listeners
|
Vector |
getListenerVector()
Returns the vector of the listeners
|
void |
removeListener(Object listener)
Remove the listener from the dispatcher
|
public void addListener(Object listener)
listener
- a dispatcher listener to addpublic Vector getListenerVector()
public void removeListener(Object listener)
listener
- a dispatcher listener to removepublic void fireDataChangeEvent(int index, int type)
ev
- the ActionEvent to fire to the listenerspublic void fireStyleChangeEvent(String property, Style source)
property
- the property name for the eventsource
- the style firing the eventpublic void fireActionEvent(ActionEvent ev)
ev
- the ActionEvent to fire to the listenerspublic void fireSelectionEvent(int oldSelection, int newSelection)
oldSelection
- old selectionnewSelection
- new selectionpublic void fireFocus(Component c)
c
- the Component that gets the focus event