@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);
}
}
else
{
- this.getParent()
- .setCursor(
- Cursor.getPredefinedCursor(Cursor.CROSSHAIR_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.isMac()) // BH was excluding JavaScript
{
// (wait to see if it's a drag instead)
// otherwise update the viewport
if (!od.isPositionInBox(evt.getX(), evt.getY()))
- {
- draggingBox = false;
+ {
+ draggingBox = false;
// display drag cursor at mouse position
setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
@Override
public void mouseDragged(MouseEvent evt)
{
- if (Platform.isWinRightButton(evt))
+ if (Platform.isWinRightButton(evt))
{
- showPopupMenu(evt);
- return;
+ showPopupMenu(evt);
+ return;
}
if (SwingUtilities.isRightMouseButton(evt))
- {
- return;
+ {
+ return;
+ }
+
+ if (draggingBox)
+ {
+ // set the mouse position as a fixed point in the box
+ // and drag relative to that position
+ od.adjustViewportFromMouse(evt.getX(), evt.getY(),
+ av.getAlignment().getHiddenSequences(),
+ av.getAlignment().getHiddenColumns());
+ }
+ else
+ {
+ od.updateViewportFromMouse(evt.getX(), evt.getY(),
+ av.getAlignment().getHiddenSequences(),
+ av.getAlignment().getHiddenColumns());
}
-
- if (draggingBox)
- {
- // set the mouse position as a fixed point in the box
- // and drag relative to that position
- od.adjustViewportFromMouse(evt.getX(), evt.getY(),
- av.getAlignment().getHiddenSequences(),
- av.getAlignment().getHiddenColumns());
- }
- else
- {
- od.updateViewportFromMouse(evt.getX(), evt.getY(),
- av.getAlignment().getHiddenSequences(),
- av.getAlignment().getHiddenColumns());
- }
- ap.paintAlignment(false, false);
+ ap.paintAlignment(false, false);
}
/**