X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAnnotationPanel.java;h=17c0c8a1f8e634b658b1de77d35a203ec7b9a3f6;hb=30e5fae28c2ecfffb28d834a2428255ca1f81b94;hp=d4024ba40f0f634fc834d91617bca33b4741c646;hpb=174230b4233d9ce80f94527768d2cd2f76da11ab;p=jalview.git diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index d4024ba..17c0c8a 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -196,13 +196,13 @@ public class AnnotationPanel if(av.hasHiddenColumns) res = av.getColumnSelection().adjustForHiddenColumns(res); - if (row > -1 && res < aa[row].annotations.length && aa[row].annotations[res] != null) - { - StringBuffer text = new StringBuffer("Sequence position " + (res + 1) + - " " + - aa[row].annotations[res].description); - ap.alignFrame.statusBar.setText(text.toString()); - } + if (row > -1 && res < aa[row].annotations.length && aa[row].annotations[res] != null) + { + StringBuffer text = new StringBuffer("Sequence position " + (res + 1)); + if (aa[row].annotations[res].description != null) + text.append(" " + aa[row].annotations[res].description); + ap.alignFrame.statusBar.setText(text.toString()); + } } public void update(Graphics g) @@ -213,7 +213,8 @@ public class AnnotationPanel public void paint(Graphics g) { - imgWidth = (av.endRes - av.startRes + 1) * av.charWidth; + imgWidth = getSize().width; + //(av.endRes - av.startRes + 1) * av.charWidth; if (image == null || imgWidth != image.getWidth(this)) { @@ -224,6 +225,7 @@ public class AnnotationPanel fastPaint = false; } + if (fastPaint) { g.drawImage(image, 0, 0, this); @@ -231,9 +233,11 @@ public class AnnotationPanel return; } + gg.setColor(Color.white); + gg.fillRect(0, 0, getSize().width, getSize().height); drawComponent(gg, av.startRes, av.endRes + 1); - g.setColor(Color.white); - g.fillRect(0, 0, getSize().width, getSize().height); + + g.drawImage(image, 0, 0, this); } @@ -282,13 +286,15 @@ public class AnnotationPanel { g.setFont(av.getFont()); + + g.setColor(Color.white); + g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getSize().height); + + if (fm == null) fm = g.getFontMetrics(); - g.setColor(Color.white); - g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getSize().height); - if ((av.alignment.getAlignmentAnnotation() == null) || (av.alignment.getAlignmentAnnotation().length < 1)) { @@ -552,7 +558,7 @@ public class AnnotationPanel else { g.fillRect(lastSSX, y + 4 + iconOffset, - (x+1) * av.charWidth - lastSSX, 7); + x * av.charWidth - lastSSX, 7); } break;