Has its own featureRenderer
authoramwaterhouse <Andrew Waterhouse>
Fri, 24 Mar 2006 16:28:29 +0000 (16:28 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 24 Mar 2006 16:28:29 +0000 (16:28 +0000)
src/MCview/AppletPDBCanvas.java

index 2a452b2..107d98d 100755 (executable)
@@ -77,6 +77,7 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion
     Bond highlightBond1, highlightBond2;\r
     boolean errorLoading = false;\r
     boolean seqColoursReady = false;\r
+    jalview.appletgui.FeatureRenderer fr;\r
 \r
     public AppletPDBCanvas(jalview.appletgui.SeqCanvas seqcanvas, Sequence seq)\r
     {\r
@@ -479,6 +480,18 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion
     // Applet and Application specific sequence renderers to be used\r
     void colourBySequence(PDBChain chain)\r
     {\r
+      boolean showFeatures = false;\r
+\r
+      if(seqcanvas.getViewport().getShowSequenceFeatures())\r
+        {\r
+          if(fr==null)\r
+          {\r
+            fr = new jalview.appletgui.FeatureRenderer(seqcanvas.getViewport());\r
+          }\r
+          fr.transferSettings( seqcanvas.getFeatureRenderer());\r
+          showFeatures = true;\r
+        }\r
+\r
       for (int i = 0; i < chain.bonds.size(); i++)\r
       {\r
         Bond tmp = (Bond) chain.bonds.elementAt(i);\r
@@ -498,8 +511,8 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion
               tmp.startCol = seqcanvas.getSequenceRenderer().\r
                   getResidueBoxColour( sequence, index);\r
 \r
-              tmp.startCol = seqcanvas.getFeatureRenderer().\r
-                  findFeatureColour(tmp.startCol, sequence, index);\r
+              if(showFeatures)\r
+              tmp.startCol = fr.findFeatureColour(tmp.startCol, sequence, index);\r
             }\r
         }\r
 \r
@@ -509,8 +522,9 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion
         {\r
           tmp.endCol = seqcanvas.getSequenceRenderer().\r
               getResidueBoxColour( sequence, index);\r
-          tmp.endCol = seqcanvas.getFeatureRenderer().\r
-              findFeatureColour(tmp.endCol, sequence, index);\r
+\r
+          if(showFeatures)\r
+          tmp.endCol = fr.findFeatureColour(tmp.endCol, sequence, index);\r
         }\r
       }\r
     }\r