@Override
public void mouseClicked(MouseEvent evt)
{
- if ((evt.getModifiers()
- & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
+ if ((evt.getModifiersEx()
+ & InputEvent.BUTTON3_DOWN_MASK) == InputEvent.BUTTON3_DOWN_MASK)
{
showPopupMenu(evt);
}
{
if (od.isPositionInBox(evt.getX(), evt.getY()))
{
- // display drag cursor at mouse position
- setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
+ this.getParent()
+ .setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
else
{
- // reset cursor
- setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ this.getParent()
+ .setCursor(
+ Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
}
}
@Override
public void mousePressed(MouseEvent evt)
{
- if ((evt.getModifiers()
- & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
+ if ((evt.getModifiersEx()
+ & InputEvent.BUTTON3_DOWN_MASK) == InputEvent.BUTTON3_DOWN_MASK)
{
if (!Platform.isAMac())
{
}
else
{
+ // don't do anything if the mouse press is in the overview's box
+ // (wait to see if it's a drag instead)
+ // otherwise update the viewport
if (!od.isPositionInBox(evt.getX(), evt.getY()))
- {
- // don't do anything if the mouse press is in the overview's box
- // (wait to see if it's a drag instead)
- // otherwise update the viewport
+ {
+ draggingBox = false;
+
+ // display drag cursor at mouse position
+ setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
+
od.updateViewportFromMouse(evt.getX(), evt.getY(),
av.getAlignment().getHiddenSequences(),
av.getAlignment().getHiddenColumns());
+ getParent()
+ .setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
else
{
@Override
public void mouseReleased(MouseEvent evt)
{
- if (draggingBox)
- {
- draggingBox = false;
- }
+ draggingBox = false;
}
@Override
public void mouseDragged(MouseEvent evt)
{
- if ((evt.getModifiers()
- & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
+ if ((evt.getModifiersEx()
+ & InputEvent.BUTTON3_DOWN_MASK) == InputEvent.BUTTON3_DOWN_MASK)
{
if (!Platform.isAMac())
{
av.getAlignment().getHiddenSequences(),
av.getAlignment().getHiddenColumns());
}
- ap.paintAlignment(false);
+ ap.paintAlignment(false, false);
}
}
} finally
{
av = null;
+ if (oviewCanvas != null)
+ {
+ oviewCanvas.dispose();
+ }
oviewCanvas = null;
ap = null;
od = null;