From: gmungoc Date: Mon, 11 Mar 2019 11:37:58 +0000 (+0000) Subject: Merge branch 'feature/JAL-3127_seqidChainshading' into merge/JAL-3127 X-Git-Tag: Release_2_11_0~17^2~50 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=16d109024847af92482237e43f99b82fd997451a;p=jalview.git Merge branch 'feature/JAL-3127_seqidChainshading' into merge/JAL-3127 Conflicts: src/jalview/gui/Jalview2XML.java src/jalview/gui/Jalview2XML_V1.java test/jalview/io/Jalview2xmlTests.java --- 16d109024847af92482237e43f99b82fd997451a diff --cc src/jalview/project/Jalview2XML.java index 53e9a83,133c186..11404dc --- a/src/jalview/project/Jalview2XML.java +++ b/src/jalview/project/Jalview2XML.java @@@ -3859,7 -3423,8 +3859,7 @@@ public class Jalview2XM } else { - cs = ColourSchemeProperty.getColourScheme(al, - // TODO: notify of view reference when available + cs = ColourSchemeProperty.getColourScheme(null, al, jGroup.getColour()); } } @@@ -4973,7 -4553,8 +4973,8 @@@ } else { - cs = ColourSchemeProperty.getColourScheme(al, view.getBgColour()); - cs = ColourSchemeProperty.getColourScheme(af.viewport, al, ++ cs = ColourSchemeProperty.getColourScheme(af.getViewport(), al, + view.getBgColour()); } } @@@ -5270,14 -4894,13 +5271,14 @@@ else { cs = new AnnotationColourGradient(matchedAnnotation, - ColourSchemeProperty.getColourScheme(al, - ColourSchemeProperty.getColourScheme(af.viewport, al, ++ ColourSchemeProperty.getColourScheme(af.getViewport(), al, viewAnnColour.getColourScheme()), - viewAnnColour.getAboveThreshold()); + safeInt(viewAnnColour.getAboveThreshold())); } - boolean perSequenceOnly = viewAnnColour.isPerSequence(); - boolean useOriginalColours = viewAnnColour.isPredefinedColours(); + boolean perSequenceOnly = safeBoolean(viewAnnColour.isPerSequence()); + boolean useOriginalColours = safeBoolean( + viewAnnColour.isPredefinedColours()); cs.setSeqAssociated(perSequenceOnly); cs.setPredefinedColours(useOriginalColours); diff --cc src/jalview/viewmodel/AlignmentViewport.java index 0f56561,6427b45..850c68e --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@@ -662,7 -662,7 +662,7 @@@ public abstract class AlignmentViewpor * retain any colour thresholds per group while * changing choice of colour scheme (JAL-2386) */ - sg.setColourScheme(cs.getInstance(sg, hiddenRepSequences)); - sg.setColourScheme(cs); ++ sg.setColourScheme(cs.getInstance(this, sg)); if (cs != null) { sg.getGroupColourScheme().alignmentChanged(sg, diff --cc test/jalview/project/Jalview2xmlTests.java index afc445e,8b65c3d..e0f0db3 --- a/test/jalview/project/Jalview2xmlTests.java +++ b/test/jalview/project/Jalview2xmlTests.java @@@ -147,27 -137,26 +147,28 @@@ public class Jalview2xmlTests extends J DataSourceType.FILE); assertNotNull(af, "Didn't read input file " + inFile); af.loadJalviewDataFile(inAnnot, DataSourceType.FILE, null, null); -- assertSame(af.getViewport().getGlobalColourScheme().getClass(), ++ AlignViewport viewport = af.getViewport(); ++ assertSame(viewport.getGlobalColourScheme().getClass(), TCoffeeColourScheme.class, "Didn't set T-coffee colourscheme"); assertNotNull( - ColourSchemeProperty.getColourScheme( - af.getViewport().getAlignment(), - af.getViewport().getGlobalColourScheme() - ColourSchemeProperty.getColourScheme(af.getViewport(), - af.getViewport() - .getAlignment(), af.getViewport().getGlobalColourScheme() - .getSchemeName()), "Recognise T-Coffee score from string"); ++ ColourSchemeProperty.getColourScheme(viewport, ++ viewport.getAlignment(), ++ viewport.getGlobalColourScheme() + .getSchemeName()), + "Recognise T-Coffee score from string"); assertTrue(af.saveAlignment(tfile, FileFormat.Jalview), "Failed to store as a project."); af.closeMenuItem_actionPerformed(true); af = null; - af = new FileLoader() - .LoadFileWaitTillLoaded(tfile, DataSourceType.FILE); + af = new FileLoader().LoadFileWaitTillLoaded(tfile, + DataSourceType.FILE); assertNotNull(af, "Failed to import new project"); -- assertSame(af.getViewport().getGlobalColourScheme().getClass(), ++ assertSame(viewport.getGlobalColourScheme().getClass(), TCoffeeColourScheme.class, "Didn't set T-coffee colourscheme for imported project."); - System.out - .println("T-Coffee score shading successfully recovered from project."); + System.out.println( + "T-Coffee score shading successfully recovered from project."); } @Test(groups = { "Functional" })