From: gmungoc Date: Wed, 20 Mar 2019 15:19:48 +0000 (+0000) Subject: Merge branch 'develop' into Jalview-JS/develop X-Git-Tag: Release_2_11_4_0~45^2~18^2~214 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0b79ea556e792594cab9bd2b4f6cba3b01abaf24;p=jalview.git Merge branch 'develop' into Jalview-JS/develop Conflicts: src/jalview/gui/AlignFrame.java src/jalview/gui/ScalePanel.java --- 0b79ea556e792594cab9bd2b4f6cba3b01abaf24 diff --cc src/jalview/gui/AlignFrame.java index 4bf424b,4ff1b4f..e2c3ac3 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@@ -851,7 -821,7 +851,7 @@@ public class AlignFrame extends GAlignF Desktop.instance.removeJalviewPropertyChangeListener("services", thisListener); closeMenuItem_actionPerformed(true); -- }; ++ } }); // Finally, build the menu once to get current service state new Thread(new Runnable() @@@ -3374,7 -3282,7 +3369,7 @@@ { overview.dispose(); alignPanel.setOverviewPanel(null); -- }; ++ } }); if (getKeyListeners().length > 0) { @@@ -5009,7 -4903,7 +5004,7 @@@ trimrs.setSelected(trimrs.isSelected()); Cache.setProperty(DBRefFetcher.TRIM_RETRIEVED_SEQUENCES, Boolean.valueOf(trimrs.isSelected()).toString()); -- }; ++ } }); rfetch.add(trimrs); JMenuItem fetchr = new JMenuItem( @@@ -5728,22 -5631,18 +5723,22 @@@ 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) + final AlignFrame us = this; + chooser.setResponseHandler(0, new Runnable() { - String choice = chooser.getSelectedFile().getPath(); - Cache.setProperty("LAST_DIRECTORY", choice); - SequenceI[] seqs = viewport.getAlignment().getSequencesArray(); - new VCFLoader(choice).loadVCF(seqs, this); - } + @Override + public void run() + { + String choice = chooser.getSelectedFile().getPath(); + Cache.setProperty("LAST_DIRECTORY", choice); + SequenceI[] seqs = viewport.getAlignment().getSequencesArray(); + new VCFLoader(choice).loadVCF(seqs, us); - }; ++ } + }); + chooser.showOpenDialog(null); } + } class PrintThread extends Thread diff --cc src/jalview/gui/ScalePanel.java index 9c2b42f,b392c8f..bb15bd2 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@@ -48,7 -48,7 +48,6 @@@ import java.util.List import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JPopupMenu; --import javax.swing.SwingUtilities; import javax.swing.ToolTipManager; /** @@@ -276,11 -278,11 +275,12 @@@ public class ScalePanel extends JPane mouseDragging = false; ap.getSeqPanel().stopScrolling(); + // todo res calculation should be a method on AlignViewport int xCords = Math.max(0, evt.getX()); // prevent negative X coordinates + ViewportRanges ranges = av.getRanges(); int res = (xCords / av.getCharWidth()) - + av.getRanges().getStartRes(); - + + ranges.getStartRes(); + res = Math.min(res, ranges.getEndRes()); if (av.hasHiddenColumns()) { res = av.getAlignment().getHiddenColumns()