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-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbug%2FJAL-3648graphDragRelease;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 35ae242..f8172dc 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -634,6 +634,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); @@ -674,16 +678,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