World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 06-19-2009, 03:07 PM   #1
tingspain
Junior Member
 
Join Date: Apr 2009
Posts: 13
tingspain is on a distinguished road
Default Override the View's Control

Hi,

is there anyway to override the View Control Actions in a easy way? I just want to pan/zoom/rotate only when the CTRL Key is pressed.

I tried but i could get the dessired behaviour.

is there a easy way to do it like. ....... ?


class MyViewInputHandler extends ViewInputHandler
{
protected void handleMouseDragged(MouseEvent e)
{

if((e.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) != 0)
return;


if ((e.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) != 0)
{

this.handleMouseRotate(e);
}
else if ((e.getModifiersEx() & MouseEvent.BUTTON2_DOWN_MASK) != 0)
{
this.handleMouseZoom(e);
}
else if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) != 0)
{
this.handleMousePan(e);
}
}
}


=============================

myworld.setInputHandler(new MyViewInputHandler());
tingspain is offline   Reply With Quote
Old 06-22-2009, 11:20 PM   #2
Andrew Fresquez
Junior Member
 
Join Date: Mar 2009
Posts: 27
Andrew Fresquez is on a distinguished road
Default

You could try making a class similar to AWTInputHandler that uses your own version of the ViewInputHandler class and then change the worldwind.properties file to have a reference to your AWTInputHandler

Code:
gov.nasa.worldwind.avkey.InputHandlerClassName=src.myco.myapp.awt.MyAWTInputHandler
Andrew Fresquez is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Label control coloradokid WorldWind XML 1 06-03-2009 03:16 AM
Inserting control points in a Polyline by mouse WindRider Development Help 11 05-30-2009 08:38 AM
Trouble creating mouse events on WorldWindowGLCanvas control nigel25840 Development Help 1 12-30-2008 09:53 PM
Can't connect to servers hroo772 Technical Support 11 02-12-2005 01:19 AM
Layer Control Questions Robert11 WorldWind General 1 01-12-2005 01:34 PM


All times are GMT +1. The time now is 08:28 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.