From: gmungoc Date: Thu, 18 Jun 2020 14:43:51 +0000 (+0100) Subject: JAL-3648 resize annotation panel after dragging to resize graph height X-Git-Tag: Release_2_11_1_1~8 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e0556caa4fb141cfce47d03a0750fd5364582ce7;p=jalview.git JAL-3648 resize annotation panel after dragging to resize graph height --- diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 16db94c..10fc3cf 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -629,6 +629,10 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, mouseDragLastX = -1; mouseDragLastY = -1; mouseDragging = false; + if (dragMode == DragMode.Resize) + { + ap.adjustAnnotationHeight(); + } dragMode = DragMode.Undefined; ap.getScalePanel().mouseReleased(evt); @@ -668,16 +672,25 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, } /** - * DOCUMENT ME! + * Action on starting or continuing a mouse drag. There are two possible + * actions: + * + * A drag on a graph annotation is treated as column selection if it starts + * with more horizontal than vertical movement, and as resize if it starts + * with more vertical than horizontal movement. Once started, the drag does + * not change mode. * * @param evt - * DOCUMENT ME! */ @Override public void mouseDragged(MouseEvent evt) { /* - * todo: if dragMode is Undefined: + * if dragMode is Undefined: * - set to Select if dx > dy * - set to Resize if dy > dx * - do nothing if dx == dy