From: gmungoc Date: Mon, 11 Mar 2019 14:54:26 +0000 (+0000) Subject: JAL-3201 restore group colours correctly from project X-Git-Tag: Release_2_11_0~17^2~47^2~1^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Ffeature%2FJAL-2250colourAllGroups;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 53e9a83..1797fb7 100644 --- a/src/jalview/project/Jalview2XML.java +++ b/src/jalview/project/Jalview2XML.java @@ -4977,21 +4977,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 0f56561..0ea31d7 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 afc445e..ea3f00b 100644 --- a/test/jalview/project/Jalview2xmlTests.java +++ b/test/jalview/project/Jalview2xmlTests.java @@ -818,6 +818,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);