X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAlignFrame.java;fp=src%2Fjalview%2Fappletgui%2FAlignFrame.java;h=15904df0f04b25272fc55d74a55a560bd49f7b01;hb=1379350f04bc63ca05bd428afb86717c4764755d;hp=c1dbf303c2923abee49fb2e73252531e9e5264a7;hpb=34d8b4dc08dcd27c3b5ac3bf7811f709b4db5938;p=jalview.git diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index c1dbf30..15904df 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -2335,7 +2335,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis { try { - sg.cs = (ColourSchemeI) cs.getClass().newInstance(); + sg.cs = cs.getClass().newInstance(); } catch (Exception ex) { ex.printStackTrace(); @@ -3685,6 +3685,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis throw new RuntimeException("The file provided does not match the T-Coffee scores file format"); } + /* + * check that the score matrix matches the alignment dimensions + */ + AlignmentI aln; + if( (aln=viewport.alignment) != null && (aln.getHeight() != file.getHeight() || aln.getWidth() != file.getWidth()) ) { + throw new RuntimeException("The scores matrix does not match the alignment dimensions"); + } + tcoffeeColour.setEnabled(true); tcoffeeScoreFile = file;