aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-jogl/src/main
diff options
context:
space:
mode:
authorJoshua Slack <[email protected]>2018-01-15 12:05:59 -0600
committerJoshua Slack <[email protected]>2018-01-15 12:05:59 -0600
commitec71ecdbbb1437dd57a0f47a1f70d36a25529038 (patch)
tree1b3eb134296e5341fcc75959fbe6c048edbe8b47 /ardor3d-jogl/src/main
parent7f712e9e1516547a9472d424ff8f47b726066358 (diff)
Added new method to Canvas interface providing a way to store and retrieve the mouse manager for a given canvas.
Diffstat (limited to 'ardor3d-jogl/src/main')
-rw-r--r--ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglAwtCanvas.java17
-rw-r--r--ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglCanvas.java13
-rw-r--r--ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtAwtCanvas.java13
-rw-r--r--ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtSwtCanvas.java15
-rw-r--r--ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtWindow.java13
-rw-r--r--ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglSwtCanvas.java15
6 files changed, 82 insertions, 4 deletions
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglAwtCanvas.java b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglAwtCanvas.java
index cc233c8..ef65a82 100644
--- a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglAwtCanvas.java
+++ b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglAwtCanvas.java
@@ -21,14 +21,15 @@ import javax.swing.SwingUtilities;
import com.ardor3d.annotation.MainThread;
import com.ardor3d.framework.Canvas;
import com.ardor3d.framework.DisplaySettings;
+import com.ardor3d.input.MouseManager;
/**
* Ardor3D JOGL AWT heavyweight canvas, AWT component for the OpenGL rendering of Ardor3D with JOGL that supports the
* AWT input system directly and its abstraction in Ardor3D (com.ardor3d.input.awt)
- *
+ *
* FIXME there is still a deadlock when using several instances of this class in the same container, see JOGL bug 572
* Rather use JoglNewtAwtCanvas in this case.
- *
+ *
*/
public class JoglAwtCanvas extends GLCanvas implements Canvas {
@@ -104,6 +105,18 @@ public class JoglAwtCanvas extends GLCanvas implements Canvas {
return _canvasRenderer;
}
+ protected MouseManager _manager;
+
+ @Override
+ public MouseManager getMouseManager() {
+ return _manager;
+ }
+
+ @Override
+ public void setMouseManager(final MouseManager manager) {
+ _manager = manager;
+ }
+
public void setVSyncEnabled(final boolean enabled) {
invoke(true, new GLRunnable() {
@Override
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglCanvas.java b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglCanvas.java
index 9ca4c89..5bc1320 100644
--- a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglCanvas.java
+++ b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglCanvas.java
@@ -35,6 +35,7 @@ import com.ardor3d.framework.CanvasRenderer;
import com.ardor3d.framework.DisplaySettings;
import com.ardor3d.framework.NativeCanvas;
import com.ardor3d.image.Image;
+import com.ardor3d.input.MouseManager;
import com.ardor3d.renderer.jogl.JoglPbufferTextureRenderer;
/**
@@ -241,6 +242,18 @@ public class JoglCanvas extends Frame implements NativeCanvas {
return _glCanvas.getCanvasRenderer();
}
+ protected MouseManager _manager;
+
+ @Override
+ public MouseManager getMouseManager() {
+ return _manager;
+ }
+
+ @Override
+ public void setMouseManager(final MouseManager manager) {
+ _manager = manager;
+ }
+
@Override
public void close() {
try {
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtAwtCanvas.java b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtAwtCanvas.java
index b56e6c1..f1f8808 100644
--- a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtAwtCanvas.java
+++ b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtAwtCanvas.java
@@ -18,6 +18,7 @@ import javax.media.opengl.GLRunnable;
import com.ardor3d.annotation.MainThread;
import com.ardor3d.framework.Canvas;
import com.ardor3d.framework.DisplaySettings;
+import com.ardor3d.input.MouseManager;
import com.jogamp.newt.awt.NewtCanvasAWT;
import com.jogamp.newt.opengl.GLWindow;
@@ -97,6 +98,18 @@ public class JoglNewtAwtCanvas extends NewtCanvasAWT implements Canvas, NewtWind
return _canvasRenderer;
}
+ protected MouseManager _manager;
+
+ @Override
+ public MouseManager getMouseManager() {
+ return _manager;
+ }
+
+ @Override
+ public void setMouseManager(final MouseManager manager) {
+ _manager = manager;
+ }
+
@Override
public GLWindow getNewtWindow() {
return (GLWindow) getNEWTChild();
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtSwtCanvas.java b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtSwtCanvas.java
index 66436d3..09b4184 100644
--- a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtSwtCanvas.java
+++ b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtSwtCanvas.java
@@ -3,7 +3,7 @@
*
* This file is part of Ardor3D.
*
- * Ardor3D is free software: you can redistribute it and/or modify it
+ * Ardor3D is free software: you can redistribute it and/or modify it
* under the terms of its license which may be found in the accompanying
* LICENSE file or at <http://www.ardor3d.com/LICENSE>.
*/
@@ -20,6 +20,7 @@ import org.eclipse.swt.widgets.Composite;
import com.ardor3d.annotation.MainThread;
import com.ardor3d.framework.Canvas;
import com.ardor3d.framework.DisplaySettings;
+import com.ardor3d.input.MouseManager;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.newt.swt.NewtCanvasSWT;
@@ -95,6 +96,18 @@ public class JoglNewtSwtCanvas extends NewtCanvasSWT implements Canvas, NewtWind
return _canvasRenderer;
}
+ protected MouseManager _manager;
+
+ @Override
+ public MouseManager getMouseManager() {
+ return _manager;
+ }
+
+ @Override
+ public void setMouseManager(final MouseManager manager) {
+ _manager = manager;
+ }
+
@Override
public GLWindow getNewtWindow() {
return (GLWindow) getNEWTChild();
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtWindow.java b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtWindow.java
index 938a53e..901814c 100644
--- a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtWindow.java
+++ b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglNewtWindow.java
@@ -22,6 +22,7 @@ import com.ardor3d.annotation.MainThread;
import com.ardor3d.framework.DisplaySettings;
import com.ardor3d.framework.NativeCanvas;
import com.ardor3d.image.Image;
+import com.ardor3d.input.MouseManager;
import com.jogamp.newt.MonitorDevice;
import com.jogamp.newt.MonitorMode;
import com.jogamp.newt.event.KeyListener;
@@ -215,6 +216,18 @@ public class JoglNewtWindow implements NativeCanvas, NewtWindowContainer {
return _canvasRenderer;
}
+ protected MouseManager _manager;
+
+ @Override
+ public MouseManager getMouseManager() {
+ return _manager;
+ }
+
+ @Override
+ public void setMouseManager(final MouseManager manager) {
+ _manager = manager;
+ }
+
@Override
public void close() {
_newtWindow.destroy();
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglSwtCanvas.java b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglSwtCanvas.java
index a659d49..936beb4 100644
--- a/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglSwtCanvas.java
+++ b/ardor3d-jogl/src/main/java/com/ardor3d/framework/jogl/JoglSwtCanvas.java
@@ -3,7 +3,7 @@
*
* This file is part of Ardor3D.
*
- * Ardor3D is free software: you can redistribute it and/or modify it
+ * Ardor3D is free software: you can redistribute it and/or modify it
* under the terms of its license which may be found in the accompanying
* LICENSE file or at <http://www.ardor3d.com/LICENSE>.
*/
@@ -21,6 +21,7 @@ import org.eclipse.swt.widgets.Display;
import com.ardor3d.annotation.MainThread;
import com.ardor3d.framework.Canvas;
import com.ardor3d.framework.DisplaySettings;
+import com.ardor3d.input.MouseManager;
import com.jogamp.opengl.swt.GLCanvas;
/**
@@ -92,6 +93,18 @@ public class JoglSwtCanvas extends GLCanvas implements Canvas {
return _canvasRenderer;
}
+ protected MouseManager _manager;
+
+ @Override
+ public MouseManager getMouseManager() {
+ return _manager;
+ }
+
+ @Override
+ public void setMouseManager(final MouseManager manager) {
+ _manager = manager;
+ }
+
public void setVSyncEnabled(final boolean enabled) {
invoke(true, new GLRunnable() {
@Override