X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FJalview2XML.java;h=a8fb28dfe4c1e567eb5a946dbddfedb16a328e9b;hb=95a46891288f4fc63d690cab4f56879678f54fb6;hp=a449d7f0e15136e9ba17199bdce34f6a5b073d8e;hpb=f7bcceb4efd723c25d5169fd2fa139b3610eb84e;p=jalview.git diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index a449d7f..a8fb28d 100755 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -295,17 +295,19 @@ public class Jalview2XML groups[i].setEnd(sg.getEndRes()); groups[i].setName(sg.getName()); - if (sg.cs instanceof ConservationColourScheme) + if (sg.cs.conservationApplied()) { - ConservationColourScheme ccs = (ConservationColourScheme) sg.cs; - groups[i].setConsThreshold(ccs.inc); + groups[i].setConsThreshold(sg.cs.getConservationInc()); - if (ccs.cs instanceof jalview.schemes.UserColourScheme) + if (sg.cs instanceof jalview.schemes.UserColourScheme) { - groups[i].setColour(SetUserColourScheme(ccs.cs, userColours, + groups[i].setColour(SetUserColourScheme(sg.cs, userColours, jms)); } - + else + { + groups[i].setColour(ColourSchemeProperty.getColourName(sg.cs)); + } } else if (sg.cs instanceof jalview.schemes.UserColourScheme) @@ -319,12 +321,8 @@ public class Jalview2XML sg.cs)); } - if (sg.cs instanceof ResidueColourScheme) - { - groups[i].setPidThreshold(((ResidueColourScheme) sg.cs).getThreshold()); - } - + groups[i].setPidThreshold( sg.cs.getThreshold() ); groups[i].setOutlineColour(sg.getOutlineColour().getRGB()); groups[i].setDisplayBoxes(sg.getDisplayBoxes()); @@ -365,17 +363,16 @@ public class Jalview2XML ColourSchemeI cs = av.getGlobalColourScheme(); - if (cs instanceof ConservationColourScheme) + if (cs.conservationApplied()) { - ConservationColourScheme ccs = (ConservationColourScheme)cs; - view.setConsThreshold(ccs.inc); - if(ccs.cs instanceof jalview.schemes.UserColourScheme) - view.setBgColour(SetUserColourScheme(ccs.cs, userColours, jms)); + view.setConsThreshold(cs.getConservationInc()); + if(cs instanceof jalview.schemes.UserColourScheme) + view.setBgColour(SetUserColourScheme(cs, userColours, jms)); } if (cs instanceof ResidueColourScheme) { - view.setPidThreshold(((ResidueColourScheme) cs).getThreshold()); + view.setPidThreshold( cs.getThreshold() ); } view.setConservationSelected(av.getConservationSelected()); @@ -635,10 +632,7 @@ public class Jalview2XML groups[i].getColour()); } - if (cs instanceof ResidueColourScheme) - { - ((ResidueColourScheme) cs).setThreshold(groups[i].getPidThreshold(), true); - } + cs.setThreshold(groups[i].getPidThreshold(), true); } Vector seqs = new Vector(); @@ -665,8 +659,7 @@ public class Jalview2XML sg.getWidth() - 1); c.calculate(); c.verdict(false, 25); - cs = new ConservationColourScheme(c, cs); - sg.cs = cs; + sg.cs.setConservation(c); } al.addGroup(sg); @@ -731,10 +724,7 @@ public class Jalview2XML cs = ColourSchemeProperty.getColour(al, view.getBgColour()); } - if (cs instanceof ResidueColourScheme) - { - ((ResidueColourScheme) cs).setThreshold(view.getPidThreshold(), true); - } + cs.setThreshold(view.getPidThreshold(), true); if(cs!=null) cs.setConsensus(af.viewport.vconsensus); @@ -746,7 +736,7 @@ public class Jalview2XML af.changeColour(af.viewport.getGlobalColourScheme()); if (view.getConservationSelected()) { - ( (ConservationColourScheme) af.viewport.getGlobalColourScheme()).inc = view.getConsThreshold(); + af.viewport.getGlobalColourScheme().setConservationInc(view.getConsThreshold()); } af.viewport.setColourAppliesToAllGroups(true);