Merge branch 'feature/JAL-3127_seqidChainshading' into merge/JAL-3127
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 11 Mar 2019 11:37:58 +0000 (11:37 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 11 Mar 2019 11:37:58 +0000 (11:37 +0000)
Conflicts:
src/jalview/gui/Jalview2XML.java
src/jalview/gui/Jalview2XML_V1.java
test/jalview/io/Jalview2xmlTests.java

14 files changed:
1  2 
resources/lang/Messages.properties
resources/lang/Messages_es.properties
src/jalview/bin/Jalview.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/AlignViewport.java
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/AnnotationColourChooser.java
src/jalview/gui/PopupMenu.java
src/jalview/gui/TreeCanvas.java
src/jalview/project/Jalview2XML.java
src/jalview/schemes/AnnotationColourGradient.java
src/jalview/viewmodel/AlignmentViewport.java
test/jalview/project/Jalview2xmlTests.java
test/jalview/schemes/AnnotationColourGradientTest.java

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -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());
            }
          }
        }
        else
        {
-         cs = ColourSchemeProperty.getColourScheme(al, view.getBgColour());
 -        cs = ColourSchemeProperty.getColourScheme(af.viewport, al,
++        cs = ColourSchemeProperty.getColourScheme(af.getViewport(), al,
+                 view.getBgColour());
        }
      }
  
      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);
  
@@@ -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,
@@@ -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" })