Merge branch 'develop' into Jalview-JS/develop
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 20 Mar 2019 15:19:48 +0000 (15:19 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 20 Mar 2019 15:19:48 +0000 (15:19 +0000)
Conflicts:
src/jalview/gui/AlignFrame.java
src/jalview/gui/ScalePanel.java

1  2 
src/jalview/gui/AlignFrame.java
src/jalview/gui/ScalePanel.java
src/jalview/gui/SeqPanel.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()
                {
                  overview.dispose();
                  alignPanel.setOverviewPanel(null);
--              };
++              }
              });
      if (getKeyListeners().length > 0)
      {
          trimrs.setSelected(trimrs.isSelected());
          Cache.setProperty(DBRefFetcher.TRIM_RETRIEVED_SEQUENCES,
                  Boolean.valueOf(trimrs.isSelected()).toString());
--      };
++      }
      });
      rfetch.add(trimrs);
      JMenuItem fetchr = new JMenuItem(
      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
@@@ -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()
Simple merge