FeatureRenderer mixups fixed
authoramwaterhouse <Andrew Waterhouse>
Fri, 27 Apr 2007 16:19:25 +0000 (16:19 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 27 Apr 2007 16:19:25 +0000 (16:19 +0000)
src/MCview/AppletPDBCanvas.java
src/MCview/AppletPDBViewer.java

index a61ecb2..47aa94b 100755 (executable)
@@ -98,8 +98,7 @@ public class AppletPDBCanvas
 
       if(protocol.equals(jalview.io.AppletFormatAdapter.PASTE))
        pdbentry.setFile("INLINE"+pdb.id);
-      //if (fr!=null)
-      //  fr.featuresAdded();
+
     }catch(Exception ex)
     {
       ex.printStackTrace();
@@ -110,9 +109,7 @@ public class AppletPDBCanvas
 
     ssm.addStructureViewerListener(this);
 
-    colourBySequence(ap.getSequenceRenderer(),
-                     ap.av.getShowSequenceFeatures() ?
-                     fr : null);
+    colourBySequence();
 
     int max = -10;
     int maxchain = -1;
@@ -243,9 +240,7 @@ public class AppletPDBCanvas
       }
     }
     seqColoursReady = true;
-    colourBySequence(ap.getSequenceRenderer(),
-                               ap.av.getShowSequenceFeatures() ?
-                               fr : null);
+    colourBySequence();
     redrawneeded = true;
     repaint();
   }
@@ -500,19 +495,21 @@ public class AppletPDBCanvas
 
   // This method has been taken out of PDBChain to allow
   // Applet and Application specific sequence renderers to be used
-  void colourBySequence(SequenceRenderer sr, FeatureRenderer seqcanvasfr)
+  void colourBySequence()
   {
+    SequenceRenderer sr = ap.getSequenceRenderer();
+
     StructureMapping[] mapping = ssm.getMapping(pdbentry.getFile());
 
     boolean showFeatures = false;
-    if (seqcanvasfr!=null)
+    if (ap.av.getShowSequenceFeatures())
     {
       if (fr == null)
       {
         fr = new jalview.appletgui.FeatureRenderer(ap.av);
       }
 
-      fr.transferSettings(seqcanvasfr);
+      fr.transferSettings(ap.getFeatureRenderer());
 
       showFeatures = true;
     }
@@ -1162,9 +1159,7 @@ public class AppletPDBCanvas
   public void updateColours(Object source)
   {
     AlignmentPanel ap = (AlignmentPanel) source;
-    colourBySequence(ap.getSequenceRenderer(),
-                     ap.av.getShowSequenceFeatures() ?
-                     fr : null);
+    colourBySequence();
     redrawneeded = true;
     repaint();
   }
index 43e5197..2f8a90f 100755 (executable)
@@ -87,9 +87,7 @@ public class AppletPDBViewer
     else if (evt.getSource() == seqButton)\r
     {\r
       pdbcanvas.bysequence = true;\r
-      pdbcanvas.colourBySequence(pdbcanvas.ap.getSequenceRenderer(),\r
-                                 pdbcanvas.ap.av.getShowSequenceFeatures() ?\r
-                                 pdbcanvas.ap.getFeatureRenderer() : null);\r
+      pdbcanvas.colourBySequence();\r
 \r
     }\r
     else if (evt.getSource() == zappo)\r