Update overview if features updated
authoramwaterhouse <Andrew Waterhouse>
Fri, 10 Feb 2006 16:05:27 +0000 (16:05 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 10 Feb 2006 16:05:27 +0000 (16:05 +0000)
src/jalview/gui/FeatureRenderer.java
src/jalview/gui/FeatureSettings.java
src/jalview/gui/OverviewPanel.java

index 03080bd..3f332b5 100755 (executable)
@@ -62,7 +62,7 @@ public class FeatureRenderer
      * of the rendered sequence\r
      */\r
     BufferedImage bi;\r
-    public synchronized Color findFeatureColour(Color initialCol, SequenceI seq, int i)\r
+    public Color findFeatureColour(Color initialCol, SequenceI seq, int i)\r
     {\r
       if(!av.showSequenceFeatures)\r
         return initialCol;\r
index 7dae703..bbaaa5a 100755 (executable)
@@ -136,22 +136,23 @@ public class FeatureSettings extends JPanel
     Enumeration e;\r
     SequenceFeature sf;\r
 \r
-    for(int i=0; i< av.alignment.getHeight(); i++)\r
-    {\r
-       features = av.alignment.getSequenceAt(i).getDatasetSequence().getSequenceFeatures();\r
-       if(features==null)\r
-         continue;\r
+  for (int i = 0; i < av.alignment.getHeight(); i++)\r
+  {\r
+    features = av.alignment.getSequenceAt(i).getDatasetSequence().\r
+        getSequenceFeatures();\r
+    if (features == null)\r
+      continue;\r
 \r
-       e = features.elements();\r
-       while(e.hasMoreElements())\r
-       {\r
-         sf = (SequenceFeature)e.nextElement();\r
-         if(!allFeatures.contains(sf.getType()))\r
-         {\r
-           allFeatures.addElement(sf.getType());\r
-         }\r
-       }\r
+    e = features.elements();\r
+    while (e.hasMoreElements())\r
+    {\r
+      sf = (SequenceFeature) e.nextElement();\r
+      if (!allFeatures.contains(sf.getType()))\r
+      {\r
+        allFeatures.addElement(sf.getType());\r
+      }\r
     }\r
+\r
     if(allFeatures.size()<1)\r
      {\r
        try{\r
@@ -333,6 +334,9 @@ public class FeatureSettings extends JPanel
   {\r
     fr.setFeaturePriority( data );\r
     ap.repaint();\r
+\r
+    if(ap.overviewPanel!=null)\r
+      ap.overviewPanel.updateOverviewImage();\r
   }\r
 \r
   int selectedRow =-1;\r
index a35966d..e20084c 100755 (executable)
@@ -67,7 +67,6 @@ public class OverviewPanel extends JPanel implements Runnable
         sr.renderGaps( false );\r
         fr = new FeatureRenderer(av);\r
         fr.transparency = ap.seqPanel.seqCanvas.getFeatureRenderer().transparency;\r
-        fr.featuresDisplayed = ap.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed;\r
 \r
         // scale the initial size of overviewpanel to shape of alignment\r
         float initialScale = (float) av.alignment.getWidth() / (float) av.alignment.getHeight();\r
@@ -287,8 +286,9 @@ public class OverviewPanel extends JPanel implements Runnable
                 av.alignment.getSequenceAt(lastrow), lastcol);\r
 \r
              if(av.showSequenceFeatures)\r
-                  color = fr.findFeatureColour(color,  av.alignment.getSequenceAt(lastrow),\r
-                                                       lastcol);\r
+                 color = fr.findFeatureColour(color,  av.alignment.getSequenceAt(lastrow),\r
+                                             lastcol);\r
+\r
             }\r
 \r
             miniMe.setRGB(col,row,color.getRGB());\r