From: amwaterhouse Date: Fri, 3 Feb 2006 17:43:58 +0000 (+0000) Subject: Tooltip for multiple graph lines updated X-Git-Tag: Root_VamJalview_2_07b+~177 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9480f18113c0d16dfb157eb3fff60a1e29c33d39;p=jalview.git Tooltip for multiple graph lines updated --- diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index e3d8de1..27ac873 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -539,11 +539,8 @@ public class AnnotationPanel extends JPanel implements MouseListener, int res = (evt.getX() / av.getCharWidth()) + av.getStartRes(); - if ((row > -1) && (res < aa[row].annotations.length) && - (aa[row].annotations[res] != null)) + if (row > -1 && res-1) { StringBuffer tip = new StringBuffer(""); @@ -552,15 +549,23 @@ public class AnnotationPanel extends JPanel implements MouseListener, if (aa[gg].graphGroup == aa[row].graphGroup && aa[gg].annotations[res]!=null) tip.append(aa[gg].label+" "+aa[gg].annotations[res].description+"
" ); } - tip.setLength(tip.length()-4); - this.setToolTipText(tip.toString()+""); + if(tip.length()!=6) + { + tip.setLength(tip.length() - 4); + this.setToolTipText(tip.toString() + ""); + } } - else + else if(aa[row].annotations[res] != null) this.setToolTipText(aa[row].annotations[res].description); - StringBuffer text = new StringBuffer("Sequence position " + - (res + 1) + " " + aa[row].annotations[res].description); - ap.alignFrame.statusBar.setText(text.toString()); + if(aa[row].annotations[res]!=null) + { + StringBuffer text = new StringBuffer("Sequence position " + + (res + 1) + " " + + aa[row].annotations[res].description); + + ap.alignFrame.statusBar.setText(text.toString()); + } } } @@ -711,6 +716,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, } + if (row.graph>0) { if(row.graphGroup>-1 && graphGroupDrawn[ row.graphGroup ] ) @@ -856,7 +862,8 @@ public class AnnotationPanel extends JPanel implements MouseListener, case 'E': g.setColor(SHEET_COLOUR); - if (row.annotations[endRes].secondaryStructure != 'E') + if (row.annotations.length > endRes + && row.annotations[endRes].secondaryStructure != 'E') { g.fillRect(lastSSX[i], y + 4 + iconOffset, x - lastSSX[i] - 4, 7); @@ -1047,6 +1054,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, for (int j = sRes; j < eRes; j++) { + if (aa.annotations[j] == null) { x += av.charWidth;