|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.tools.beanbox.BeanBox com.bbn.openmap.layer.beanbox.SimpleBeanBox
public class SimpleBeanBox
SimpleBeanBox is a sample implementation of the
BeanBox
class. SimpleBeanBox manages
beans of type SimpleBeanObject.
Constructor Summary | |
---|---|
SimpleBeanBox(SimpleBeanLayer l)
|
Method Summary | |
---|---|
void |
addBean(java.lang.Object bean)
adds the specified bean to SimpleBeanLayer. |
void |
beanChanged(java.lang.Object bean,
java.lang.String changedPropertyName)
this method is a callback method that is called by a com.bbn.openmap.tools.beanbox.GenericPropertySheet when the
user closes the property sheet. |
boolean |
containsBean(java.lang.Object bean)
checks if the specified bean is present in SimpleBeanLayer. |
SimpleBeanContainer |
findEnclosingContainer(LatLonPoint llp)
returns a SimpleBeanContainer bean that contains the specified LatLonPoint on the map. |
BeanContainer |
findEnclosingContainer(java.lang.Object bean)
returns a BeanContainer bean that contains the specified
bean object. |
java.lang.Object |
getBeanAtLocation(java.awt.Point pointOnMap)
return bean at specified location giving preference to non-container beans over container beans. |
protected java.awt.Image |
getDragImage(java.lang.Object bean)
returns the image that the cursor is set to when the specified bean is dragged on the map. |
java.lang.String[] |
getMouseModeServiceList()
Return a list of the modes that are interesting to the MapMouseListener. |
boolean |
mouseClicked(java.awt.event.MouseEvent evt)
Invoked when the mouse has been clicked on a component. |
boolean |
mouseDragged(java.awt.event.MouseEvent evt)
Invoked when a mouse button is pressed on a component and then dragged. |
void |
mouseEntered(java.awt.event.MouseEvent evt)
Invoked when the mouse enters a component. |
void |
mouseExited(java.awt.event.MouseEvent evt)
Invoked when the mouse exits a component. |
void |
mouseMoved()
Handle a mouse cursor moving without the button being pressed. |
boolean |
mouseMoved(java.awt.event.MouseEvent evt)
Invoked when the mouse button has been moved on a component (with no buttons down). |
boolean |
mousePressed(java.awt.event.MouseEvent evt)
Invoked when a mouse button has been pressed on a component. |
boolean |
mouseReleased(java.awt.event.MouseEvent evt)
Invoked when a mouse button has been released on a component. |
void |
relocateBean(java.lang.Object bean,
java.beans.BeanInfo beanInfo,
java.awt.Point newLocation)
relocates the specified bean to the new location. |
void |
removeBean(java.lang.Object bean)
removes the specified bean from SimpleBeanLayer. |
void |
setBeanProperties(java.lang.Object bean,
java.beans.BeanInfo beanInfo,
java.awt.Point location)
Sets the image associated with the bean using the image present in the BeanInfo. |
Methods inherited from class com.bbn.openmap.tools.beanbox.BeanBox |
---|
createPropertySheet, doSpecialHandling, getBeanInfoForBean, prepareForAddition, showCut, showSelected, showUnCut |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleBeanBox(SimpleBeanLayer l)
Method Detail |
---|
public java.lang.String[] getMouseModeServiceList()
MapMouseListener
return new String[] { SelectMouseMode.modeID };
getMouseModeServiceList
in interface MapMouseListener
NavMouseMode.modeID
,
SelectMouseMode.modeID
,
NullMouseMode.modeID
public boolean mousePressed(java.awt.event.MouseEvent evt)
MapMouseListener
mousePressed
in interface MapMouseListener
evt
- MouseEvent
public boolean mouseReleased(java.awt.event.MouseEvent evt)
MapMouseListener
mouseReleased
in interface MapMouseListener
evt
- MouseEvent
public boolean mouseClicked(java.awt.event.MouseEvent evt)
MapMouseListener
mousePressed()
, or if no other listener
processes the event. If the listener successfully processes
mouseClicked()
, then it will receive the next
mouseClicked()
notifications that have a click
count greater than one.
NOTE: We have noticed that this method can sometimes be
erroneously invoked. It seems to occur when a light-weight AWT
component (like an internal window or menu) closes (removes
itself from the window hierarchy). A specific OpenMap example
is when you make a menu selection when the MenuItem you select
is above the MapBean canvas. After making the selection, the
mouseClicked() gets invoked on the MouseDelegator, which passes
it to the appropriate listeners depending on the MouseMode. The
best way to avoid this problem is to not implement anything
crucial in this method. Use a combination of
mousePressed()
and mouseReleased()
instead.
mouseClicked
in interface MapMouseListener
evt
- MouseEvent
public void mouseEntered(java.awt.event.MouseEvent evt)
MapMouseListener
mouseEntered
in interface MapMouseListener
evt
- MouseEventpublic void mouseExited(java.awt.event.MouseEvent evt)
MapMouseListener
mouseExited
in interface MapMouseListener
evt
- MouseEventpublic boolean mouseDragged(java.awt.event.MouseEvent evt)
MapMouseListener
mouseDragged
in interface MapMouseListener
evt
- MouseEvent
public boolean mouseMoved(java.awt.event.MouseEvent evt)
MapMouseListener
mouseMoved
in interface MapMouseListener
evt
- MouseEvent
public void mouseMoved()
MapMouseListener
mouseMoved
in interface MapMouseListener
public void addBean(java.lang.Object bean)
com.bbn.openmap.tools.beanbox.BeanBoxDnDCatcher
class to add
the specified bean to a openmap layer.
addBean
in class BeanBox
an
- IllegalArgumentException if bean is not of type
SimpleBeanObjectpublic void removeBean(java.lang.Object bean)
com.bbn.openmap.tools.beanbox.BeanBoxDnDCatcher
class to
remove the specified bean from a openmap layer.
removeBean
in class BeanBox
an
- IllegalArgumentException if bean is not of type
SimpleBeanObjectpublic boolean containsBean(java.lang.Object bean)
containsBean
in class BeanBox
an
- IllegalArgumentException if bean is not of type
SimpleBeanObjectpublic void setBeanProperties(java.lang.Object bean, java.beans.BeanInfo beanInfo, java.awt.Point location)
com.bbn.openmap.tools.beanbox.BeanBoxDnDCatcher
class to set
the bean's properties before it is displayed in a property sheet prior to
adding to an openmap layer.
setBeanProperties
in class BeanBox
an
- IllegalArgumentException if bean is not of type
SimpleBeanObjectpublic BeanContainer findEnclosingContainer(java.lang.Object bean)
BeanContainer
bean that contains the specified
bean object.
findEnclosingContainer
in class BeanBox
an
- IllegalArgumentException if bean is not of type
SimpleBeanObjectpublic SimpleBeanContainer findEnclosingContainer(LatLonPoint llp)
LatLonPoint
on the map.
public java.lang.Object getBeanAtLocation(java.awt.Point pointOnMap)
getBeanAtLocation
in class BeanBox
public void relocateBean(java.lang.Object bean, java.beans.BeanInfo beanInfo, java.awt.Point newLocation)
com.bbn.openmap.tools.beanbox.BeanBoxDnDCatcher
whenever the user moves a bean on the map within the same openmap layer.
relocateBean
in class BeanBox
java.lang.IllegalArgumentException
- is specified bean is not of type
SimpleBeanObject.public void beanChanged(java.lang.Object bean, java.lang.String changedPropertyName)
com.bbn.openmap.tools.beanbox.GenericPropertySheet
when the
user closes the property sheet.
beanChanged
in class BeanBox
protected java.awt.Image getDragImage(java.lang.Object bean)
getDragImage
in class BeanBox
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |