From: Jim Procter Date: Mon, 2 Jul 2018 16:36:28 +0000 (+0100) Subject: JAL-3048 File->VCF load refactored X-Git-Tag: Release_2_11_4_0~45^2~18^2~603^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=85a10a2e77527a6c763fd52e3175c8158785cbca;p=jalview.git JAL-3048 File->VCF load refactored --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index e45dc5d..e4a3f8c 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -5642,22 +5642,27 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, @Override protected void loadVcf_actionPerformed() { - // TODO: JAL-3048 - No VCF support in JsJalview 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")); + final AlignFrame us = this; + chooser.response(new RunResponse(JalviewFileChooser.APPROVE_OPTION) + { + @Override + public void run() + { - int value = chooser.showOpenDialog(null); + { + String choice = chooser.getSelectedFile().getPath(); + Cache.setProperty("LAST_DIRECTORY", choice); + SequenceI[] seqs = viewport.getAlignment().getSequencesArray(); + new VCFLoader(choice).loadVCF(seqs, us); + } - 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); - } + }; + }).openDialog(null); }