From: gmungoc Date: Mon, 11 Mar 2019 14:54:26 +0000 (+0000) Subject: JAL-3201 restore group colours correctly from project X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbug%2FJAL-3201groupClustal;p=jalview.git JAL-3201 restore group colours correctly from project --- diff --git a/src/jalview/project/Jalview2XML.java b/src/jalview/project/Jalview2XML.java index e57dd01..518d271 100644 --- a/src/jalview/project/Jalview2XML.java +++ b/src/jalview/project/Jalview2XML.java @@ -4971,21 +4971,22 @@ public class Jalview2XML } } + /* + * turn off 'alignment colour applies to all groups' + * while restoring global colour scheme + */ + viewport.setColourAppliesToAllGroups(false); viewport.setGlobalColourScheme(cs); viewport.getResidueShading().setThreshold(pidThreshold, view.isIgnoreGapsinConsensus()); viewport.getResidueShading() .setConsensus(viewport.getSequenceConsensusHash()); - viewport.setColourAppliesToAllGroups(false); - if (safeBoolean(view.isConservationSelected()) && cs != null) { viewport.getResidueShading() .setConservationInc(safeInt(view.getConsThreshold())); } - af.changeColour(cs); - viewport.setColourAppliesToAllGroups(true); viewport diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index ca32ee7..8438492 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -662,7 +662,8 @@ public abstract class AlignmentViewport * retain any colour thresholds per group while * changing choice of colour scheme (JAL-2386) */ - sg.setColourScheme(cs.getInstance(sg, hiddenRepSequences)); + sg.setColourScheme( + cs == null ? null : cs.getInstance(sg, hiddenRepSequences)); if (cs != null) { sg.getGroupColourScheme().alignmentChanged(sg, diff --git a/test/jalview/project/Jalview2xmlTests.java b/test/jalview/project/Jalview2xmlTests.java index 3f4ed71..f2199e0 100644 --- a/test/jalview/project/Jalview2xmlTests.java +++ b/test/jalview/project/Jalview2xmlTests.java @@ -809,6 +809,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase /* * Colour alignment by Buried Index, Above 10% PID, By Conservation 20% */ + av.setColourAppliesToAllGroups(false); af.changeColour_actionPerformed(JalviewColourScheme.Buried.toString()); assertTrue(av.getGlobalColourScheme() instanceof BuriedColourScheme); af.abovePIDThreshold_actionPerformed(true);