Re: [OpenMap Users] Mouse Wheel Events

From: Roy Newton <newton_at_bmh.com>
Date: Thu, 26 Aug 2004 10:37:22 -0400

Forgot to include this vital little bit :)

private TacMapNavMode navMouseMode;
navMouseMode = new TacMapNavMode(mouseDelegator);
mapBean.addMouseWheelListener(navMouseMode); <------

-Roy


----- Original Message -----
From: "Chris Allport" <chris.allport_at_red-inc.us>
To: "Roy Newton" <newton_at_bmh.com>; <openmap-users_at_bbn.com>
Sent: Thursday, August 26, 2004 8:31 AM
Subject: RE: [OpenMap Users] Mouse Wheel Events


> Thank you. This is very helpful.
>
> I had some difficulties connecting it up. Instead of extending the
> NavMouseMode, I extended SelectMouseMode and do this (I am not using it
for
> map navigation or zoom):
>
> ExtendedSelectMouseMode mouseMode = new ExtendedSelectMouseMode();
> MouseDelegator md = new MouseDelegator(mapBean);
>
> Layer[] layers = new Layer[] {
> firstLayer,
> secondLayer
> };
>
> md.setupMouseModesWithLayers(layers);
> md.setActiveMouseMode(mouseMode);
>
> In each of my layers, I changed getMouseModeServiceList() to return
> ExtendedSelectMouseMode.modeID instead of SelectMouseMode.modeID.
>
> And it does not seem to fire off the mouseWheelMoved listener. I feel
like
> I am missing something obvious.
>
> Thanks-
>
> Chris
>
>
> -----Original Message-----
> From: Roy Newton [mailto:newton_at_bmh.com]
> Sent: Wednesday, August 25, 2004 11:39 AM
> To: chris.allport_at_red-inc.us; openmap-users_at_bbn.com
> Subject: Re: [OpenMap Users] Mouse Wheel Events
>
>
> Here's the way I did it...
>
>
> public class TacMapNavMode extends NavMouseMode implements
> MouseWheelListener{
>
> ...
>
> public void mouseWheelMoved(MouseWheelEvent e) {
>
> float curLevel = TacMap.getInstance().getMainMapBean().getScale();
>
> if(e.getWheelRotation() > 0){ //down
>
> TacMap.getInstance().zoom(curLevel * 0.5f);
>
> }
>
> else{//up
>
> TacMap.getInstance().zoom(curLevel / 0.5f);
>
> }
>
> }
>
>
>
>
>
> }
>
> ----- Original Message -----
> From: "Chris Allport" <chris.allport_at_red-inc.us>
> To: <openmap-users_at_bbn.com>
> Sent: Wednesday, August 25, 2004 10:31 AM
> Subject: [OpenMap Users] Mouse Wheel Events
>
>
> > I would like to capture mouse wheel events in one of my layers. I found
> > that I cannot simply extend the MouseWheelListener in my layer -- it
> blocks
> > the other mouse events.
> >
> > Can anyone share how they have implemented capturing the mouse wheel?
> >
> > Thanks in advance-
> >
> > Chris
> >
> > --
> > Chris Allport
> > Unmanned Systems Research & Development Lab
> > Patuxent River Naval Air Station
> > Phone: (301) 904-5943
> >
> >
> > --
> > [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 Thu Aug 26 2004 - 10:39:36 EDT

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