diff options
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java | 15 |
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); + } + } } |