show search results added
authoramwaterhouse <Andrew Waterhouse>
Wed, 1 Dec 2004 17:33:10 +0000 (17:33 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 1 Dec 2004 17:33:10 +0000 (17:33 +0000)
src/jalview/gui/AlignmentPanel.java

index 4f56474..33b8665 100755 (executable)
@@ -51,7 +51,10 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
    seqPanel.seqCanvas.highlightSearchResults( results );\r
 \r
    // do we need to scroll the panel?\r
-   if(av.getStartSeq()>results[0] || av.getEndSeq()<results[0]  || av.getStartRes()>results[1] || av.getEndRes()<results[2])\r
+   if(results!=null && (av.getStartSeq()>results[0]\r
+                        || av.getEndSeq()<results[0]\r
+                        || av.getStartRes()>results[1]\r
+                        || av.getEndRes()<results[2]))\r
        setScrollValues(results[1], results[0]);\r
 \r
 \r
@@ -98,14 +101,13 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
   public void RefreshPanels()\r
   {\r
     invalidate();\r
-    validate();\r
     seqPanel.seqCanvas.paintFlag = true;\r
     idPanel.idCanvas.paintFlag = true;\r
     idPanelHolder.setPreferredSize( idPanel.idCanvas.getPreferredSize() );\r
     setScrollValues(av.getStartRes(), av.getStartSeq());\r
     av.getConsensus(true);\r
     repaint();\r
-\r
+    validate();\r
     if(overviewPanel!=null)\r
       overviewPanel.updateOverviewImage();\r
 \r