import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.MouseTrackListener;
import org.eclipse.swt.events.MouseWheelListener;
+import org.eclipse.swt.internal.DPIUtil;
/**
* Decorator class used to implement all Mouse/Key SWT listener and convert them
if ((e.button == 1) || (e.stateMask & SWT.BUTTON1) != 0) button = java.awt.event.MouseEvent.BUTTON1;
else if ((e.button == 2) || (e.stateMask & SWT.BUTTON2) != 0) button = java.awt.event.MouseEvent.BUTTON2;
else if ((e.button == 3) || (e.stateMask & SWT.BUTTON3) != 0) button = java.awt.event.MouseEvent.BUTTON3;
- return new java.awt.event.MouseEvent(dummyComponent, 0, (long)e.time, convertModifiers(e.button,e.stateMask), e.x, e.y, e.count, false, button);
+ return new java.awt.event.MouseEvent(dummyComponent, 0, (long)e.time, convertModifiers(e.button,e.stateMask), DPIUtil.autoScaleUp(e.x), DPIUtil.autoScaleUp(e.y), e.count, false, button);
}
public int convertKeyCode(int swtKeyCode) {
}
public java.awt.event.MouseWheelEvent convertMouseWheelEvent(org.eclipse.swt.events.MouseEvent e) {
- return new java.awt.event.MouseWheelEvent(dummyComponent, 0, e.time, convertModifiers(e.button,e.stateMask), e.x, e.y, 0, false, java.awt.event.MouseWheelEvent.WHEEL_UNIT_SCROLL, 1, e.count);
+ return new java.awt.event.MouseWheelEvent(dummyComponent, 0, e.time, convertModifiers(e.button,e.stateMask), DPIUtil.autoScaleUp(e.x), DPIUtil.autoScaleUp(e.y), 0, false, java.awt.event.MouseWheelEvent.WHEEL_UNIT_SCROLL, 1, e.count);
}
public void keyPressed(KeyEvent e) {
import java.util.concurrent.locks.ReentrantLock;
+import org.eclipse.swt.internal.DPIUtil;
+
import vtk.vtkAxesActor;
import vtk.vtkCamera;
import vtk.vtkGenericRenderWindowInteractor;
if (renderWindow == null || windowInteractor == null) {
return; // Nothing to do we are deleted...
}
-
+ w = DPIUtil.autoScaleUp(w);
+ h = DPIUtil.autoScaleUp(h);
try {
lock.lockInterruptibly();
renderWindow.SetSize(w, h);