JAL-1473 refactor score matrices and tree score calculations to interface/api and...
[jalview.git] / test / jalview / schemes / ScoreMatrixPrinter.java
index a472951..2830918 100644 (file)
@@ -18,6 +18,8 @@
  */
 package jalview.schemes;
 
+import jalview.api.analysis.ScoreModelI;
+
 import java.util.Map;
 
 import org.junit.Test;
@@ -28,7 +30,7 @@ public class ScoreMatrixPrinter
   @Test
   public void printAllMatrices()
   {
-    for (Map.Entry<String,ScoreMatrix> sm:((Map<String, ScoreMatrix>) ResidueProperties.scoreMatrices).entrySet())
+    for (Map.Entry<String,ScoreModelI> sm: ResidueProperties.scoreMatrices.entrySet())
     {
       System.out.println("Matrix "+sm.getKey());
       System.out.println(sm.getValue().toString());
@@ -37,10 +39,14 @@ public class ScoreMatrixPrinter
   @Test
   public void printHTMLMatrices()
   {
-    for (Map.Entry<String,ScoreMatrix> sm:((Map<String, ScoreMatrix>) ResidueProperties.scoreMatrices).entrySet())
+    for (Map.Entry<String,ScoreModelI> _sm: ResidueProperties.scoreMatrices.entrySet())
     {
-      System.out.println("Matrix "+sm.getKey());
-      System.out.println(sm.getValue().outputMatrix(true));
+      if (_sm.getValue() instanceof ScoreMatrix)
+      {
+        ScoreMatrix sm = (ScoreMatrix) _sm.getValue();
+        System.out.println("Matrix "+_sm.getKey());
+        System.out.println(sm.outputMatrix(true));
+      }
     }
   }