JAL-1421 add types to Map
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 21 Dec 2016 14:50:48 +0000 (14:50 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 21 Dec 2016 14:50:48 +0000 (14:50 +0000)
src/jalview/schemes/CovariationColourScheme.java

index ee78317..3637ce3 100644 (file)
@@ -24,6 +24,7 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AnnotatedCollectionI;
 import jalview.datamodel.SequenceCollectionI;
 import jalview.datamodel.SequenceI;
 import jalview.datamodel.AnnotatedCollectionI;
 import jalview.datamodel.SequenceCollectionI;
 import jalview.datamodel.SequenceI;
+import jalview.util.ColorUtils;
 
 import java.awt.Color;
 import java.util.Hashtable;
 
 import java.awt.Color;
 import java.util.Hashtable;
@@ -37,9 +38,9 @@ import java.util.Map;
  */
 public class CovariationColourScheme extends ResidueColourScheme
 {
  */
 public class CovariationColourScheme extends ResidueColourScheme
 {
-  public Hashtable helixcolorhash = new Hashtable();
+  public Map<String, Color> helixcolorhash = new Hashtable<String, Color>();
 
 
-  public Hashtable positionsToHelix = new Hashtable();
+  public Map<Integer, String> positionsToHelix = new Hashtable<Integer, String>();
 
   int numHelix = 0;
 
 
   int numHelix = 0;
 
@@ -86,8 +87,8 @@ public class CovariationColourScheme extends ResidueColourScheme
 
     for (int j = 0; j <= numHelix; j++)
     {
 
     for (int j = 0; j <= numHelix; j++)
     {
-      helixcolorhash.put(Integer.toString(j),
-              jalview.util.ColorUtils.generateRandomColor(Color.white));
+      helixcolorhash.put(String.valueOf(j),
+              ColorUtils.generateRandomColor(Color.white));
     }
 
   }
     }
 
   }
@@ -124,12 +125,12 @@ public class CovariationColourScheme extends ResidueColourScheme
     Color currentColour = Color.white;
     String currentHelix = null;
     // System.out.println(c + " " + j);
     Color currentColour = Color.white;
     String currentHelix = null;
     // System.out.println(c + " " + j);
-    currentHelix = (String) positionsToHelix.get(j);
+    currentHelix = positionsToHelix.get(j);
     // System.out.println(positionsToHelix.get(j));
 
     if (currentHelix != null)
     {
     // System.out.println(positionsToHelix.get(j));
 
     if (currentHelix != null)
     {
-      currentColour = (Color) helixcolorhash.get(currentHelix);
+      currentColour = helixcolorhash.get(currentHelix);
     }
 
     // System.out.println(c + " " + j + " helix " + currentHelix + " " +
     }
 
     // System.out.println(c + " " + j + " helix " + currentHelix + " " +