RE: [OpenMap Users] Adding MouseEvent to OMGraphics Object

From: Sperlongano Brian M NPRI <SperlonganoBM@Npt.NUWC.Navy.Mil>
Date: Fri Mar 26 2004 - 15:29:05 EST

Ok, I think I get how to use MapMouseInterpreter. Assumes your layer extends OMGraphicHandlerLayer and you're using MapHandler:

1. Make a class that extends StandardMapMouseInterpreter
1A. In this class, override the getMouseModeServiceList() function with something like this:

        public String[] getMouseModeServiceList()
        {
                return new String[] { NavMouseMode.modeID };
        }

You can alter this based on what modes you want your interpreter to respond to.

1B. Override any of the MapMouseInterpreter functions you want to use (mouseOver, mouseOut, etc.)

2. In your layer class:
2A. Create an instance of your class from step 1
2B. DO NOT Override the getMapMouseListener function
2C. Somewhere in the class, call setMouseEventInterpreter(<instance of your mouse int class>);

3. Add to your MapHandler a mouse mode that corresponds to what you specified in 1A. If you specified NavMouseMode.modeID, then you want to do:

mapHnd.add(new NavMouseMode());

That's what I've learned from the glory of backwards debugging with the CodeGuide IDE :-)

Have a nice weekene, everyone.

-Brian

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Mar 26 15:29:52 2004

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:38 EDT