JAL-2094 first pass with jalview.api.ColorI interface
[jalview.git] / src / MCview / PDBChain.java
index 3b84ee3..e048cd6 100755 (executable)
 package MCview;
 
 import jalview.analysis.AlignSeq;
+import jalview.api.ColorI;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Annotation;
 import jalview.datamodel.Mapping;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
+import jalview.schemes.Colour;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ResidueProperties;
 import jalview.structure.StructureMapping;
@@ -486,26 +488,26 @@ public class PDBChain
       }
       else
       {
-        b.startCol = Color.gray;
-        b.endCol = Color.gray;
+        b.startCol = Colour.gray;
+        b.endCol = Colour.gray;
       }
     }
   }
 
-  public static Color getChargeColour(String resName)
+  public static ColorI getChargeColour(String resName)
   {
-    Color result = Color.lightGray;
+    ColorI result = Colour.lightGray;
     if ("ASP".equals(resName) || "GLU".equals(resName))
     {
-      result = Color.red;
+      result = Colour.red;
     }
     else if ("LYS".equals(resName) || "ARG".equals(resName))
     {
-      result = Color.blue;
+      result = Colour.blue;
     }
     else if ("CYS".equals(resName))
     {
-      result = Color.yellow;
+      result = Colour.yellow;
     }
     return result;
   }
@@ -525,15 +527,17 @@ public class PDBChain
       try
       {
         index = ResidueProperties.aa3Hash.get(b.at1.resName).intValue();
-        b.startCol = cs.findColour(ResidueProperties.aa[index].charAt(0));
+        b.startCol = new Colour(cs.findColour(ResidueProperties.aa[index]
+                .charAt(0)));
 
         index = ResidueProperties.aa3Hash.get(b.at2.resName).intValue();
-        b.endCol = cs.findColour(ResidueProperties.aa[index].charAt(0));
+        b.endCol = new Colour(cs.findColour(ResidueProperties.aa[index]
+                .charAt(0)));
 
       } catch (Exception e)
       {
-        b.startCol = Color.gray;
-        b.endCol = Color.gray;
+        b.startCol = Colour.gray;
+        b.endCol = Colour.gray;
       }
     }
   }
@@ -542,8 +546,8 @@ public class PDBChain
   {
     for (Bond b : bonds)
     {
-      b.startCol = col;
-      b.endCol = col;
+      b.startCol = new Colour(col);
+      b.endCol = new Colour(col);
     }
   }