image is panel size
[jalview.git] / src / jalview / appletgui / AnnotationPanel.java
index 82d2a1e..172211e 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer\r
- * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
  *\r
  * This program is free software; you can redistribute it and/or\r
  * modify it under the terms of the GNU General Public License\r
@@ -196,13 +196,13 @@ public class AnnotationPanel
     if(av.hasHiddenColumns)\r
           res = av.getColumnSelection().adjustForHiddenColumns(res);\r
 \r
-    if (row > -1 && res < aa[row].annotations.length && aa[row].annotations[res] != null)\r
-    {\r
-      StringBuffer text = new StringBuffer("Sequence position " + (res + 1) +\r
-                                           "  " +\r
-                                           aa[row].annotations[res].description);\r
-      ap.alignFrame.statusBar.setText(text.toString());\r
-    }\r
+        if (row > -1 && res < aa[row].annotations.length && aa[row].annotations[res] != null)\r
+        {\r
+          StringBuffer text = new StringBuffer("Sequence position " + (res + 1));\r
+          if (aa[row].annotations[res].description != null)\r
+            text.append("  " + aa[row].annotations[res].description);\r
+          ap.alignFrame.statusBar.setText(text.toString());\r
+        }\r
   }\r
 \r
   public void update(Graphics g)\r
@@ -213,7 +213,8 @@ public class AnnotationPanel
   public void paint(Graphics g)\r
   {\r
 \r
-    imgWidth = (av.endRes - av.startRes + 1) * av.charWidth;\r
+    imgWidth = getSize().width;\r
+        //(av.endRes - av.startRes + 1) * av.charWidth;\r
 \r
     if (image == null || imgWidth != image.getWidth(this))\r
     {\r
@@ -232,8 +233,6 @@ public class AnnotationPanel
     }\r
 \r
     drawComponent(gg, av.startRes, av.endRes + 1);\r
-    g.setColor(Color.white);\r
-    g.fillRect(0, 0, getSize().width, getSize().height);\r
     g.drawImage(image, 0, 0, this);\r
   }\r
 \r
@@ -287,7 +286,7 @@ public class AnnotationPanel
 \r
 \r
       g.setColor(Color.white);\r
-      g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getSize().height);\r
+      g.fillRect(0, 0, getSize().width, getSize().height);\r
 \r
       if ((av.alignment.getAlignmentAnnotation() == null) ||\r
               (av.alignment.getAlignmentAnnotation().length < 1))\r
@@ -552,12 +551,13 @@ public class AnnotationPanel
                 else\r
                  {\r
                    g.fillRect(lastSSX, y + 4 + iconOffset,\r
-                              (x+1) * av.charWidth - lastSSX, 7);\r
+                              x * av.charWidth - lastSSX, 7);\r
                  }\r
                 break;\r
 \r
               default:\r
                 g.setColor(Color.gray);\r
+                if(!av.wrapAlignment || endRes==av.endRes)\r
                 g.fillRect(lastSSX, y + 6 + iconOffset,\r
                            (x*av.charWidth) - lastSSX, 2);\r
 \r