clustalx exception in colourchange
authoramwaterhouse <Andrew Waterhouse>
Fri, 15 Apr 2005 15:16:54 +0000 (15:16 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 15 Apr 2005 15:16:54 +0000 (15:16 +0000)
src/jalview/gui/AlignFrame.java

index b00a584..3625e45 100755 (executable)
@@ -821,10 +821,20 @@ public class AlignFrame extends GAlignFrame
       {\r
         SequenceGroup sg = (SequenceGroup)groups.elementAt(i);\r
 \r
-\r
-        try{\r
-          sg.cs = (ColourSchemeI)cs.getClass().newInstance();\r
-        }catch(Exception ex){}\r
+        if (cs instanceof ClustalxColourScheme)\r
+        {\r
+          sg.cs = new ClustalxColourScheme(sg.sequences, sg.getWidth());\r
+        }\r
+        else\r
+          try\r
+          {\r
+            sg.cs = (ColourSchemeI) cs.getClass().newInstance();\r
+          }\r
+          catch (Exception ex)\r
+          {\r
+            ex.printStackTrace();\r
+            sg.cs = cs;\r
+          }\r
 \r
         if(viewport.getAbovePIDThreshold())\r
         {\r