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 Wed Aug 25 2004 - 11:42:27 EDT