diff --git a/gluegen-java-src.zip b/gluegen-java-src.zip
new file mode 100644
index 0000000000..46ac8a66d7
Binary files /dev/null and b/gluegen-java-src.zip differ
diff --git a/gluegen-rt-natives-linux-amd64.jar b/gluegen-rt-natives-linux-amd64.jar
index 826d6d6fa9..a38e206e8e 100644
Binary files a/gluegen-rt-natives-linux-amd64.jar and b/gluegen-rt-natives-linux-amd64.jar differ
diff --git a/gluegen-rt-natives-windows-amd64.jar b/gluegen-rt-natives-windows-amd64.jar
index 2d1fe14112..4321279253 100644
Binary files a/gluegen-rt-natives-windows-amd64.jar and b/gluegen-rt-natives-windows-amd64.jar differ
diff --git a/gluegen-rt.jar b/gluegen-rt.jar
index aef08ef85c..7292d87a4f 100644
Binary files a/gluegen-rt.jar and b/gluegen-rt.jar differ
diff --git a/gluegen.jar b/gluegen.jar
new file mode 100644
index 0000000000..869a6cf4bc
Binary files /dev/null and b/gluegen.jar differ
diff --git a/jogl-all-natives-linux-amd64.jar b/jogl-all-natives-linux-amd64.jar
index 55953e236b..c093b4476f 100644
Binary files a/jogl-all-natives-linux-amd64.jar and b/jogl-all-natives-linux-amd64.jar differ
diff --git a/jogl-all-natives-windows-amd64.jar b/jogl-all-natives-windows-amd64.jar
index 4384250365..c8d513b585 100644
Binary files a/jogl-all-natives-windows-amd64.jar and b/jogl-all-natives-windows-amd64.jar differ
diff --git a/jogl-all.jar b/jogl-all.jar
index dbbde557f5..fe7887c58b 100644
Binary files a/jogl-all.jar and b/jogl-all.jar differ
diff --git a/jogl-java-src.zip b/jogl-java-src.zip
new file mode 100644
index 0000000000..f761968f56
Binary files /dev/null and b/jogl-java-src.zip differ
diff --git a/src/gov/nasa/worldwind/AbstractSceneController.java b/src/gov/nasa/worldwind/AbstractSceneController.java
index 0e2cd922c7..8af10b5099 100644
--- a/src/gov/nasa/worldwind/AbstractSceneController.java
+++ b/src/gov/nasa/worldwind/AbstractSceneController.java
@@ -75,15 +75,15 @@ public abstract class AbstractSceneController extends WWObjectImpl implements Sc
protected double frameTime;
protected double pickTime;
/**
- * The pick point in AWT screen coordinates, or null if the pick point is disabled. Initially
+ * The pick point in GL surface screen coordinates, or null if the pick point is disabled. Initially
* null.
*/
- protected Point pickPoint = null;
+ private Point pickPoint = null;
/**
- * The pick rectangle in AWT screen coordinates, or null if the pick rectangle is disabled. Initially
+ * The pick rectangle in GL surface screen coordinates, or null if the pick rectangle is disabled. Initially
* null.
*/
- protected Rectangle pickRect = null;
+ private Rectangle pickRect = null;
protected boolean deepPick = false;
protected GpuResourceCache gpuResourceCache;
protected TextRendererCache textRendererCache = new TextRendererCache();
@@ -111,7 +111,8 @@ public AbstractSceneController()
this.setVerticalExaggeration(Configuration.getDoubleValue(AVKey.VERTICAL_EXAGGERATION, 1d));
}
- public void reinitialize()
+ @Override
+ public void reinitialize()
{
if (this.textRendererCache != null)
this.textRendererCache.dispose();
@@ -119,7 +120,8 @@ public void reinitialize()
}
/** Releases resources associated with this scene controller. */
- public void dispose()
+ @Override
+ public void dispose()
{
if (this.lastPickedObjects != null)
this.lastPickedObjects.clear();
@@ -136,12 +138,14 @@ public void dispose()
this.textRendererCache.dispose();
}
- public GpuResourceCache getGpuResourceCache()
+ @Override
+ public GpuResourceCache getGpuResourceCache()
{
return this.gpuResourceCache;
}
- public void setGpuResourceCache(GpuResourceCache gpuResourceCache)
+ @Override
+ public void setGpuResourceCache(GpuResourceCache gpuResourceCache)
{
this.gpuResourceCache = gpuResourceCache;
}
@@ -151,17 +155,20 @@ public TextRendererCache getTextRendererCache()
return textRendererCache;
}
- public Model getModel()
+ @Override
+ public Model getModel()
{
return this.model;
}
- public View getView()
+ @Override
+ public View getView()
{
return this.view;
}
- public void setModel(Model model)
+ @Override
+ public void setModel(Model model)
{
if (this.model != null)
this.model.removePropertyChangeListener(this);
@@ -173,7 +180,8 @@ public void setModel(Model model)
this.firePropertyChange(AVKey.MODEL, oldModel, model);
}
- public void setView(View view)
+ @Override
+ public void setView(View view)
{
if (this.view != null)
this.view.removePropertyChangeListener(this);
@@ -186,44 +194,51 @@ public void setView(View view)
this.firePropertyChange(AVKey.VIEW, oldView, view);
}
- public void setVerticalExaggeration(double verticalExaggeration)
+ @Override
+ public void setVerticalExaggeration(double verticalExaggeration)
{
Double oldVE = this.verticalExaggeration;
this.verticalExaggeration = verticalExaggeration;
this.firePropertyChange(AVKey.VERTICAL_EXAGGERATION, oldVE, verticalExaggeration);
}
- public double getVerticalExaggeration()
+ @Override
+ public double getVerticalExaggeration()
{
return this.verticalExaggeration;
}
/** {@inheritDoc} */
- public void setPickPoint(Point pickPoint)
+ @Override
+ public void setPickPoint(Point pickPoint)
{
- this.pickPoint = pickPoint;
+ this.pickPoint = pickPoint;
}
/** {@inheritDoc} */
- public Point getPickPoint()
+ @Override
+ public Point getPickPoint()
{
return this.pickPoint;
}
/** {@inheritDoc} */
- public void setPickRectangle(Rectangle pickRect)
+ @Override
+ public void setPickRectangle(Rectangle pickRect)
{
this.pickRect = pickRect;
}
/** {@inheritDoc} */
- public Rectangle getPickRectangle()
+ @Override
+ public Rectangle getPickRectangle()
{
return this.pickRect;
}
/** {@inheritDoc} */
- public PickedObjectList getPickedObjectList()
+ @Override
+ public PickedObjectList getPickedObjectList()
{
return this.lastPickedObjects;
}
@@ -234,42 +249,50 @@ protected void setPickedObjectList(PickedObjectList pol)
}
/** {@inheritDoc} */
- public PickedObjectList getObjectsInPickRectangle()
+ @Override
+ public PickedObjectList getObjectsInPickRectangle()
{
return this.lastObjectsInPickRect;
}
- public void setDeepPickEnabled(boolean tf)
+ @Override
+ public void setDeepPickEnabled(boolean tf)
{
this.deepPick = tf;
}
- public boolean isDeepPickEnabled()
+ @Override
+ public boolean isDeepPickEnabled()
{
return this.deepPick;
}
- public SectorGeometryList getTerrain()
+ @Override
+ public SectorGeometryList getTerrain()
{
return this.dc.getSurfaceGeometry();
}
- public DrawContext getDrawContext()
+ @Override
+ public DrawContext getDrawContext()
{
return this.dc;
}
- public double getFramesPerSecond()
+ @Override
+ public double getFramesPerSecond()
{
return this.framesPerSecond;
}
- public double getFrameTime()
+ @Override
+ public double getFrameTime()
{
return this.frameTime;
}
- public void setPerFrameStatisticsKeys(Set keys)
+ @Override
+ public void setPerFrameStatisticsKeys(Set keys)
{
this.perFrameStatisticsKeys.clear();
if (keys == null)
@@ -282,34 +305,40 @@ public void setPerFrameStatisticsKeys(Set keys)
}
}
- public Collection getPerFrameStatistics()
+ @Override
+ public Collection getPerFrameStatistics()
{
return perFrameStatistics;
}
- public Collection getRenderingExceptions()
+ @Override
+ public Collection getRenderingExceptions()
{
return this.renderingExceptions;
}
- public ScreenCreditController getScreenCreditController()
+ @Override
+ public ScreenCreditController getScreenCreditController()
{
return screenCreditController;
}
- public void setScreenCreditController(ScreenCreditController screenCreditController)
+ @Override
+ public void setScreenCreditController(ScreenCreditController screenCreditController)
{
this.screenCreditController = screenCreditController;
}
/** {@inheritDoc} */
- public GLRuntimeCapabilities getGLRuntimeCapabilities()
+ @Override
+ public GLRuntimeCapabilities getGLRuntimeCapabilities()
{
return this.glRuntimeCaps;
}
/** {@inheritDoc} */
- public void setGLRuntimeCapabilities(GLRuntimeCapabilities capabilities)
+ @Override
+ public void setGLRuntimeCapabilities(GLRuntimeCapabilities capabilities)
{
if (capabilities == null)
{
@@ -411,7 +440,8 @@ public void setDeferOrderedRendering(boolean deferOrderedRendering)
this.deferOrderedRendering = deferOrderedRendering;
}
- public int repaint()
+ @Override
+ public int repaint()
{
this.frameTime = System.currentTimeMillis();
@@ -994,7 +1024,6 @@ protected void draw(DrawContext dc)
*
* @param dc the relevant DrawContext
*/
- @SuppressWarnings({"UNUSED_SYMBOL", "UnusedDeclaration"})
protected void checkGLErrors(DrawContext dc)
{
GL gl = dc.getGL();
diff --git a/src/gov/nasa/worldwind/SceneController.java b/src/gov/nasa/worldwind/SceneController.java
index 2cbf20ee7b..7b93ad2664 100644
--- a/src/gov/nasa/worldwind/SceneController.java
+++ b/src/gov/nasa/worldwind/SceneController.java
@@ -128,7 +128,7 @@ public interface SceneController extends WWObject, Disposable
double getFrameTime();
/**
- * Specifies the current pick point in AWT screen coordinates, or null to indicate that there is no
+ * Specifies the current pick point in GL surface screen coordinates, or null to indicate that there is no
* pick point. Each frame, this scene controller determines which objects are drawn at the pick point and places
* them in a PickedObjectList. This list can be accessed by calling {@link #getPickedObjectList()}.
*
@@ -140,7 +140,7 @@ public interface SceneController extends WWObject, Disposable
void setPickPoint(Point pickPoint);
/**
- * Returns the current pick point in AWT screen coordinates.
+ * Returns the current pick point in GL surface coordinates.
*
* @return the current pick point, or null if no pick point is current.
*
@@ -149,7 +149,7 @@ public interface SceneController extends WWObject, Disposable
Point getPickPoint();
/**
- * Specifies the current pick rectangle in AWT screen coordinates, or null to indicate that there is no
+ * Specifies the current pick rectangle in GL surface coordinates, or null to indicate that there is no
* pick rectangle. Each frame, this scene controller determines which objects intersect the pick rectangle and
* places them in a PickedObjectList. This list can be accessed by calling {@link #getObjectsInPickRectangle()}.
*
@@ -161,7 +161,7 @@ public interface SceneController extends WWObject, Disposable
void setPickRectangle(Rectangle pickRect);
/**
- * Returns the current pick rectangle in AWT screen coordinates.
+ * Returns the current pick rectangle in GL surface coordinates.
*
* @return the current pick rectangle, or null if no pick rectangle is current.
*
diff --git a/src/gov/nasa/worldwind/WorldWindowImpl.java b/src/gov/nasa/worldwind/WorldWindowImpl.java
index 51da668096..7a7ca29e13 100644
--- a/src/gov/nasa/worldwind/WorldWindowImpl.java
+++ b/src/gov/nasa/worldwind/WorldWindowImpl.java
@@ -28,7 +28,6 @@
package gov.nasa.worldwind;
-import com.jogamp.nativewindow.ScalableSurface;
import gov.nasa.worldwind.avlist.AVKey;
import gov.nasa.worldwind.cache.*;
import gov.nasa.worldwind.event.*;
@@ -68,7 +67,8 @@ public WorldWindowImpl()
* Causes resources used by the WorldWindow to be freed. The WorldWindow cannot be used once this method is
* called. An OpenGL context for the window must be current.
*/
- public void shutdown()
+ @Override
+ public void shutdown()
{
WorldWind.getDataFileStore().removePropertyChangeListener(this);
@@ -104,7 +104,8 @@ public void shutdown()
sc.dispose();
}
- public GpuResourceCache getGpuResourceCache()
+ @Override
+ public GpuResourceCache getGpuResourceCache()
{
return this.gpuResourceCache;
}
@@ -115,42 +116,49 @@ public void setGpuResourceCache(GpuResourceCache gpuResourceCache)
this.sceneController.setGpuResourceCache(this.gpuResourceCache);
}
- public void setModel(Model model)
+ @Override
+ public void setModel(Model model)
{
// model can be null, that's ok - it indicates no model.
if (this.sceneController != null)
this.sceneController.setModel(model);
}
- public Model getModel()
+ @Override
+ public Model getModel()
{
return this.sceneController != null ? this.sceneController.getModel() : null;
}
- public void setView(View view)
+ @Override
+ public void setView(View view)
{
// view can be null, that's ok - it indicates no view.
if (this.sceneController != null)
this.sceneController.setView(view);
}
- public View getView()
+ @Override
+ public View getView()
{
return this.sceneController != null ? this.sceneController.getView() : null;
}
- public void setModelAndView(Model model, View view)
+ @Override
+ public void setModelAndView(Model model, View view)
{
this.setModel(model);
this.setView(view);
}
- public SceneController getSceneController()
+ @Override
+ public SceneController getSceneController()
{
return this.sceneController;
}
- public void setSceneController(SceneController sc)
+ @Override
+ public void setSceneController(SceneController sc)
{
if (sc != null && this.getSceneController() != null)
{
@@ -160,31 +168,37 @@ public void setSceneController(SceneController sc)
this.sceneController = sc;
}
- public InputHandler getInputHandler()
+ @Override
+ public InputHandler getInputHandler()
{
return this.inputHandler;
}
- public void setInputHandler(InputHandler inputHandler)
+ @Override
+ public void setInputHandler(InputHandler inputHandler)
{
this.inputHandler = inputHandler;
}
- public void redraw()
+ @Override
+ public void redraw()
{
}
- public void redrawNow()
+ @Override
+ public void redrawNow()
{
}
- public void setPerFrameStatisticsKeys(Set keys)
+ @Override
+ public void setPerFrameStatisticsKeys(Set keys)
{
if (this.sceneController != null)
this.sceneController.setPerFrameStatisticsKeys(keys);
}
- public Collection getPerFrameStatistics()
+ @Override
+ public Collection getPerFrameStatistics()
{
if (this.sceneController == null || this.sceneController.getPerFrameStatistics() == null)
return new ArrayList(0);
@@ -192,17 +206,20 @@ public Collection getPerFrameStatistics()
return this.sceneController.getPerFrameStatistics();
}
- public PickedObjectList getObjectsAtCurrentPosition()
+ @Override
+ public PickedObjectList getObjectsAtCurrentPosition()
{
return null;
}
- public PickedObjectList getObjectsInSelectionBox()
+ @Override
+ public PickedObjectList getObjectsInSelectionBox()
{
return null;
}
- public Position getCurrentPosition()
+ @Override
+ public Position getCurrentPosition()
{
if (this.sceneController == null)
return null;
@@ -243,12 +260,14 @@ protected PickedObjectList getCurrentBoxSelection()
return pol != null && pol.size() > 0 ? pol : null;
}
- public void addRenderingListener(RenderingListener listener)
+ @Override
+ public void addRenderingListener(RenderingListener listener)
{
this.eventListeners.add(RenderingListener.class, listener);
}
- public void removeRenderingListener(RenderingListener listener)
+ @Override
+ public void removeRenderingListener(RenderingListener listener)
{
this.eventListeners.remove(RenderingListener.class, listener);
}
@@ -261,12 +280,14 @@ protected void callRenderingListeners(RenderingEvent event)
}
}
- public void addPositionListener(PositionListener listener)
+ @Override
+ public void addPositionListener(PositionListener listener)
{
this.eventListeners.add(PositionListener.class, listener);
}
- public void removePositionListener(PositionListener listener)
+ @Override
+ public void removePositionListener(PositionListener listener)
{
this.eventListeners.remove(PositionListener.class, listener);
}
@@ -275,7 +296,8 @@ protected void callPositionListeners(final PositionEvent event)
{
EventQueue.invokeLater(new Runnable()
{
- public void run()
+ @Override
+ public void run()
{
for (PositionListener listener : eventListeners.getListeners(PositionListener.class))
{
@@ -285,12 +307,14 @@ public void run()
});
}
- public void addSelectListener(SelectListener listener)
+ @Override
+ public void addSelectListener(SelectListener listener)
{
this.eventListeners.add(SelectListener.class, listener);
}
- public void removeSelectListener(SelectListener listener)
+ @Override
+ public void removeSelectListener(SelectListener listener)
{
this.eventListeners.remove(SelectListener.class, listener);
}
@@ -299,7 +323,8 @@ protected void callSelectListeners(final SelectEvent event)
{
EventQueue.invokeLater(new Runnable()
{
- public void run()
+ @Override
+ public void run()
{
for (SelectListener listener : eventListeners.getListeners(SelectListener.class))
{
@@ -309,12 +334,14 @@ public void run()
});
}
- public void addRenderingExceptionListener(RenderingExceptionListener listener)
+ @Override
+ public void addRenderingExceptionListener(RenderingExceptionListener listener)
{
this.eventListeners.add(RenderingExceptionListener.class, listener);
}
- public void removeRenderingExceptionListener(RenderingExceptionListener listener)
+ @Override
+ public void removeRenderingExceptionListener(RenderingExceptionListener listener)
{
this.eventListeners.remove(RenderingExceptionListener.class, listener);
}
@@ -323,7 +350,8 @@ protected void callRenderingExceptionListeners(final Throwable exception)
{
EventQueue.invokeLater(new Runnable()
{
- public void run()
+ @Override
+ public void run()
{
for (RenderingExceptionListener listener : eventListeners.getListeners(
RenderingExceptionListener.class))
@@ -341,32 +369,4 @@ public static GpuResourceCache createGpuResourceCache()
long cacheSize = Configuration.getLongValue(AVKey.TEXTURE_CACHE_SIZE, FALLBACK_TEXTURE_CACHE_SIZE);
return new BasicGpuResourceCache((long) (0.8 * cacheSize), cacheSize);
}
-
- /**
- * Configures JOGL's surface pixel scaling on the specified
- * ScalableSurface to ensure backward compatibility with
- * WorldWind applications developed prior to JOGL pixel scaling's
- * introduction.This method is used by GLCanvas and
- * GLJPanel to effectively disable JOGL's surface pixel scaling
- * by requesting a 1:1 scale.
- * Since v2.2.0, JOGL defaults to using high-dpi pixel scales where
- * possible. This causes WorldWind screen elements such as placemarks, the
- * compass, the world map, the view controls, and the scale bar (plus many
- * more) to appear smaller than they are intended to on screen. The high-dpi
- * default also has the effect of degrading WorldWind rendering performance.
- *
- * @param surface The surface to configure.
- */
- public static void configureIdentityPixelScale(ScalableSurface surface)
- {
- if (surface == null)
- {
- String message = Logging.getMessage("nullValue.SurfaceIsNull");
- Logging.logger().severe(message);
- throw new IllegalArgumentException(message);
- }
-
- float[] identityScale = new float[] {ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE};
- surface.setSurfaceScale(identityScale);
- }
}
diff --git a/src/gov/nasa/worldwind/awt/AWTInputHandler.java b/src/gov/nasa/worldwind/awt/AWTInputHandler.java
index 3697849cdc..b339336007 100644
--- a/src/gov/nasa/worldwind/awt/AWTInputHandler.java
+++ b/src/gov/nasa/worldwind/awt/AWTInputHandler.java
@@ -57,7 +57,8 @@ public class AWTInputHandler extends WWObjectImpl
protected boolean forceRedrawOnMousePressed = Configuration.getBooleanValue(AVKey.REDRAW_ON_MOUSE_PRESSED, false);
protected javax.swing.Timer hoverTimer = new javax.swing.Timer(600, new ActionListener()
{
- public void actionPerformed(ActionEvent actionEvent)
+ @Override
+ public void actionPerformed(ActionEvent actionEvent)
{
if (AWTInputHandler.this.pickMatches(AWTInputHandler.this.hoverObjects))
{
@@ -75,7 +76,8 @@ public AWTInputHandler()
{
}
- public void dispose()
+ @Override
+ public void dispose()
{
this.hoverTimer.stop();
this.hoverTimer = null;
@@ -91,7 +93,8 @@ public void dispose()
this.objectsAtButtonPress = null;
}
- public void setEventSource(WorldWindow newWorldWindow)
+ @Override
+ public void setEventSource(WorldWindow newWorldWindow)
{
if (newWorldWindow != null && !(newWorldWindow instanceof Component))
{
@@ -139,7 +142,8 @@ public void setEventSource(WorldWindow newWorldWindow)
this.selectListener = new SelectListener()
{
- public void selected(SelectEvent event)
+ @Override
+ public void selected(SelectEvent event)
{
if (event.getEventAction().equals(SelectEvent.ROLLOVER))
{
@@ -160,17 +164,20 @@ public void removeHoverSelectListener()
this.wwd.removeSelectListener(selectListener);
}
- public WorldWindow getEventSource()
+ @Override
+ public WorldWindow getEventSource()
{
return this.wwd;
}
- public void setHoverDelay(int delay)
+ @Override
+ public void setHoverDelay(int delay)
{
this.hoverTimer.setDelay(delay);
}
- public int getHoverDelay()
+ @Override
+ public int getHoverDelay()
{
return this.hoverTimer.getDelay();
}
@@ -250,12 +257,14 @@ protected void setObjectsAtButtonPress(PickedObjectList objectsAtButtonPress)
this.objectsAtButtonPress = objectsAtButtonPress;
}
- public boolean isForceRedrawOnMousePressed()
+ @Override
+ public boolean isForceRedrawOnMousePressed()
{
return forceRedrawOnMousePressed;
}
- public void setForceRedrawOnMousePressed(boolean forceRedrawOnMousePressed)
+ @Override
+ public void setForceRedrawOnMousePressed(boolean forceRedrawOnMousePressed)
{
this.forceRedrawOnMousePressed = forceRedrawOnMousePressed;
}
@@ -266,7 +275,8 @@ public ViewInputHandler getViewInputHandler()
}
*/
- public void keyTyped(KeyEvent keyEvent)
+ @Override
+ public void keyTyped(KeyEvent keyEvent)
{
if (this.wwd == null)
{
@@ -286,7 +296,8 @@ public void keyTyped(KeyEvent keyEvent)
}
}
- public void keyPressed(KeyEvent keyEvent)
+ @Override
+ public void keyPressed(KeyEvent keyEvent)
{
if (this.wwd == null)
{
@@ -306,7 +317,8 @@ public void keyPressed(KeyEvent keyEvent)
}
}
- public void keyReleased(KeyEvent keyEvent)
+ @Override
+ public void keyReleased(KeyEvent keyEvent)
{
if (this.wwd == null)
{
@@ -325,8 +337,47 @@ public void keyReleased(KeyEvent keyEvent)
this.wwd.getView().getViewInputHandler().keyReleased(keyEvent);
}
}
-
- public void mouseClicked(final MouseEvent mouseEvent)
+
+ /**
+ * Construct a mouse event with GL surface screen coordinates
+ * @param e
+ * @return
+ */
+ private MouseEvent glMouseEvent(MouseEvent awtMouseEvent) {
+ int[] GLmousePt = wwd.getSceneController().getDrawContext().awtPointToGLpoint(awtMouseEvent.getPoint());
+ MouseEvent e = new MouseEvent(awtMouseEvent.getComponent(), awtMouseEvent.getID(),
+ awtMouseEvent.getWhen(), awtMouseEvent.getModifiersEx(),
+ GLmousePt[0], GLmousePt[1], awtMouseEvent.getClickCount(), awtMouseEvent.isPopupTrigger(),
+ awtMouseEvent.getButton());
+
+ if (awtMouseEvent.isConsumed()) // needed in case this method is overridden by a subclass
+ e.consume();
+
+ return e;
+ }
+
+ /**
+ * Construct a mouse wheel event with GL surface screen coordinates
+ * @param e
+ * @return
+ */
+ private MouseWheelEvent glMouseWheelEvent(MouseWheelEvent awtEv) {
+ int[] GLmousePt = wwd.getSceneController().getDrawContext().awtPointToGLpoint(awtEv.getPoint());
+ MouseWheelEvent e = new MouseWheelEvent(awtEv.getComponent(), awtEv.getID(),
+ awtEv.getWhen(), awtEv.getModifiersEx(),
+ GLmousePt[0], GLmousePt[1], awtEv.getXOnScreen(), awtEv.getYOnScreen(),
+ awtEv.getClickCount(), awtEv.isPopupTrigger(),
+ awtEv.getScrollType(), awtEv.getScrollAmount(),
+ awtEv.getWheelRotation(), awtEv.getPreciseWheelRotation());
+
+ if (awtEv.isConsumed()) // needed in case this method is overridden by a subclass
+ e.consume();
+
+ return e;
+ }
+
+ @Override
+ public void mouseClicked(final MouseEvent awtMouseEvent)
{
if (this.wwd == null)
{
@@ -338,11 +389,12 @@ public void mouseClicked(final MouseEvent mouseEvent)
return;
}
- if (mouseEvent == null)
+ if (awtMouseEvent == null)
{
return;
}
-
+ MouseEvent mouseEvent = glMouseEvent(awtMouseEvent);
+
PickedObjectList pickedObjects = this.wwd.getObjectsAtCurrentPosition();
this.callMouseClickedListeners(mouseEvent);
@@ -381,20 +433,22 @@ else if (MouseEvent.BUTTON3 == mouseEvent.getButton())
}
}
- public void mousePressed(MouseEvent mouseEvent)
+ @Override
+ public void mousePressed(MouseEvent awtMouseEvent)
{
if (this.wwd == null)
{
return;
}
- if (mouseEvent == null)
+ if (awtMouseEvent == null)
{
return;
}
// Determine if the mouse point has changed since the last mouse move event. This can happen if user switches to
// another window, moves the mouse, and then switches back to the WorldWind window.
+ MouseEvent mouseEvent = glMouseEvent(awtMouseEvent);
boolean mousePointChanged = !mouseEvent.getPoint().equals(this.mousePoint);
this.mousePoint = mouseEvent.getPoint();
@@ -448,18 +502,20 @@ else if (MouseEvent.BUTTON3 == mouseEvent.getButton())
}
}
- public void mouseReleased(MouseEvent mouseEvent)
+ @Override
+ public void mouseReleased(MouseEvent awtMouseEvent)
{
if (this.wwd == null)
{
return;
}
- if (mouseEvent == null)
+ if (awtMouseEvent == null)
{
return;
}
+ MouseEvent mouseEvent = glMouseEvent(awtMouseEvent);
this.mousePoint = mouseEvent.getPoint();
this.callMouseReleasedListeners(mouseEvent);
if (!mouseEvent.isConsumed())
@@ -470,36 +526,40 @@ public void mouseReleased(MouseEvent mouseEvent)
this.cancelDrag();
}
- public void mouseEntered(MouseEvent mouseEvent)
+ @Override
+ public void mouseEntered(MouseEvent awtMouseEvent)
{
if (this.wwd == null)
{
return;
}
- if (mouseEvent == null)
+ if (awtMouseEvent == null)
{
return;
}
+ MouseEvent mouseEvent = glMouseEvent(awtMouseEvent);
this.callMouseEnteredListeners(mouseEvent);
this.wwd.getView().getViewInputHandler().mouseEntered(mouseEvent);
this.cancelHover();
this.cancelDrag();
}
- public void mouseExited(MouseEvent mouseEvent)
+ @Override
+ public void mouseExited(MouseEvent awtMouseEvent)
{
if (this.wwd == null)
{
return;
}
- if (mouseEvent == null)
+ if (awtMouseEvent == null)
{
return;
}
+ MouseEvent mouseEvent = glMouseEvent(awtMouseEvent);
this.callMouseExitedListeners(mouseEvent);
this.wwd.getView().getViewInputHandler().mouseExited(mouseEvent);
@@ -514,16 +574,18 @@ public void mouseExited(MouseEvent mouseEvent)
this.cancelDrag();
}
- public void mouseDragged(MouseEvent mouseEvent)
+ @Override
+ public void mouseDragged(MouseEvent awtMouseEvent)
{
if (this.wwd == null)
return;
- if (mouseEvent == null)
+ if (awtMouseEvent == null)
{
return;
}
+ MouseEvent mouseEvent = glMouseEvent(awtMouseEvent);
Point prevMousePoint = this.mousePoint;
this.mousePoint = mouseEvent.getPoint();
this.callMouseDraggedListeners(mouseEvent);
@@ -562,18 +624,20 @@ public void mouseDragged(MouseEvent mouseEvent)
}
}
- public void mouseMoved(MouseEvent mouseEvent)
+ @Override
+ public void mouseMoved(MouseEvent awtMouseEvent)
{
if (this.wwd == null)
{
return;
}
- if (mouseEvent == null)
+ if (awtMouseEvent == null)
{
return;
}
+ MouseEvent mouseEvent = glMouseEvent(awtMouseEvent);
this.mousePoint = mouseEvent.getPoint();
this.callMouseMovedListeners(mouseEvent);
@@ -590,25 +654,28 @@ public void mouseMoved(MouseEvent mouseEvent)
}
}
- public void mouseWheelMoved(MouseWheelEvent mouseWheelEvent)
+ @Override
+ public void mouseWheelMoved(MouseWheelEvent awtMouseWheelEvent)
{
if (this.wwd == null)
{
return;
}
- if (mouseWheelEvent == null)
+ if (awtMouseWheelEvent == null)
{
return;
}
+ MouseWheelEvent mouseWheelEvent = glMouseWheelEvent(awtMouseWheelEvent);
this.callMouseWheelMovedListeners(mouseWheelEvent);
if (!mouseWheelEvent.isConsumed())
this.wwd.getView().getViewInputHandler().mouseWheelMoved(mouseWheelEvent);
}
- public void focusGained(FocusEvent focusEvent)
+ @Override
+ public void focusGained(FocusEvent focusEvent)
{
if (this.wwd == null)
{
@@ -623,7 +690,8 @@ public void focusGained(FocusEvent focusEvent)
this.wwd.getView().getViewInputHandler().focusGained(focusEvent);
}
- public void focusLost(FocusEvent focusEvent)
+ @Override
+ public void focusLost(FocusEvent focusEvent)
{
if (this.wwd == null)
{
@@ -726,12 +794,14 @@ protected void cancelDrag()
this.isDragging = false;
}
- public void addSelectListener(SelectListener listener)
+ @Override
+ public void addSelectListener(SelectListener listener)
{
this.eventListeners.add(SelectListener.class, listener);
}
- public void removeSelectListener(SelectListener listener)
+ @Override
+ public void removeSelectListener(SelectListener listener)
{
this.eventListeners.remove(SelectListener.class, listener);
}
@@ -744,42 +814,50 @@ protected void callSelectListeners(SelectEvent event)
}
}
- public void addKeyListener(KeyListener listener)
+ @Override
+ public void addKeyListener(KeyListener listener)
{
this.eventListeners.add(KeyListener.class, listener);
}
- public void removeKeyListener(KeyListener listener)
+ @Override
+ public void removeKeyListener(KeyListener listener)
{
this.eventListeners.remove(KeyListener.class, listener);
}
- public void addMouseListener(MouseListener listener)
+ @Override
+ public void addMouseListener(MouseListener listener)
{
this.eventListeners.add(MouseListener.class, listener);
}
- public void removeMouseListener(MouseListener listener)
+ @Override
+ public void removeMouseListener(MouseListener listener)
{
this.eventListeners.remove(MouseListener.class, listener);
}
- public void addMouseMotionListener(MouseMotionListener listener)
+ @Override
+ public void addMouseMotionListener(MouseMotionListener listener)
{
this.eventListeners.add(MouseMotionListener.class, listener);
}
- public void removeMouseMotionListener(MouseMotionListener listener)
+ @Override
+ public void removeMouseMotionListener(MouseMotionListener listener)
{
this.eventListeners.remove(MouseMotionListener.class, listener);
}
- public void addMouseWheelListener(MouseWheelListener listener)
+ @Override
+ public void addMouseWheelListener(MouseWheelListener listener)
{
this.eventListeners.add(MouseWheelListener.class, listener);
}
- public void removeMouseWheelListener(MouseWheelListener listener)
+ @Override
+ public void removeMouseWheelListener(MouseWheelListener listener)
{
this.eventListeners.remove(MouseWheelListener.class, listener);
}
@@ -872,7 +950,8 @@ protected void callMouseExitedListeners(MouseEvent event)
}
}
- public void propertyChange(PropertyChangeEvent event)
+ @Override
+ public void propertyChange(PropertyChangeEvent event)
{
if (this.wwd == null)
{
diff --git a/src/gov/nasa/worldwind/awt/WorldWindowGLCanvas.java b/src/gov/nasa/worldwind/awt/WorldWindowGLCanvas.java
index 8a9942751b..3fb63c14ba 100644
--- a/src/gov/nasa/worldwind/awt/WorldWindowGLCanvas.java
+++ b/src/gov/nasa/worldwind/awt/WorldWindowGLCanvas.java
@@ -94,7 +94,6 @@ public WorldWindowGLCanvas()
this.createView();
this.createDefaultInputHandler();
WorldWind.addPropertyChangeListener(WorldWind.SHUTDOWN_EVENT, this);
- WorldWindowImpl.configureIdentityPixelScale(this);
this.wwd.endInitialization();
}
catch (Exception e)
@@ -132,7 +131,6 @@ public WorldWindowGLCanvas(WorldWindow shareWith)
this.createView();
this.createDefaultInputHandler();
WorldWind.addPropertyChangeListener(WorldWind.SHUTDOWN_EVENT, this);
- WorldWindowImpl.configureIdentityPixelScale(this);
this.wwd.endInitialization();
}
catch (Exception e)
@@ -172,7 +170,6 @@ public WorldWindowGLCanvas(WorldWindow shareWith, java.awt.GraphicsDevice device
this.createView();
this.createDefaultInputHandler();
WorldWind.addPropertyChangeListener(WorldWind.SHUTDOWN_EVENT, this);
- WorldWindowImpl.configureIdentityPixelScale(this);
this.wwd.endInitialization();
}
catch (Exception e)
@@ -216,7 +213,6 @@ public WorldWindowGLCanvas(WorldWindow shareWith, java.awt.GraphicsDevice device
this.createView();
this.createDefaultInputHandler();
WorldWind.addPropertyChangeListener(WorldWind.SHUTDOWN_EVENT, this);
- WorldWindowImpl.configureIdentityPixelScale(this);
this.wwd.endInitialization();
}
catch (Exception e)
@@ -227,7 +223,8 @@ public WorldWindowGLCanvas(WorldWindow shareWith, java.awt.GraphicsDevice device
}
}
- public void propertyChange(PropertyChangeEvent evt)
+ @Override
+ public void propertyChange(PropertyChangeEvent evt)
{
if(this.wwd == evt.getSource())
this.firePropertyChange(evt);
@@ -237,7 +234,8 @@ public void propertyChange(PropertyChangeEvent evt)
this.shutdown();
}
- public void shutdown()
+ @Override
+ public void shutdown()
{
WorldWind.removePropertyChangeListener(WorldWind.SHUTDOWN_EVENT, this);
this.wwd.shutdown();
@@ -267,12 +265,14 @@ protected void createDefaultInputHandler()
this.setInputHandler((InputHandler) WorldWind.createConfigurationComponent(AVKey.INPUT_HANDLER_CLASS_NAME));
}
- public InputHandler getInputHandler()
+ @Override
+ public InputHandler getInputHandler()
{
return this.wwd.getInputHandler();
}
- public void setInputHandler(InputHandler inputHandler)
+ @Override
+ public void setInputHandler(InputHandler inputHandler)
{
if (this.wwd.getInputHandler() != null)
this.wwd.getInputHandler().setEventSource(null); // remove this window as a source of events
@@ -282,153 +282,182 @@ public void setInputHandler(InputHandler inputHandler)
inputHandler.setEventSource(this);
}
- public SceneController getSceneController()
+ @Override
+ public SceneController getSceneController()
{
return this.wwd.getSceneController();
}
- public void setSceneController(SceneController sceneController)
+ @Override
+ public void setSceneController(SceneController sceneController)
{
this.wwd.setSceneController(sceneController);
}
- public GpuResourceCache getGpuResourceCache()
+ @Override
+ public GpuResourceCache getGpuResourceCache()
{
return this.wwd.getGpuResourceCache();
}
- public void redraw()
+ @Override
+ public void redraw()
{
this.repaint();
}
- public void redrawNow()
+ @Override
+ public void redrawNow()
{
this.wwd.redrawNow();
}
- public void setModel(Model model)
+ @Override
+ public void setModel(Model model)
{
// null models are permissible
this.wwd.setModel(model);
}
- public Model getModel()
+ @Override
+ public Model getModel()
{
return this.wwd.getModel();
}
- public void setView(View view)
+ @Override
+ public void setView(View view)
{
// null views are permissible
if (view != null)
this.wwd.setView(view);
}
- public View getView()
+ @Override
+ public View getView()
{
return this.wwd.getView();
}
- public void setModelAndView(Model model, View view)
+ @Override
+ public void setModelAndView(Model model, View view)
{ // null models/views are permissible
this.setModel(model);
this.setView(view);
}
- public void addRenderingListener(RenderingListener listener)
+ @Override
+ public void addRenderingListener(RenderingListener listener)
{
this.wwd.addRenderingListener(listener);
}
- public void removeRenderingListener(RenderingListener listener)
+ @Override
+ public void removeRenderingListener(RenderingListener listener)
{
this.wwd.removeRenderingListener(listener);
}
- public void addSelectListener(SelectListener listener)
+ @Override
+ public void addSelectListener(SelectListener listener)
{
this.wwd.getInputHandler().addSelectListener(listener);
this.wwd.addSelectListener(listener);
}
- public void removeSelectListener(SelectListener listener)
+ @Override
+ public void removeSelectListener(SelectListener listener)
{
this.wwd.getInputHandler().removeSelectListener(listener);
this.wwd.removeSelectListener(listener);
}
- public void addPositionListener(PositionListener listener)
+ @Override
+ public void addPositionListener(PositionListener listener)
{
this.wwd.addPositionListener(listener);
}
- public void removePositionListener(PositionListener listener)
+ @Override
+ public void removePositionListener(PositionListener listener)
{
this.wwd.removePositionListener(listener);
}
- public void addRenderingExceptionListener(RenderingExceptionListener listener)
+ @Override
+ public void addRenderingExceptionListener(RenderingExceptionListener listener)
{
this.wwd.addRenderingExceptionListener(listener);
}
- public void removeRenderingExceptionListener(RenderingExceptionListener listener)
+ @Override
+ public void removeRenderingExceptionListener(RenderingExceptionListener listener)
{
this.wwd.removeRenderingExceptionListener(listener);
}
- public Position getCurrentPosition()
+ @Override
+ public Position getCurrentPosition()
{
return this.wwd.getCurrentPosition();
}
- public PickedObjectList getObjectsAtCurrentPosition()
+ @Override
+ public PickedObjectList getObjectsAtCurrentPosition()
{
return this.wwd.getSceneController() != null ? this.wwd.getSceneController().getPickedObjectList() : null;
}
- public PickedObjectList getObjectsInSelectionBox()
+ @Override
+ public PickedObjectList getObjectsInSelectionBox()
{
return this.wwd.getSceneController() != null ? this.wwd.getSceneController().getObjectsInPickRectangle() : null;
}
- public Object setValue(String key, Object value)
+ @Override
+ public Object setValue(String key, Object value)
{
return this.wwd.setValue(key, value);
}
- public AVList setValues(AVList avList)
+ @Override
+ public AVList setValues(AVList avList)
{
return this.wwd.setValues(avList);
}
- public Object getValue(String key)
+ @Override
+ public Object getValue(String key)
{
return this.wwd.getValue(key);
}
- public Collection