From 60073d3f838affacd3f4158c3e7d069652d26602 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 16 Jun 2016 14:27:29 +0100 Subject: [PATCH] JAL-1993 close sequence fetcher when opening database chooser --- src/jalview/gui/JDatabaseTree.java | 5 ++--- src/jalview/gui/SequenceFetcher.java | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/JDatabaseTree.java b/src/jalview/gui/JDatabaseTree.java index 6d8c4e0..8294d2b 100644 --- a/src/jalview/gui/JDatabaseTree.java +++ b/src/jalview/gui/JDatabaseTree.java @@ -26,7 +26,6 @@ import jalview.ws.seqfetcher.DbSourceProxy; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; @@ -73,7 +72,7 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener @Override public void actionPerformed(ActionEvent arg0) { - showDialog(null); + showDialog(); } }); return viewdbs; @@ -321,7 +320,7 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener closeDialog(); } - private void showDialog(Container parent) + void showDialog() { oldselection = selection; oldtsel = tsel; diff --git a/src/jalview/gui/SequenceFetcher.java b/src/jalview/gui/SequenceFetcher.java index cc8c46e..03bb375 100755 --- a/src/jalview/gui/SequenceFetcher.java +++ b/src/jalview/gui/SequenceFetcher.java @@ -366,7 +366,19 @@ public class SequenceFetcher extends JPanel implements Runnable jPanel1.add(close); jPanel3.add(jPanel2, java.awt.BorderLayout.CENTER); jPanel2.setLayout(borderLayout3); - databaseButt = database.getDatabaseSelectorButton(); + databaseButt = /*database.getDatabaseSelectorButton(); + final JButton viewdbs =*/new JButton( + MessageManager.getString("action.select_ddbb")); + databaseButt.addActionListener(new ActionListener() + { + + @Override + public void actionPerformed(ActionEvent arg0) + { + hidePanel(); + database.showDialog(); + } + }); databaseButt.setFont(JvSwingUtils.getLabelFont()); database.addActionListener(new ActionListener() { @@ -988,4 +1000,13 @@ public class SequenceFetcher extends JPanel implements Runnable { frame.setVisible(true); } + + /** + * Hide this panel (on clicking the database button to open the database + * chooser) + */ + void hidePanel() + { + frame.setVisible(false); + } } -- 1.7.10.2