<div dir="ltr">Hi Eli,<div><br></div><div>Sure that would make sense. Please push your patch using gerrit and add me as a reviewer.</div><div><br></div><div><a href="http://www.kitware.com/source/home/post/62">http://www.kitware.com/source/home/post/62</a><br>
</div><div><br></div><div>Thanks,</div><div><br></div><div>Seb</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 29, 2014 at 9:03 PM, E KN <span dir="ltr"><<a href="mailto:egk865@gmail.com" target="_blank">egk865@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>