|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bbn.openmap.event.ListenerSupport
com.bbn.openmap.event.LayerSupport
This is a utility class that can be used by beans that need support for handling LayerListeners and firing LayerEvents. You can use an instance of this class as a member field of your bean and delegate work to it.
Nested Class Summary | |
protected class |
LayerSupport.SetLayerRunnable
A reusable Runnable used by a thread to notify listeners when layers are turned on/off or shuffled. |
Field Summary | |
protected java.util.Vector |
events
Event information stack. |
protected boolean |
synchronous
|
protected java.lang.Thread |
t
Used to see if another Thread object needs to be created. |
Fields inherited from class com.bbn.openmap.event.ListenerSupport |
listeners, source |
Constructor Summary | |
LayerSupport(java.lang.Object sourceBean)
Construct a LayerSupport. |
Method Summary | |
void |
addLayerListener(LayerListener listener)
Add a LayerListener to the listener list. |
void |
fireLayer(int type,
Layer[] layers)
Send a layer event to all registered listeners. |
boolean |
isSynchronous()
|
LayerSupport.SetLayerRunnable |
popLayerEvent()
Return the first event on the stack, may be null if there is nothing to do. |
void |
pushLayerEvent(int layerEventType,
Layer[] layers)
Pushed the information onto a Vector stack to get executed by a separate thread. |
void |
removeLayerListener(LayerListener listener)
Remove a LayerListener from the listener list. |
void |
setSynchronous(boolean synchronous)
|
Methods inherited from class com.bbn.openmap.event.ListenerSupport |
addListener, getListeners, getSource, iterator, readObject, removeAll, removeListener, setSource, size, writeObject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean synchronous
protected java.lang.Thread t
protected java.util.Vector events
Constructor Detail |
public LayerSupport(java.lang.Object sourceBean)
sourceBean
- The bean to be given as the source for any
events.Method Detail |
public void addLayerListener(LayerListener listener)
listener
- The LayerListener to be addedpublic void removeLayerListener(LayerListener listener)
listener
- The LayerListener to be removedpublic void fireLayer(int type, Layer[] layers)
type
- the event type: one of ADD, REMOVE, REPLACElayers
- the list of layersLayerEvent
public void pushLayerEvent(int layerEventType, Layer[] layers)
layerEventType
- layers
- public LayerSupport.SetLayerRunnable popLayerEvent()
public boolean isSynchronous()
public void setSynchronous(boolean synchronous)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |