<div dir="ltr">Hi Seb,<br><br>Thank you so much for all your work on the Java wrappers. I was wondering if there is interest in adding mouse wheel support to the Java GUI components. I was able to add mouse wheel support by making the vtkInteractorForwarder class implement the MouseWheelListener interface and adding the following function:<br>
<br> @Override<br> public void mouseWheelMoved(MouseWheelEvent e) {<br> if (component == null || component.getRenderer() == null) {<br> return;<br> }<br><br> // Allow user to override some behavior<br>
if (this.eventInterceptor != null && this.eventInterceptor.mouseWheelMoved(e)) {<br> return;<br> }<br><br> try {<br> component.getVTKLock().lockInterruptibly();<br> component.getRenderWindow().SetDesiredUpdateRate(this.updateRateRelease);<br>
lastX = e.getX();<br> lastY = e.getY();<br> ctrlPressed = (e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK ? 1 : 0;<br> shiftPressed = (e.getModifiers() & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK ? 1 : 0;<br>
component.getRenderWindowInteractor().SetEventInformationFlipY(lastX, lastY, ctrlPressed, shiftPressed, '0', 0, "0");<br> if (e.getWheelRotation() > 0)<br> component.getRenderWindowInteractor().MouseWheelBackwardEvent();<br>
else<br> component.getRenderWindowInteractor().MouseWheelForwardEvent();<br> }<br> catch (InterruptedException interupt) {<br> // Nothing to do<br> }<br> finally {<br>
component.getVTKLock().unlock();<br> }<br> }<br><br>A few other minor changes are needed as well in a few other Java files. Would this be of interest?<br><br>Thanks,<br>Eli<br></div>