Merge branch 'releases/Release_2_10_4_Branch' into develop
authorJim Procter <jprocter@issues.jalview.org>
Tue, 20 Feb 2018 13:40:41 +0000 (13:40 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 20 Feb 2018 13:40:41 +0000 (13:40 +0000)
1  2 
build.xml
src/jalview/gui/AlignFrame.java

diff --combined build.xml
+++ b/build.xml
@@@ -17,7 -17,9 +17,9 @@@
   * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
   * The Jalview Authors are detailed in the 'AUTHORS' file.
  -->
- <project name="jalviewX" default="usage" basedir=".">
+ <project name="jalviewX" default="usage" basedir="."
+  xmlns:if="ant:if"
+     xmlns:unless="ant:unless">
    <target name="help" depends="usage" />
    <target name="usage" depends="init">
      <echo message="~~~Jalview Ant build.xml Usage~~~~" />
  
      <!-- default TestNG groups to run -->
      <property name="testng-groups" value="Functional" />
+     <!-- Java 9 JVM args -->
+     <condition property="java9">
+       <equals arg1="${ant.java.version}" arg2="9"/>
+     </condition>
  
      <!-- Don't change anything below here unless you know what you are doing! -->
      <!-- Url path for WebStart in JNLP file -->
      <!-- Anne's version needs 1.7 - should rebuild VARNA to java 1.6 for release -->
      <property name="j2sev" value="1.7+" />
      <!-- Java Compilation settings - source and target javac version -->
 -    <property name="javac.source" value="1.7" />
 -    <property name="javac.target" value="1.7" />
 +    <property name="javac.source" value="1.8" />
 +    <property name="javac.target" value="1.8" />
  
      <!-- Permissions for running Java applets and applications. -->
      <!-- Defaults are those suitable for deploying jalview webstart www.jalview.org -->
          <pathelement location="${testOutputDir}" />
          <path refid="test.classpath" />
        </classpath>
+       <jvmarg value="--add-modules=java.se.ee" if:set="java9"/>
+       <jvmarg value="--illegal-access=warn" if:set="java9"/>
        <classfileset dir="${testOutputDir}" includes="**/*.class" />
      </testng>
    </target>
            <offline_allowed />
          </information>
          <resources>
 -          <j2se version="1.7+" />
 +          <j2se version="1.8+" />
            <jar main="true" href="jalview.jar"/>
            <fileset dir="${packageDir}">
              <exclude name="jalview.jar" />
              <include name="*.jar" />
              <include name="*_*.jar" />
-             <exclude name="*jnilib.jar" />
+             <exclude name="*quaqua*.jar" />
            </fileset>
            <property name="jalview.version" value="${JALVIEW_VERSION}" />
          </resources>
          <resources os="Mac OS X">
            <fileset dir="${packageDir}">
-             <include name="*quaqua*.jnilib.jar" />
+                <include name="quaqua-filechooser-only-8.0.jar"/>
+             <include name="*quaqua64*.jnilib.jar" />
            </fileset>
          </resources>
  
  
      <jnlpf toFile="${jnlpFile}" />
      <!-- add the add-modules j2se attribute for java 9 -->
 -    <replace file="${jnlpFile}" value="j2se version=&quot;1.7+&quot; initial-heap-size=&quot;${inih}&quot; max-heap-size=&quot;${maxh}&quot; java-vm-args=&quot;--add-modules=java.se.ee --illegal-access=warn&quot;">
 -          <replacetoken>j2se version="1.7+"</replacetoken>
 -           
 -        </replace>
 +    <replace file="${jnlpFile}" value="j2se version=&quot;1.8+&quot; initial-heap-size=&quot;${inih}&quot; max-heap-size=&quot;${maxh}&quot; java-vm-args=&quot;--add-modules=java.se.ee --illegal-access=warn&quot;">
 +          <replacetoken>j2se version="1.8+"</replacetoken>
 +    </replace>
    </target>
  
    <target name="-dofakejnlpfileassoc" depends="-generatejnlpf" if="nojnlpfileassocs">
        <include name="plugin.jar" />
      </fileset>
    </path>
 -  <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard.jar" />
 +  <taskdef resource="proguard/ant/task.properties" classpath="utils/proguard_5.3.3.jar" />
  
    <proguard verbose="true" >
      <injar file="in.jar" />
@@@ -81,7 -81,6 +81,7 @@@ import jalview.io.JnetAnnotationMaker
  import jalview.io.NewickFile;
  import jalview.io.ScoreMatrixFile;
  import jalview.io.TCoffeeScoreFile;
 +import jalview.io.vcf.VCFLoader;
  import jalview.jbgui.GAlignFrame;
  import jalview.schemes.ColourSchemeI;
  import jalview.schemes.ColourSchemes;
@@@ -840,7 -839,6 +840,7 @@@ public class AlignFrame extends GAlignF
      AlignmentI al = getViewport().getAlignment();
      boolean nucleotide = al.isNucleotide();
  
 +    loadVcf.setVisible(nucleotide);
      showTranslation.setVisible(nucleotide);
      showReverse.setVisible(nucleotide);
      showReverseComplement.setVisible(nucleotide);
    @Override
    public void exportFeatures_actionPerformed(ActionEvent e)
    {
 -    new AnnotationExporter().exportFeatures(alignPanel);
 +    new AnnotationExporter(alignPanel).exportFeatures();
    }
  
    @Override
    public void exportAnnotations_actionPerformed(ActionEvent e)
    {
 -    new AnnotationExporter().exportAnnotations(alignPanel);
 +    new AnnotationExporter(alignPanel).exportAnnotations();
    }
  
    @Override
    protected void showProductsFor(final SequenceI[] sel, final boolean _odna,
            final String source)
    {
 -    new Thread(CrossRefAction.showProductsFor(sel, _odna, source, this))
 +    new Thread(CrossRefAction.getHandlerFor(sel, _odna, source, this))
              .start();
    }
  
              MessageManager.getString("option.trim_retrieved_seqs"));
      trimrs.setToolTipText(
              MessageManager.getString("label.trim_retrieved_sequences"));
