Re: [OpenMap Users] How to disable mouseDrag events in OMGraphicHandlerLayer?

From: Don Dietrick <dietrick_at_bbn.com>
Date: Tue, 24 May 2005 23:25:32 -0400

Hi Joey,

Like Ruben said, you might want to think about using another
MapMouseMode. If you want to get the behavior you describe, you
might have to modify the NavMouseMode so it pays attention to what
the listeners (layers) return after they handle the events. The
default action of the mode is to ignore the layer's responses.

On May 23, 2005, at 2:54 PM, Joey Heinrich wrote:

> I have a map using NavMouseMode2 and a layer on top of it that extends
> OMGraphicHandlerLayer with several OMGraphics on it. I managed to get
> little popup menus when I right click on the OMGraphic objects, which
> is what I was after. My problem is this...
>
> I didn't want the click to filter through the top layer down onto the
> map, because if it does, the map recenters on the point and the site
> goes to the center of the map while the popup window stays where the
> mouse is. I tried to fix this by setting the top layer to consume
> events when the mouse gets over the object with the highlight method.
> I then reset consume events for the top layer to false in unhighlight.
> This works great for all mouse actions with the exception of
> mousedragged. It doesn't crash the program but does cause numerous
> NullPointerExceptions when you click on a OMGraphic object and then
> perform the mousedragged action.

This I'm not sure about, I'd check the stack trace for the
NullPointerException to see what's null, especially if this is
happening in your layer code.

- Don

>
> Any tips on how I might work around this implementing all of the
> MapMouseInterpreter methods within the class? I tried making the
> object selectable and then added a try/catch within the select method,
> thinking that might catch it, but I guess the select method only
> handles the initial click event and not what happens afterwards.
>
> -Joey
>
> --
> [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"]
>

--
[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 Tue May 24 2005 - 23:25:42 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:06 EDT