From 964c4a6836f02a8b58c5eac7c6722e60c90d72d0 Mon Sep 17 00:00:00 2001 From: kiramt Date: Fri, 14 Jul 2017 09:59:38 +0100 Subject: [PATCH] JAL-2611 Pre-merge checkin --- src/jalview/gui/OverviewPanel.java | 29 ++++++++++++++++++++++--- src/jalview/viewmodel/OverviewDimensions.java | 7 +++++- 2 files changed, 32 insertions(+), 4 deletions(-) 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 -- 1.7.10.2