Re: [OpenMap Users] Turn mouse MouseWheel Zoom OFF

From: Don Dietrick <dietrick_at_bbn.com>
Date: Wed, 15 Apr 2009 14:34:16 -0400

Hi Sean,

Hi Sean,

I'd add your mouse mode to the MapHandler instead of the
MouseDelegator, and add the MouseDelegator and MapBean to it as well.
You don't have to hook things up programmatically, use the MapHander
and add everything to it to let that mechanism make the connections.

I have the feeling your mouse mode isn't being added as a listener to
the MapBean.

Also, in your layer, I wouldn't override the getMouseModeServiceList
method. Call setMouseModeIDsForEvents(mouseModes) instead.

- Don

On Apr 15, 2009, at 10:38 AM, Sean Kaner wrote:

> Hi Don,
>
> I have tried to extend the NavMouseMode,
>
> public class MyNavMouseMode extends NavMouseMode{
> public void mouseWheelMoved( MouseWheelEvent e) {
> System.out.println("Do Nothing");
> }
> }
>
> but I seem to be missing how to make it active.
> I've seen some mention of doing this via the properties file, but my
> application doesn't use
> a properties file. So instead I've tried to add it using the
> mouseDelegator, but my no op function
> never gets called even though mouseDelegator.getActiveMouseModeID()
> says it's in Navigation mode
>
> Altogether In my layer I have
>
> mouseModes = new String[]{
> NavMouseMode.modeID
> };
>
> public String[] getMouseModeServiceList(){return mouseModes;}
>
>
> mouseDelegator.add(new MyNavMouseMode());
>
> How can I make myNavMouseMode mouseWheelMoved get called?
> Is NavMouseMode the right mode to extend if I want to consume the
> mouseWheelMoved events and not zoom?
>
> Thanks,
>
> Sean
>
>
> On Tue, Apr 14, 2009 at 11:54 PM, Don Dietrick <dietrick_at_bbn.com>
> wrote:
> Hi Sean,
>
> There isn't a setting on the MouseModes that let you turn off the
> mouse wheel responses, but you could extend the MouseModes you want
> and override the method that causes the scale to change when the
> mouse wheel moves:
>
> public void mouseWheelMoved(MouseWheelEvent e) {
>
> }
>
> Just override the method to do a no-op, and you should get the
> desired behavior. It's a good idea to add a setting to allow this
> behavior to be turned off, but if you want this behavior now, this
> would be the way to do it.
>
> Hope this helps,
>
> Don
>
>
>
> On Apr 11, 2009, at 12:30 PM, Sean Kaner wrote:
>
> Is there any way to stop the map from zooming or changing the scale
> as a
> result of the mouseWheel being moved.
>
> Thanks,
>
> Sean
>
> --
> [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 Wed Apr 15 2009 - 14:34:42 EDT

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