|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bbn.openmap.MouseDelegator
The MouseDelegator manages the MapMouseModes that handle MouseEvents on the map. There should only be one MouseDelegator within a MapHandler.
MapMouseMode
,
AbstractMouseMode
,
NavMouseMode
,
SelectMouseMode
,
Serialized FormField Summary | |
static java.lang.String |
ActiveModeProperty
|
protected MapMouseMode |
activeMouseMode
The active MapMouseMode. |
protected java.beans.beancontext.BeanContextChildSupport |
beanContextChildSupport
BeanContextChildSupport object provides helper functions for BeanContextChild interface. |
protected Layer[] |
currentLayers
Need to keep a safe copy of the current layers that are part of the MapBean in case a MouseMode gets added before the MapBean is set in the MouseDelegator. |
protected MapBean |
map
The MapBean. |
protected java.util.Vector |
mouseModes
The registered MapMouseModes. |
static java.lang.String |
MouseModesProperty
|
protected java.beans.PropertyChangeSupport |
pcSupport
PropertyChangeSupport for handling listeners. |
Constructor Summary | |
MouseDelegator()
Construct a MouseDelegator without an associated MapBean. |
|
MouseDelegator(MapBean map)
Construct a MouseDelegator with an associated MapBean. |
Method Summary | |
void |
addMouseMode(MapMouseMode med)
Adds a MapMouseMode to the MouseMode list. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener in_pcl)
Method for BeanContextChild interface. |
void |
addVetoableChangeListener(java.lang.String propertyName,
java.beans.VetoableChangeListener in_vcl)
Method for BeanContextChild interface. |
void |
childrenAdded(java.beans.beancontext.BeanContextMembershipEvent bcme)
BeanContextMembershipListener method. |
void |
childrenRemoved(java.beans.beancontext.BeanContextMembershipEvent bcme)
BeanContextMembershipListener method. |
void |
findAndInit(java.util.Iterator it)
Eventually gets called when the MouseDelegator is added to the BeanContext, and when other objects are added to the BeanContext anytime after that. |
void |
findAndInit(java.lang.Object someObj)
Called when an object should be evaluated by the MouseDelegator to see if it is needed. |
void |
findAndUndo(java.lang.Object someObj)
Called by childrenRemoved. |
void |
firePropertyChange(java.lang.String property,
java.lang.Object oldObj,
java.lang.Object newObj)
|
void |
fireVetoableChange(java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue)
Report a vetoable property update to any registered listeners. |
MapMouseMode |
getActiveMouseMode()
Returns the mouse mode delegate that is active at the moment. |
java.lang.String |
getActiveMouseModeID()
Returns the ID string for the active Mouse Mode. |
java.beans.beancontext.BeanContext |
getBeanContext()
Method for BeanContextChild interface. |
MapBean |
getMap()
Get the associated MapBean. |
MapMouseMode[] |
getMouseModes()
Returns an array of MapMouseModes that are available to the MapBean. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
PropertyChangeListenter Interface method. |
void |
removeMouseMode(MapMouseMode med)
Removes a particular MapMouseMode from the MouseMode list. |
void |
removeMouseMode(java.lang.String id)
Removes a particular MapMouseMode from the MouseMode list, with the ID given. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener in_pcl)
Method for BeanContextChild interface. |
void |
removeVetoableChangeListener(java.lang.String propertyName,
java.beans.VetoableChangeListener in_vcl)
Method for BeanContextChild interface. |
void |
setActive(MapMouseMode mm)
Set the active MapMouseMode. |
void |
setActiveMouseMode(MapMouseMode aMed)
Sets the active mouse mode. |
void |
setActiveMouseModeWithID(java.lang.String MouseModeID)
Sets the mouse mode to the mode with the same ID string. |
void |
setBeanContext(java.beans.beancontext.BeanContext in_bc)
Method for BeanContextChild interface. |
void |
setDefaultMouseModes()
Sets the three default OpenMap mouse modes. |
void |
setInactive(MapMouseMode mm)
Deactivate the MapMouseMode. |
void |
setMap(MapBean mapbean)
Set the associated MapBean. |
void |
setMouseModes(MapMouseMode[] meds)
Used to set the mouseModes available to the MapBean. |
void |
setMouseModes(MapMouseMode[] meds,
int activeIndex)
Used to set the mouseModes available to the MapBean. |
void |
setupMouseModesWithLayers(Layer[] layers)
Does the work putting the layers given on each mouse mode's list of layers to notify if it becomes active. |
void |
setupMouseModeWithLayers(MapMouseMode mmm,
Layer[] layers)
Gives a MapMouseMode access to a Layer[], and it will find the layers that want to listen to it and will forward events to them if it is added to the MapBean as a MouseListener or a MouseMotionListener. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final transient java.lang.String ActiveModeProperty
public static final transient java.lang.String MouseModesProperty
protected transient MapMouseMode activeMouseMode
protected transient java.util.Vector mouseModes
protected transient MapBean map
protected Layer[] currentLayers
protected java.beans.PropertyChangeSupport pcSupport
protected java.beans.beancontext.BeanContextChildSupport beanContextChildSupport
Constructor Detail |
public MouseDelegator(MapBean map)
map
- MapBeanpublic MouseDelegator()
setMap()
.
setMap(com.bbn.openmap.MapBean)
Method Detail |
public void setMap(MapBean mapbean)
mapbean
- MapBeanpublic MapBean getMap()
public java.lang.String getActiveMouseModeID()
public void setActiveMouseModeWithID(java.lang.String MouseModeID)
MouseModeID
- the string ID of the mode to set active.public MapMouseMode getActiveMouseMode()
public void setActiveMouseMode(MapMouseMode aMed)
aMed
- a MapMouseMode to make active.public MapMouseMode[] getMouseModes()
public void setMouseModes(MapMouseMode[] meds, int activeIndex)
meds
- an array of MapMouseModesactiveIndex
- which mouse mode to make activepublic void setMouseModes(MapMouseMode[] meds)
meds
- an array of MapMouseModespublic void addMouseMode(MapMouseMode med)
med
- the MouseEvent Delegate to add.public void removeMouseMode(MapMouseMode med)
med
- the MapMouseMode that should be removed.public void removeMouseMode(java.lang.String id)
id
- the ID of the MapMouseMode that should be removedpublic void setDefaultMouseModes()
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
evt
- PropertyChangeEventpublic void setupMouseModesWithLayers(Layer[] layers)
public void setupMouseModeWithLayers(MapMouseMode mmm, Layer[] layers)
mmm
- MapMouseModelayers
- Layer[]public void setActive(MapMouseMode mm)
mm
- MapMouseModepublic void setInactive(MapMouseMode mm)
mm
- MapMouseMode.public void findAndInit(java.util.Iterator it)
it
- iterator to use to go through the new objects in the
BeanContext.public void findAndInit(java.lang.Object someObj)
public void childrenAdded(java.beans.beancontext.BeanContextMembershipEvent bcme)
childrenAdded
in interface java.beans.beancontext.BeanContextMembershipListener
bcme
- event that contains an iterator that can be used to
go through the new objects.public void childrenRemoved(java.beans.beancontext.BeanContextMembershipEvent bcme)
childrenRemoved
in interface java.beans.beancontext.BeanContextMembershipListener
bcme
- event that contains an iterator that can be used to
go through the removed objects.public void findAndUndo(java.lang.Object someObj)
public java.beans.beancontext.BeanContext getBeanContext()
getBeanContext
in interface java.beans.beancontext.BeanContextChild
public void setBeanContext(java.beans.beancontext.BeanContext in_bc) throws java.beans.PropertyVetoException
setBeanContext
in interface java.beans.beancontext.BeanContextChild
java.beans.PropertyVetoException
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener in_pcl)
addPropertyChangeListener
in interface java.beans.beancontext.BeanContextChild
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener in_pcl)
removePropertyChangeListener
in interface java.beans.beancontext.BeanContextChild
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void firePropertyChange(java.lang.String property, java.lang.Object oldObj, java.lang.Object newObj)
public void addVetoableChangeListener(java.lang.String propertyName, java.beans.VetoableChangeListener in_vcl)
addVetoableChangeListener
in interface java.beans.beancontext.BeanContextChild
public void removeVetoableChangeListener(java.lang.String propertyName, java.beans.VetoableChangeListener in_vcl)
removeVetoableChangeListener
in interface java.beans.beancontext.BeanContextChild
public void fireVetoableChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue) throws java.beans.PropertyVetoException
No event is fired if old and new are equal and non-null.
name
- The programmatic name of the property that is about
to changeoldValue
- The old value of the propertynewValue
- - The new value of the property
java.beans.PropertyVetoException
- if the recipient wishes the
property change to be rolled back.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |