com.bbn.openmap.event
Class LayerSupport
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
com.bbn.openmap.event.ListenerSupport<LayerListener>
com.bbn.openmap.event.LayerSupport
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<LayerListener>, java.util.Collection<LayerListener>, java.util.List<LayerListener>, java.util.RandomAccess
public class LayerSupport
- extends ListenerSupport<LayerListener>
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.
- See Also:
- Serialized Form
|
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. |
| Fields inherited from class java.util.AbstractList |
modCount |
|
Constructor Summary |
LayerSupport(java.lang.Object sourceBean)
Construct a LayerSupport. |
| 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.ArrayList |
addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, removeRange, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
equals, hashCode, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
containsAll, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
containsAll, equals, hashCode, listIterator, removeAll, retainAll, subList |
synchronous
protected boolean synchronous
t
protected java.lang.Thread t
- Used to see if another Thread object needs to be created.
events
protected java.util.Vector<LayerSupport.SetLayerRunnable> events
- Event information stack.
LayerSupport
public LayerSupport(java.lang.Object sourceBean)
- Construct a LayerSupport.
- Parameters:
sourceBean - The bean to be given as the source for any events.
fireLayer
public void fireLayer(int type,
Layer[] layers)
- Send a layer event to all registered listeners.
- Parameters:
type - the event type: one of ADD, REMOVE, REPLACElayers - the list of layers- See Also:
LayerEvent
pushLayerEvent
public void pushLayerEvent(int layerEventType,
Layer[] layers)
- Pushed the information onto a Vector stack to get executed by a separate
thread. Any thread launched is held on to, and if that thread is is null
or not active, a new thread is kicked off. The dying thread checks the
Vector stack and fires another event if it can.
- Parameters:
layerEventType - layers -
popLayerEvent
public LayerSupport.SetLayerRunnable popLayerEvent()
- Return the first event on the stack, may be null if there is nothing to
do.
isSynchronous
public boolean isSynchronous()
setSynchronous
public void setSynchronous(boolean synchronous)
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details