X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAnnotationPanel.java;h=38e033185f04ce180ded9682b20ac1bfefc751d7;hb=771a739cee6cd92de86c97ad93929c7fc4eecc09;hp=aef651161be4e7bf7f6670b520e872735f94e6b4;hpb=2de8acfae59aced665e4c37ad0f7dcc2ed68818e;p=jalview.git diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index aef6511..38e0331 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -59,7 +59,13 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, int imgWidth = 0; boolean fastPaint = false; + //Used For mouse Dragging and resizing graphs + int graphStretch = -1; + int graphStretchY = -1; + + boolean mouseDragging=false; + public static int GRAPH_HEIGHT = 40; boolean MAC = false; @@ -262,6 +268,13 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, { activeRow = i; } + else if (aa[i].graph > 0) + { + // Stretch Graph + graphStretch = i; + graphStretchY = evt.getY(); + } + break; } @@ -307,6 +320,9 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, public void mouseReleased(MouseEvent evt) { + graphStretch = -1; + graphStretchY = -1; + mouseDragging = false; ap.scalePanel.mouseReleased(evt); } @@ -316,7 +332,22 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, public void mouseDragged(MouseEvent evt) { - ap.scalePanel.mouseDragged(evt); + if (graphStretch > -1) + { + av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY + - evt.getY(); + if (av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight < 0) + { + av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight = 0; + } + graphStretchY = evt.getY(); + adjustPanelHeight(); + ap.paintAlignment(true); + } + else + { + ap.scalePanel.mouseDragged(evt); + } } public void mouseMoved(MouseEvent evt) @@ -720,7 +751,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, x1 += av.charWidth / 2; } - if (row.annotations[column] == null + if (!validRes || row.annotations[column] == null || row.annotations[column].secondaryStructure != 'H') { g.fillArc((x * av.charWidth) - av.charWidth, y + 4 @@ -852,7 +883,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, } } - if (row.graph > 0) + if (row.graph > 0 && row.graphHeight> 0) { if (row.graph == AlignmentAnnotation.LINE_GRAPH) {