Hey, Mike,
We don't use the OMGraphicHandlerLayer, but it extends Layer, so the
same may hold true.
We setup the mouse as follows:
private void setupMouseModes(){
MouseDelegator md = new MouseDelegator(mapBean);
mapHandler.add(md);
Layer[] selectLayers = new Layer[] {
...list layers in here...
};
com.bbn.openmap.event.SelectMouseMode selectMouseMode = new
com.bbn.openmap.event.SelectMouseMode();
md.setupMouseModeWithLayers(selectMouseMode, selectLayers);
com.bbn.openmap.event.MapMouseMode [] mouseModes = new
com.bbn.openmap.event.MapMouseMode[] {
selectMouseMode
};
md.setMouseModes(mouseModes);
md.setActiveMouseMode(selectMouseMode);
}
Then, in each layer, we implement the following two methods:
public MapMouseListener getMapMouseListener() {
return this;
}
public String[] getMouseModeServiceList() {
return new String[] {
com.bbn.openmap.event.SelectMouseMode.modeID
};
}
After that, things start working for us!
Good luck!
Chris
________________________________
From: owner-openmap-users_at_bbn.com [mailto:owner-openmap-users_at_bbn.com]
On Behalf Of Ta3ban4_at_aol.com
Sent: Monday, May 12, 2008 2:28 PM
To: openmap-users_at_bbn.com
Subject: [OpenMap Users] How To capture Event in a Layer
Hi All,
I have a problem receiving different mouse event on a layer.
Created a class that extends OMGraphicHandlerLayer and implementing
MapMouseListener and adding it to layer handler. That class
simply should detect the mouse X/Y position and display it in the same
way
for example the DateLayer or ScaleDisplayLayer. My problem i
guess that i cant figure out how to capture the mouse event. I have been
looking
at the event class and a lot of example but i can get a good
understanding how it works.My main class is modified simple2 example.
As far as I know , I have to change the mouse event mod to be
able to capture the mouse event but not sure how exactly i can
do that.
Would anyone give some idea/Guidance in how to get that mouse
event !.
Thanks in Advance
Mike
________________________________
Wondering what's for Dinner Tonight? Get new twists on family favorites
at AOL Food
<
http://food.aol.com/dinner-tonight?NCID=aolfod00030000000001> .
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed May 14 2008 - 13:55:09 EDT