-     trimrs.setSelected(Cache.getDefault("TRIM_FETCHED_DATASET_SEQS", true));
+     trimrs.setSelected(
+             Cache.getDefault(DBRefFetcher.TRIM_RETRIEVED_SEQUENCES, true));
      trimrs.addActionListener(new ActionListener()
      {
        @Override
        public void actionPerformed(ActionEvent e)
        {
          trimrs.setSelected(trimrs.isSelected());
-         Cache.setProperty("TRIM_FETCHED_DATASET_SEQS",
+         Cache.setProperty(DBRefFetcher.TRIM_RETRIEVED_SEQUENCES,
                  Boolean.valueOf(trimrs.isSelected()).toString());
        };
      });
        new CalculationChooser(AlignFrame.this);
      }
    }
 +
 +  @Override
 +  protected void loadVcf_actionPerformed()
 +  {
 +    JalviewFileChooser chooser = new JalviewFileChooser(
 +            Cache.getProperty("LAST_DIRECTORY"));
 +    chooser.setFileView(new JalviewFileView());
 +    chooser.setDialogTitle(MessageManager.getString("label.load_vcf_file"));
 +    chooser.setToolTipText(MessageManager.getString("label.load_vcf_file"));
 +
 +    int value = chooser.showOpenDialog(null);
 +
 +    if (value == JalviewFileChooser.APPROVE_OPTION)
 +    {
 +      String choice = chooser.getSelectedFile().getPath();
 +      Cache.setProperty("LAST_DIRECTORY", choice);
 +      SequenceI[] seqs = viewport.getAlignment().getSequencesArray();
 +      new VCFLoader(choice).loadVCF(seqs, this);
 +    }
 +
 +  }
  }
  
  class PrintThread extends Thread