Skip to content

Commit

Permalink
Merge branch 'i300_sphincsplus' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Leischnig committed Apr 27, 2020
2 parents 49476fd + 37a5756 commit 4d0070a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.eclipse.swt.events.ExpandListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.MouseWheelListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
Expand Down Expand Up @@ -215,21 +216,6 @@ public void mouseDown(MouseEvent e) {

if (distinctListener == false)
zestComposite.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_SIZEALL));
Runnable runnable = new Runnable() {
@Override
public void run() {
while (mouseDragging) {
if (distinctListener == false)
updateViewLocation();
try {
Thread.sleep(2);

} catch (InterruptedException e) {
}
}
}
};
new Thread(runnable).start();
}

@Override
Expand All @@ -238,7 +224,16 @@ public void mouseDoubleClick(MouseEvent e) {
}
};


graphViewer.getGraphControl().addMouseListener(dragQueen);
MouseMoveListener moveListener = new MouseMoveListener() {

@Override
public void mouseMove(MouseEvent e) {
updateViewLocation();
}
};
graphViewer.getGraphControl().addMouseMoveListener(moveListener);
zestComposite.addMouseListener(dragQueen);

// We give the focus to our graphViewer, so it receives the MouseWheel Events.
Expand Down Expand Up @@ -282,10 +277,10 @@ public void itemCollapsed(ExpandEvent e) {
* Sets the current view location based on mouse movement.
*/
private void updateViewLocation() {
curDisplay.asyncExec(new Runnable() {

@Override
public void run() {
// curDisplay.asyncExec(new Runnable() {
//
// @Override
// public void run() {
newMouse = getDisplay().getCursorLocation();
differenceMouseX = newMouse.x - oldMouse.x;
differenceMouseY = newMouse.y - oldMouse.y;
Expand All @@ -297,8 +292,8 @@ public void run() {
oldMouse = newMouse;
}
}
}
});
// }
// });
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.eclipse.swt.events.ExpandListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.MouseWheelListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
Expand Down Expand Up @@ -313,21 +314,6 @@ public void mouseDown(MouseEvent e) {

if (distinctListener == false)
zestComposite.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_SIZEALL));
Runnable runnable = new Runnable() {
@Override
public void run() {
while (mouseDragging) {
if (distinctListener == false)
updateViewLocation();
try {
Thread.sleep(2);

} catch (InterruptedException e) {
}
}
}
};
new Thread(runnable).start();
}

@Override
Expand All @@ -337,6 +323,14 @@ public void mouseDoubleClick(MouseEvent e) {
};

graphViewer.getGraphControl().addMouseListener(dragQueen);
graphViewer.getGraphControl().addMouseMoveListener(new MouseMoveListener() {

@Override
public void mouseMove(MouseEvent e) {
updateViewLocation();
}
});

zestComposite.addMouseListener(dragQueen);

// We give the focus to our graphViewer, so it receives the MouseWheel Events
Expand Down Expand Up @@ -380,10 +374,10 @@ public void itemCollapsed(ExpandEvent e) {
* Sets the current view location based on mouse movement
*/
private void updateViewLocation() {
curDisplay.asyncExec(new Runnable() {

@Override
public void run() {
// curDisplay.asyncExec(new Runnable() {
//
// @Override
// public void run() {
newMouse = getDisplay().getCursorLocation();
differenceMouseX = newMouse.x - oldMouse.x;
differenceMouseY = newMouse.y - oldMouse.y;
Expand All @@ -395,8 +389,8 @@ public void run() {
oldMouse = newMouse;
}
}
}
});
// }
// });
}

/**
Expand Down

0 comments on commit 4d0070a

Please sign in to comment.