JAL-2438 FeatureColourFinder refactored from FeatureRenderer, fr not
[jalview.git] / src / MCview / PDBCanvas.java
index 1c7a1f7..ae58758 100644 (file)
@@ -26,7 +26,9 @@ import jalview.datamodel.SequenceI;
 import jalview.gui.AlignmentPanel;
 import jalview.gui.FeatureRenderer;
 import jalview.gui.SequenceRenderer;
+import jalview.io.DataSourceType;
 import jalview.io.StructureFile;
+import jalview.renderer.seqfeatures.FeatureColourFinder;
 import jalview.structure.AtomSpec;
 import jalview.structure.StructureListener;
 import jalview.structure.StructureMapping;
@@ -141,7 +143,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
   String errorMessage;
 
   void init(PDBEntry pdbentry, SequenceI[] seq, String[] chains,
-          AlignmentPanel ap, String protocol)
+          AlignmentPanel ap, DataSourceType protocol)
   {
     this.ap = ap;
     this.pdbentry = pdbentry;
@@ -153,7 +155,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
     {
       pdb = ssm.setMapping(seq, chains, pdbentry.getFile(), protocol);
 
-      if (protocol.equals(jalview.io.AppletFormatAdapter.PASTE))
+      if (protocol.equals(jalview.io.DataSourceType.PASTE))
       {
         pdbentry.setFile("INLINE" + pdb.getId());
       }
@@ -188,8 +190,10 @@ public class PDBCanvas extends JPanel implements MouseListener,
     for (int i = 0; i < pdb.getChains().size(); i++)
     {
 
-      mappingDetails.append("\n\nPDB Sequence is :\nSequence = "
-              + pdb.getChains().elementAt(i).sequence.getSequenceAsString());
+      mappingDetails
+              .append("\n\nPDB Sequence is :\nSequence = "
+                      + pdb.getChains().elementAt(i).sequence
+                              .getSequenceAsString());
       mappingDetails.append("\nNo of residues = "
               + pdb.getChains().elementAt(i).residues.size() + "\n\n");
 
@@ -543,6 +547,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
       showFeatures = true;
     }
 
+    FeatureColourFinder finder = new FeatureColourFinder(fr);
     PDBChain chain;
     if (bysequence && pdb != null)
     {
@@ -573,7 +578,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
                   tmp.startCol = sr.getResidueBoxColour(sequence[s], pos);
                   if (showFeatures)
                   {
-                    tmp.startCol = fr.findFeatureColour(tmp.startCol,
+                    tmp.startCol = finder.findFeatureColour(tmp.startCol,
                             sequence[s], pos);
                   }
                 }
@@ -584,7 +589,7 @@ public class PDBCanvas extends JPanel implements MouseListener,
                   tmp.endCol = sr.getResidueBoxColour(sequence[s], pos);
                   if (showFeatures)
                   {
-                    tmp.endCol = fr.findFeatureColour(tmp.endCol,
+                    tmp.endCol = finder.findFeatureColour(tmp.endCol,
                             sequence[s], pos);
                   }
                 }