From: kiramt Date: Fri, 14 Jul 2017 08:59:38 +0000 (+0100) Subject: JAL-2611 Pre-merge checkin X-Git-Tag: Release_2_10_3b1~132^2~30^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=964c4a6836f02a8b58c5eac7c6722e60c90d72d0;p=jalview.git JAL-2611 Pre-merge checkin --- diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 3fa674e..35a3148 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -116,6 +116,21 @@ public class OverviewPanel extends JPanel implements Runnable, } } + + @Override + public void mouseMoved(MouseEvent evt) + { + if (od.isPositionInBox(evt.getX(), evt.getY())) + { + // display drag cursor at mouse position + + } + else + { + // reset cursor + + } + } }); addMouseListener(new MouseAdapter() @@ -132,9 +147,15 @@ public class OverviewPanel extends JPanel implements Runnable, } else if (!av.getWrapAlignment()) { - od.updateViewportFromMouse(evt.getX(), evt.getY(), av - .getAlignment().getHiddenSequences(), av.getAlignment() - .getHiddenColumns()); + 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 + od.updateViewportFromMouse(evt.getX(), evt.getY(), + av.getAlignment().getHiddenSequences(), + av.getAlignment().getHiddenColumns()); + } } } @@ -146,6 +167,8 @@ public class OverviewPanel extends JPanel implements Runnable, showPopupMenu(evt); } } + + }); diff --git a/src/jalview/viewmodel/OverviewDimensions.java b/src/jalview/viewmodel/OverviewDimensions.java index f053a95..36b5e0f 100644 --- a/src/jalview/viewmodel/OverviewDimensions.java +++ b/src/jalview/viewmodel/OverviewDimensions.java @@ -250,9 +250,14 @@ public abstract class OverviewDimensions * mouse y position * @return true if (x,y) is inside the box */ - protected boolean isPositionInBox(int x, int y) + public boolean isPositionInBox(int x, int y) { return (x > boxX && y > boxY && boxX + x < boxWidth && boxY + y < boxHeight); } + + public void setMousePosition(int x, int y) + { + + } } \ No newline at end of file