From: gmungoc Date: Tue, 30 Aug 2016 14:49:34 +0000 (+0100) Subject: JAL-2183 simplified database tree actionPerformed, accept dbl-click X-Git-Tag: Release_2_10_0~64 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ba7cba06e47fd8f46aafb04c5f2b33718db4f320;p=jalview.git JAL-2183 simplified database tree actionPerformed, accept dbl-click --- diff --git a/src/jalview/fts/service/pdb/PDBFTSPanel.java b/src/jalview/fts/service/pdb/PDBFTSPanel.java index 5f5c716..dc2b403 100644 --- a/src/jalview/fts/service/pdb/PDBFTSPanel.java +++ b/src/jalview/fts/service/pdb/PDBFTSPanel.java @@ -45,6 +45,7 @@ public class PDBFTSPanel extends GFTSPanel public PDBFTSPanel(SequenceFetcher seqFetcher) { + super(); pageLimit = PDBFTSRestClient.getInstance().getDefaultResponsePageSize(); this.seqFetcher = seqFetcher; this.progressIdicator = (seqFetcher == null) ? null : seqFetcher diff --git a/src/jalview/fts/service/uniprot/UniprotFTSPanel.java b/src/jalview/fts/service/uniprot/UniprotFTSPanel.java index 9c2c5ce..5691db1 100644 --- a/src/jalview/fts/service/uniprot/UniprotFTSPanel.java +++ b/src/jalview/fts/service/uniprot/UniprotFTSPanel.java @@ -46,6 +46,7 @@ public class UniprotFTSPanel extends GFTSPanel public UniprotFTSPanel(SequenceFetcher seqFetcher) { + super(); pageLimit = UniProtFTSRestClient.getInstance() .getDefaultResponsePageSize(); this.seqFetcher = seqFetcher; diff --git a/src/jalview/gui/JDatabaseTree.java b/src/jalview/gui/JDatabaseTree.java index 8294d2b..59c34ec 100644 --- a/src/jalview/gui/JDatabaseTree.java +++ b/src/jalview/gui/JDatabaseTree.java @@ -33,6 +33,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.HashSet; import java.util.Hashtable; @@ -168,6 +170,19 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener _setSelectionState(); } }); + dbviews.addMouseListener(new MouseAdapter() + { + + @Override + public void mousePressed(MouseEvent e) + { + if (e.getClickCount() == 2) + { + okPressed(); + closeDialog(); + } + } + }); JPanel jc = new JPanel(new BorderLayout()), j = new JPanel( new FlowLayout()); jc.add(svp, BorderLayout.CENTER); @@ -557,6 +572,7 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener { action = arg0.getKeyCode(); okPressed(); + closeDialog(); } if (!arg0.isConsumed() && arg0.getKeyChar() == KeyEvent.VK_ESCAPE) { diff --git a/src/jalview/gui/SequenceFetcher.java b/src/jalview/gui/SequenceFetcher.java index e1644e7..afe6754 100755 --- a/src/jalview/gui/SequenceFetcher.java +++ b/src/jalview/gui/SequenceFetcher.java @@ -115,8 +115,6 @@ public class SequenceFetcher extends JPanel implements Runnable private static Thread initingThread = null; - int debounceTrap = 0; - public JTextArea getTextArea() { return textArea; @@ -384,7 +382,6 @@ public class SequenceFetcher extends JPanel implements Runnable @Override public void actionPerformed(ActionEvent e) { - debounceTrap++; String currentSelection = database.getSelectedItem(); if (currentSelection == null) { @@ -394,14 +391,10 @@ public class SequenceFetcher extends JPanel implements Runnable showPanel(); if ("pdb".equalsIgnoreCase(currentSelection)) - // && (database.action == KeyEvent.VK_ENTER || ((debounceTrap % 2) == - // 0))) { pdbSourceAction(); } else if ("uniprot".equalsIgnoreCase(currentSelection)) - // && (database.action == KeyEvent.VK_ENTER || ((debounceTrap % 2) == - // 0))) { uniprotSourceAction(); }