summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-04-24 19:00:15 +0200
committerSven Gothel <[email protected]>2012-04-24 19:00:15 +0200
commit781865768bb8da38cf3de254b93bae0a8d43f1a6 (patch)
treec064c990228cb031f32948e997acd27e7c943c61 /src/newt/classes/com/jogamp
parent5854705968e73c222724be24eecd21c488a7e977 (diff)
Newt/AWT Event Factory: Add Mouse Wheel Event Conversion
.. also reverse AWT rotation sign, since NEWT uses the reverse oriantation.
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r--src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
index 5dcd4d962..115743a0d 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
@@ -30,7 +30,9 @@ package com.jogamp.newt.event.awt;
import jogamp.newt.awt.event.AWTNewtEventFactory;
-public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
+public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseListener,
+ java.awt.event.MouseMotionListener,
+ java.awt.event.MouseWheelListener
{
public AWTMouseAdapter(com.jogamp.newt.event.MouseListener newtListener) {
super(newtListener);
@@ -47,12 +49,14 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
public AWTAdapter addTo(java.awt.Component awtComponent) {
awtComponent.addMouseListener(this);
awtComponent.addMouseMotionListener(this);
+ awtComponent.addMouseWheelListener(this);
return this;
}
public AWTAdapter removeFrom(java.awt.Component awtComponent) {
awtComponent.removeMouseListener(this);
awtComponent.removeMouseMotionListener(this);
+ awtComponent.removeMouseWheelListener(this);
return this;
}
@@ -118,5 +122,14 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
enqueueEvent(false, event);
}
}
+
+ public void mouseWheelMoved(java.awt.event.MouseWheelEvent e) {
+ com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
+ if(null!=newtListener) {
+ ((com.jogamp.newt.event.MouseListener)newtListener).mouseWheelMoved(event);
+ } else {
+ enqueueEvent(false, event);
+ }
+ }
}