From: tcofoegbu Date: Thu, 3 Sep 2015 14:00:34 +0000 (+0100) Subject: JAL-1861 disable the action buttons for 1500 millisec when the ok button is clicked X-Git-Tag: Release_2_10_0~506 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=726e3c49af9cf61c3b11c5aa4d8a695c5450b078;p=jalview.git JAL-1861 disable the action buttons for 1500 millisec when the ok button is clicked --- diff --git a/src/jalview/gui/PDBSearchPanel.java b/src/jalview/gui/PDBSearchPanel.java index b31c637..4e23f57 100644 --- a/src/jalview/gui/PDBSearchPanel.java +++ b/src/jalview/gui/PDBSearchPanel.java @@ -195,6 +195,7 @@ public class PDBSearchPanel extends GPDBSearchPanel public void loadSelectedPDBSequencesToAlignment() { // mainFrame.dispose(); + disableActionButtons(); StringBuilder selectedIds = new StringBuilder(); HashSet selectedIdsSet = new HashSet(); int pdbIdCol = PDBRestClient.getPDBIdColumIndex(wantedFields, false); @@ -217,6 +218,35 @@ public class PDBSearchPanel extends GPDBSearchPanel seqFetcher.textArea.setText(ids); Thread worker = new Thread(seqFetcher); worker.start(); + delayAndEnableActionButtons(); + + } + + private void disableActionButtons() + { + btn_ok.setEnabled(false); + btn_back.setEnabled(false); + btn_cancel.setEnabled(false); + } + + private void delayAndEnableActionButtons() + { + new Thread() + { + public void run() + { + try + { + Thread.sleep(1500); + } catch (InterruptedException e) + { + e.printStackTrace(); + } + btn_ok.setEnabled(true); + btn_back.setEnabled(true); + btn_cancel.setEnabled(true); + } + }.start(); } public static String getPDBIdwithSpecifiedChain(String pdbId,