patch for JAL-699 so conservation/consensus threads restart correctly
[jalview.git] / src / jalview / gui / AnnotationPanel.java
index f408400..01c933a 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
  * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
@@ -175,8 +175,9 @@ public class AnnotationPanel extends JPanel implements MouseListener,
         height += aa[i].height;
       }
     }
-    else
+    if (height == 0)
     {
+      // set minimum
       height = 20;
     }
 
@@ -199,7 +200,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
   public void actionPerformed(ActionEvent evt)
   {
     AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
-    if (aa==null)
+    if (aa == null)
     {
       return;
     }
@@ -918,9 +919,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
 
               if (v == column)
               {
-                g
-                        .fillRect(x * av.charWidth, y, av.charWidth,
-                                av.charHeight);
+                g.fillRect(x * av.charWidth, y, av.charWidth, av.charHeight);
               }
             }
           }
@@ -1095,9 +1094,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
           if (sCol == 0 || row.annotations[sCol - 1] == null
                   || row.annotations[sCol - 1].secondaryStructure != 'H')
           {
-            g
-                    .fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8,
-                            90, 180);
+            g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90, 180);
             x1 += av.charWidth / 2;
           }
 
@@ -1379,7 +1376,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
         }
       }
       // draw profile if available
-      if (aa.annotations[column].value != 0 && renderProfile)
+      if (renderProfile && aa.annotations[column].value != 0)
       {
         int profl[] = getProfileFor(aa, column);
         int ht = y1, htn = y2 - y1;// aa.graphHeight;
@@ -1415,8 +1412,8 @@ public class AnnotationPanel extends JPanel implements MouseListener,
                                                       // group(aa.groupRef.cs==null)
                                                       // ? av.textColour2 :
                                                       // cs.findColour(dc));
-            g.drawChars(dc, 0, 1, x * av.charWidth, (int) (ht + lm
-                    .getHeight()));
+            g.drawChars(dc, 0, 1, x * av.charWidth,
+                    (int) (ht + lm.getHeight()));
             // ht+=g.getFontMetrics().getAscent()-g.getFontMetrics().getDescent();
           }
         }
@@ -1446,16 +1443,16 @@ public class AnnotationPanel extends JPanel implements MouseListener,
               && aa.groupRef.isShowSequenceLogo())
       {
         return AAFrequency.extractProfile(
-                aa.groupRef.consensusData[column], aa.groupRef
-                        .getIgnoreGapsConsensus());
+                aa.groupRef.consensusData[column],
+                aa.groupRef.getIgnoreGapsConsensus());
       }
       // TODO extend annotation row to enable dynamic and static profile data to
       // be stored
       if (aa.groupRef == null && aa.sequenceRef == null
               && av.isShowSequenceLogo())
       {
-        return AAFrequency.extractProfile(av.hconsensus[column], av
-                .getIgnoreGapsConsensus());
+        return AAFrequency.extractProfile(av.hconsensus[column],
+                av.getIgnoreGapsConsensus());
       }
     }
     return null;