|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.beans.beancontext.BeanContextChildSupport java.beans.beancontext.BeanContextSupport java.beans.beancontext.BeanContextServicesSupport com.bbn.openmap.MapHandler
public class MapHandler
The MapHandler is an extension of the BeanContextServicesSupport, with the added capability of being able to set the policy on handling SoloMapComponents. The MapHandler can be thought of as a generic map container, that contains the MapBean, all the layers that may be part of the map, and all the gesture handling components for that map. Given that definition, there are some OpenMap components that need to have a one-to-one relationship with a MapHandler. For instance, a MapHandler should only contain one MapBean, LayerHandler, MouseDelegator and PropertyHandler. Objects that have this one-to-one relationship with the MapHandler should implement the SoloMapComponent interface, so the MapHandler can control what happens when more than one instance of a particular SoloMapComponent type is added to the MapBean. Other objects that get added to the MapHandler that hook up with SoloMapComponents should expect that only one version of those components should be used - if another instance gets added to the MapHandler, the objects should disconnect from the SoloMapComponent that they are using, and connect to the new object added. With this behavior, these objects can gracefully adapt to the SoloMapComponent policies that are set in the MapHandler:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.beans.beancontext.BeanContextServicesSupport |
---|
java.beans.beancontext.BeanContextServicesSupport.BCSSChild, java.beans.beancontext.BeanContextServicesSupport.BCSSProxyServiceProvider, java.beans.beancontext.BeanContextServicesSupport.BCSSServiceProvider |
Nested classes/interfaces inherited from class java.beans.beancontext.BeanContextSupport |
---|
java.beans.beancontext.BeanContextSupport.BCSChild, java.beans.beancontext.BeanContextSupport.BCSIterator |
Field Summary | |
---|---|
protected boolean |
addInProgress
|
protected java.util.List<java.lang.Object> |
addLaterVector
|
protected boolean |
DEBUG
|
static java.util.logging.Logger |
logger
|
protected SoloMapComponentPolicy |
policy
|
Fields inherited from class java.beans.beancontext.BeanContextServicesSupport |
---|
bcsListeners, proxy, serializable, services |
Fields inherited from class java.beans.beancontext.BeanContextSupport |
---|
bcmListeners, children, designTime, locale, okToUseGui |
Fields inherited from class java.beans.beancontext.BeanContextChildSupport |
---|
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport |
Fields inherited from interface java.beans.beancontext.BeanContext |
---|
globalHierarchyLock |
Fields inherited from interface java.beans.DesignMode |
---|
PROPERTYNAME |
Constructor Summary | |
---|---|
MapHandler()
|
Method Summary | ||
---|---|---|
boolean |
add(java.lang.Object obj)
Add an object to the MapHandler BeanContextSupport. |
|
protected void |
addLater(java.lang.Object obj)
Call made from the add() method for objects that added when another object was being added, setting up a ConcurrentModificationException condition. |
|
void |
dispose()
Calls dispose() on the contained MapBean and removes all objects from BeanContext. |
|
|
get(java.lang.Class<T> someClass)
Given a Class, find the object in the MapHandler. |
|
java.lang.Object |
get(java.lang.String classname)
Given a class name, find the object in the MapHandler. |
|
|
getAll(java.lang.Class<T> someClass)
Given a Class, find all the objects in the MapHandler that are assignment-compatible with that Class. |
|
java.util.Collection |
getAll(java.lang.String classname)
Given a Class name, find all the objects in the MapHandler that are assignment-compatible object of that Class. |
|
SoloMapComponentPolicy |
getPolicy()
Get the policy that sets the behavior of the MapHandler when it encounters the situation of multiple instances of a particular SoloMapComponent. |
|
protected boolean |
isAddInProgress()
|
|
java.util.Iterator |
iterator()
Create an iterator copy, to avoid ConcurrentModificationExceptions in the MapHandler if one of the components wants to add more components when the MapHandler is set as the BeanContext on them. |
|
void |
present(java.lang.Object obj)
Method to call with an object you don't want to add to this MapHandler, but you want to make it available to all the MapHandlerChildren in it. |
|
protected void |
purgeLaterList()
Call to add any objects on the addLaterVector to the MapHandler. |
|
boolean |
remove(java.lang.Object obj)
Added because apparently, the BeanContext doesn't check to see if the object is also a membership listener to remove it from that list. |
|
protected void |
setAddInProgress(boolean value)
|
|
void |
setPolicy(SoloMapComponentPolicy smcp)
Set the policy of behavior for the MapHandler on how it should act when multiple instances of a certain SoloMapComponents are added to it. |
|
java.lang.String |
toString()
|
Methods inherited from class java.beans.beancontext.BeanContextServicesSupport |
---|
addBeanContextServicesListener, addService, addService, bcsPreDeserializationHook, bcsPreSerializationHook, childJustRemovedHook, createBCSChild, createBCSSServiceProvider, fireServiceAdded, fireServiceAdded, fireServiceRevoked, fireServiceRevoked, getBeanContextServicesPeer, getChildBeanContextServicesListener, getCurrentServiceClasses, getCurrentServiceSelectors, getService, hasService, initialize, initializeBeanContextResources, releaseBeanContextResources, releaseService, removeBeanContextServicesListener, revokeService, serviceAvailable, serviceRevoked |
Methods inherited from class java.beans.beancontext.BeanContextSupport |
---|
addAll, addBeanContextMembershipListener, avoidingGui, bcsChildren, childDeserializedHook, childJustAddedHook, classEquals, clear, contains, containsAll, containsKey, copyChildren, deserialize, dontUseGui, fireChildrenAdded, fireChildrenRemoved, getBeanContextPeer, getChildBeanContextChild, getChildBeanContextMembershipListener, getChildPropertyChangeListener, getChildSerializable, getChildVetoableChangeListener, getChildVisibility, getLocale, getResource, getResourceAsStream, instantiateChild, isDesignTime, isEmpty, isSerializing, needsGui, okToUseGui, propertyChange, readChildren, remove, removeAll, removeBeanContextMembershipListener, retainAll, serialize, setDesignTime, setLocale, size, toArray, toArray, validatePendingAdd, validatePendingRemove, vetoableChange, writeChildren |
Methods inherited from class java.beans.beancontext.BeanContextChildSupport |
---|
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, isDelegated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, validatePendingSetBeanContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.beans.beancontext.BeanContext |
---|
addBeanContextMembershipListener, getResource, getResourceAsStream, instantiateChild, removeBeanContextMembershipListener |
Methods inherited from interface java.beans.beancontext.BeanContextChild |
---|
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext |
Methods inherited from interface java.util.Collection |
---|
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, size, toArray, toArray |
Methods inherited from interface java.beans.DesignMode |
---|
isDesignTime, setDesignTime |
Methods inherited from interface java.beans.Visibility |
---|
avoidingGui, dontUseGui, needsGui, okToUseGui |
Field Detail |
---|
public static java.util.logging.Logger logger
protected SoloMapComponentPolicy policy
protected boolean DEBUG
protected boolean addInProgress
protected java.util.List<java.lang.Object> addLaterVector
Constructor Detail |
---|
public MapHandler()
Method Detail |
---|
public void setPolicy(SoloMapComponentPolicy smcp)
SoloMapComponentReplacePolicy
,
SoloMapComponentRejectPolicy
public SoloMapComponentPolicy getPolicy()
protected void setAddInProgress(boolean value)
protected boolean isAddInProgress()
protected void addLater(java.lang.Object obj)
protected void purgeLaterList()
public boolean add(java.lang.Object obj)
add
in interface java.util.Collection
add
in class java.beans.beancontext.BeanContextSupport
obj
- the map component to nest within this BeanContext.
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object get(java.lang.String classname)
public <T> T get(java.lang.Class<T> someClass)
public java.util.Collection getAll(java.lang.String classname)
public <T> java.util.Collection<T> getAll(java.lang.Class<T> someClass)
public boolean remove(java.lang.Object obj)
remove
in interface java.util.Collection
remove
in class java.beans.beancontext.BeanContextSupport
public void present(java.lang.Object obj)
obj
- public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in class java.beans.beancontext.BeanContextSupport
public void dispose()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |