|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.concurrent.CopyOnWriteArrayList<E> com.bbn.openmap.event.ListenerSupport<LayerListener> com.bbn.openmap.event.LayerSupport
public class 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<LayerSupport.SetLayerRunnable> |
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 |
---|
source |
Constructor Summary | |
---|---|
LayerSupport(java.lang.Object sourceBean)
Construct a LayerSupport. |
Method Summary | |
---|---|
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 |
setSynchronous(boolean synchronous)
|
Methods inherited from class com.bbn.openmap.event.ListenerSupport |
---|
add, add, addAll, clear, getSource, iterator, listIterator, remove, remove, set, setSource, size |
Methods inherited from class java.util.concurrent.CopyOnWriteArrayList |
---|
addAll, addAllAbsent, addIfAbsent, clone, contains, containsAll, equals, get, hashCode, indexOf, indexOf, isEmpty, lastIndexOf, lastIndexOf, listIterator, removeAll, retainAll, subList, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean synchronous
protected java.lang.Thread t
protected java.util.Vector<LayerSupport.SetLayerRunnable> 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 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 |