Merge branch 'develop' into features/JAL-1793VCF
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 27 Oct 2017 08:10:40 +0000 (09:10 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 27 Oct 2017 08:10:40 +0000 (09:10 +0100)
1  2 
src/jalview/gui/AlignFrame.java

@@@ -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);
      /*
       * Create a new AlignmentPanel (with its own, new Viewport)
       */
-     AlignmentPanel newap = new Jalview2XML().copyAlignPanel(alignPanel,
-             true);
+     AlignmentPanel newap = new Jalview2XML().copyAlignPanel(alignPanel);
      if (!copyAnnotation)
      {
        /*
    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();
    }
  
        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);
 +      new VCFLoader(viewport.getAlignment()).loadVCF(choice, this);
 +    }
 +
 +  }
  }
  
  class PrintThread extends Thread