X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationPanel.java;h=15adafc7a88938a4ed184aaa825e252a2d73ccee;hb=0751c58086542f9e0466201b624f84d1efd547bb;hp=0eec840886106f86d93a69fdb3a3c9a54d3c4606;hpb=d3bf4ae12b72df02dee34c95da750ab38a3816b9;p=jalview.git diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 0eec840..15adafc 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -637,6 +637,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); @@ -677,16 +681,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 @@ -878,6 +891,10 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, && ann.annotations[column] != null) { tooltip = ann.annotations[column].description; + if ("".equals(tooltip)) + { + tooltip = null; + } } return tooltip;