2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.api.FeatureSettingsModelI;
24 import jalview.bin.Cache;
25 import jalview.datamodel.AlignmentI;
26 import jalview.datamodel.DBRefEntry;
27 import jalview.datamodel.SequenceFeature;
28 import jalview.datamodel.SequenceI;
29 import jalview.fts.service.pdb.PDBFTSPanel;
30 import jalview.fts.service.uniprot.UniprotFTSPanel;
31 import jalview.io.gff.SequenceOntologyI;
32 import jalview.util.DBRefUtils;
33 import jalview.util.MessageManager;
34 import jalview.util.Platform;
35 import jalview.ws.dbsources.das.api.DasSourceRegistryI;
36 import jalview.ws.seqfetcher.DbSourceProxy;
38 import java.awt.BorderLayout;
40 import java.awt.event.ActionEvent;
41 import java.awt.event.ActionListener;
42 import java.awt.event.KeyAdapter;
43 import java.awt.event.KeyEvent;
44 import java.util.ArrayList;
45 import java.util.Arrays;
46 import java.util.Collections;
47 import java.util.Iterator;
48 import java.util.List;
50 import javax.swing.JButton;
51 import javax.swing.JCheckBox;
52 import javax.swing.JInternalFrame;
53 import javax.swing.JLabel;
54 import javax.swing.JOptionPane;
55 import javax.swing.JPanel;
56 import javax.swing.JScrollPane;
57 import javax.swing.JTextArea;
58 import javax.swing.SwingConstants;
59 import javax.swing.tree.DefaultMutableTreeNode;
61 public class SequenceFetcher extends JPanel implements Runnable
63 JLabel dbeg = new JLabel();
65 JDatabaseTree database;
69 JLabel jLabel1 = new JLabel();
71 JCheckBox replacePunctuation = new JCheckBox();
73 JButton ok = new JButton();
75 JButton clear = new JButton();
77 JButton example = new JButton();
79 JButton close = new JButton();
81 JPanel jPanel1 = new JPanel();
83 JTextArea textArea = new JTextArea();
85 JScrollPane jScrollPane1 = new JScrollPane();
87 JPanel jPanel2 = new JPanel();
89 JPanel jPanel3 = new JPanel();
91 JPanel jPanel4 = new JPanel();
93 BorderLayout borderLayout1 = new BorderLayout();
95 BorderLayout borderLayout2 = new BorderLayout();
97 BorderLayout borderLayout3 = new BorderLayout();
101 IProgressIndicator guiWindow;
103 AlignFrame alignFrame;
107 final String noDbSelected = "-- Select Database --";
109 private static jalview.ws.SequenceFetcher sfetch = null;
111 private static long lastDasSourceRegistry = -3;
113 private static DasSourceRegistryI dasRegistry = null;
115 private static boolean _initingFetcher = false;
117 private static Thread initingThread = null;
119 public JTextArea getTextArea()
125 * Blocking method that initialises and returns the shared instance of the
126 * SequenceFetcher client
129 * - where the initialisation delay message should be shown
130 * @return the singleton instance of the sequence fetcher client
132 public static jalview.ws.SequenceFetcher getSequenceFetcherSingleton(
133 final IProgressIndicator guiWindow)
135 if (_initingFetcher && initingThread != null && initingThread.isAlive())
137 if (guiWindow != null)
142 .getString("status.waiting_sequence_database_fetchers_init"),
143 Thread.currentThread().hashCode());
145 // initting happening on another thread - so wait around to see if it
147 while (_initingFetcher && initingThread != null
148 && initingThread.isAlive())
153 } catch (Exception e)
158 if (guiWindow != null)
163 .getString("status.waiting_sequence_database_fetchers_init"),
164 Thread.currentThread().hashCode());
168 || dasRegistry != Cache.getDasSourceRegistry()
169 || lastDasSourceRegistry != (Cache.getDasSourceRegistry()
170 .getDasRegistryURL() + Cache
171 .getDasSourceRegistry().getLocalSourceString())
174 _initingFetcher = true;
175 initingThread = Thread.currentThread();
177 * give a visual indication that sequence fetcher construction is occuring
179 if (guiWindow != null)
181 guiWindow.setProgressBar(MessageManager
182 .getString("status.init_sequence_database_fetchers"),
183 Thread.currentThread().hashCode());
185 dasRegistry = Cache.getDasSourceRegistry();
186 dasRegistry.refreshSources();
188 jalview.ws.SequenceFetcher sf = new jalview.ws.SequenceFetcher();
189 if (guiWindow != null)
191 guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
193 lastDasSourceRegistry = (dasRegistry.getDasRegistryURL() + dasRegistry
194 .getLocalSourceString()).hashCode();
196 _initingFetcher = false;
197 initingThread = null;
202 private IProgressIndicator progressIndicator;
204 private volatile boolean _isConstructing = false;
206 private List<AlignFrame> newAlframes = null;
208 public SequenceFetcher(IProgressIndicator guiIndic)
210 this(guiIndic, null, null);
213 public SequenceFetcher(IProgressIndicator guiIndic,
214 final String selectedDb, final String queryString)
216 this._isConstructing=true;
217 this.progressIndicator = guiIndic;
218 final SequenceFetcher us = this;
219 // launch initialiser thread
220 Thread sf = new Thread(new Runnable()
226 if (getSequenceFetcherSingleton(progressIndicator) != null)
228 us.initGui(progressIndicator, selectedDb, queryString);
229 us._isConstructing=false;
233 javax.swing.SwingUtilities.invokeLater(new Runnable()
239 .showInternalMessageDialog(
242 .getString("warn.couldnt_create_sequence_fetcher_client"),
244 .getString("label.couldnt_create_sequence_fetcher"),
245 JOptionPane.ERROR_MESSAGE);
249 // raise warning dialog
256 * blocking call which creates a new sequence fetcher panel, configures it and presses the OK button with the given database and query.
260 public static List<AlignFrame> fetchAndShow(String database, String query)
262 final SequenceFetcher sf = new SequenceFetcher(Desktop.instance, database, query);
263 while (sf._isConstructing)
265 try { Thread.sleep(50);
266 } catch (Exception q)
268 return Collections.emptyList();
271 sf.newAlframes = new ArrayList<AlignFrame>();
273 return sf.newAlframes;
276 private class DatabaseAuthority extends DefaultMutableTreeNode
281 private class DatabaseSource extends DefaultMutableTreeNode
287 * initialise the database and query for this fetcher panel
290 * - string that should correspond to a sequence fetcher
292 * - string that will be entered in the query dialog
293 * @return true if UI was configured with valid database and query string
295 protected boolean setInitialQuery(String selectedDb, String queryString)
297 if (selectedDb == null || selectedDb.trim().length() == 0)
303 List<DbSourceProxy> sp = sfetch.getSourceProxy(selectedDb);
304 for (DbSourceProxy sourcep : sp)
306 if (sourcep.getTier() == 0)
308 database.selection = Arrays
309 .asList(new DbSourceProxy[] { sourcep });
313 if (database.selection == null || database.selection.size() == 0)
315 System.err.println("Ignoring fetch parameter db='" + selectedDb
319 textArea.setText(queryString);
320 } catch (Exception q)
322 System.err.println("Ignoring fetch parameter db='" + selectedDb
323 + "' and query='" + queryString + "'");
330 * called by thread spawned by constructor
336 private void initGui(IProgressIndicator guiWindow, String selectedDb,
339 this.guiWindow = guiWindow;
340 if (guiWindow instanceof AlignFrame)
342 alignFrame = (AlignFrame) guiWindow;
344 database = new JDatabaseTree(sfetch);
349 * configure the UI with any query parameters we were called with
351 if (!setInitialQuery(selectedDb, queryString))
354 * none provided, so show the database chooser
356 database.waitForInput();
358 } catch (Exception ex)
360 ex.printStackTrace();
363 frame = new JInternalFrame();
364 frame.setContentPane(this);
365 if (Platform.isAMac())
367 Desktop.addInternalFrame(frame, getFrameTitle(), false, 400, 240);
371 Desktop.addInternalFrame(frame, getFrameTitle(), false, 400, 180);
375 private String getFrameTitle()
377 return ((alignFrame == null) ? MessageManager
378 .getString("label.new_sequence_fetcher") : MessageManager
379 .getString("label.additional_sequence_fetcher"));
382 private void jbInit() throws Exception
384 this.setLayout(borderLayout2);
386 database.setFont(JvSwingUtils.getLabelFont());
387 dbeg.setFont(new java.awt.Font("Verdana", Font.BOLD, 11));
388 jLabel1.setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
389 jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
390 jLabel1.setText(MessageManager
391 .getString("label.separate_multiple_accession_ids"));
393 replacePunctuation.setHorizontalAlignment(SwingConstants.CENTER);
395 .setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
396 replacePunctuation.setText(MessageManager
397 .getString("label.replace_commas_semicolons"));
398 ok.setText(MessageManager.getString("action.ok"));
399 ok.addActionListener(new ActionListener()
402 public void actionPerformed(ActionEvent e)
404 ok_actionPerformed();
407 clear.setText(MessageManager.getString("action.clear"));
408 clear.addActionListener(new ActionListener()
411 public void actionPerformed(ActionEvent e)
413 clear_actionPerformed();
417 example.setText(MessageManager.getString("label.example"));
418 example.addActionListener(new ActionListener()
421 public void actionPerformed(ActionEvent e)
423 example_actionPerformed();
426 close.setText(MessageManager.getString("action.close"));
427 close.addActionListener(new ActionListener()
430 public void actionPerformed(ActionEvent e)
432 close_actionPerformed(e);
435 textArea.setFont(JvSwingUtils.getLabelFont());
436 textArea.setLineWrap(true);
437 textArea.addKeyListener(new KeyAdapter()
440 public void keyPressed(KeyEvent e)
442 if (e.getKeyCode() == KeyEvent.VK_ENTER)
444 ok_actionPerformed();
448 jPanel3.setLayout(borderLayout1);
449 borderLayout1.setVgap(5);
451 jPanel1.add(example);
454 jPanel2.setLayout(borderLayout3);
455 databaseButt = /*database.getDatabaseSelectorButton();
456 final JButton viewdbs =*/new JButton(
457 MessageManager.getString("action.select_ddbb"));
458 databaseButt.addActionListener(new ActionListener()
462 public void actionPerformed(ActionEvent arg0)
465 database.showDialog();
468 databaseButt.setFont(JvSwingUtils.getLabelFont());
469 database.addActionListener(new ActionListener()
472 public void actionPerformed(ActionEvent e)
474 String currentSelection = database.getSelectedItem();
475 if (currentSelection == null)
477 close_actionPerformed(null);
482 if ("pdb".equalsIgnoreCase(currentSelection))
486 else if ("uniprot".equalsIgnoreCase(currentSelection))
488 uniprotSourceAction();
494 database.action = -1;
499 jPanel2.add(databaseButt, java.awt.BorderLayout.NORTH);
500 jPanel2.add(dbeg, java.awt.BorderLayout.CENTER);
501 JPanel jPanel2a = new JPanel(new BorderLayout());
502 jPanel2a.add(jLabel1, java.awt.BorderLayout.NORTH);
503 jPanel2a.add(replacePunctuation, java.awt.BorderLayout.SOUTH);
504 jPanel2.add(jPanel2a, java.awt.BorderLayout.SOUTH);
505 // jPanel2.setPreferredSize(new Dimension())
506 jPanel3.add(jScrollPane1, java.awt.BorderLayout.CENTER);
507 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
508 this.add(jPanel3, java.awt.BorderLayout.CENTER);
509 this.add(jPanel2, java.awt.BorderLayout.NORTH);
510 jScrollPane1.getViewport().add(textArea);
513 private void pdbSourceAction()
515 databaseButt.setText(database.getSelectedItem());
516 new PDBFTSPanel(this);
520 private void uniprotSourceAction()
522 databaseButt.setText(database.getSelectedItem());
523 new UniprotFTSPanel(this);
526 private void otherSourceAction()
530 databaseButt.setText(database.getSelectedItem()
531 + (database.getSelectedSources().size() > 1 ? " (and "
532 + database.getSelectedSources().size() + " others)"
534 String eq = database.getExampleQueries();
535 dbeg.setText(MessageManager.formatMessage(
536 "label.example_query_param", new String[] { eq }));
537 boolean enablePunct = !(eq != null && eq.indexOf(",") > -1);
538 for (DbSourceProxy dbs : database.getSelectedSources())
540 if (dbs instanceof jalview.ws.dbsources.das.datamodel.DasSequenceSource)
546 replacePunctuation.setEnabled(enablePunct);
548 } catch (Exception ex)
551 replacePunctuation.setEnabled(true);
556 protected void example_actionPerformed()
558 DbSourceProxy db = null;
561 textArea.setText(database.getExampleQueries());
562 } catch (Exception ex)
568 protected void clear_actionPerformed()
570 textArea.setText("");
574 public void close_actionPerformed(ActionEvent e)
578 frame.setClosed(true);
579 } catch (Exception ex)
584 public void ok_actionPerformed()
586 databaseButt.setEnabled(false);
587 example.setEnabled(false);
588 textArea.setEnabled(false);
589 ok.setEnabled(false);
590 close.setEnabled(false);
592 Thread worker = new Thread(this);
596 private void resetDialog()
598 databaseButt.setEnabled(true);
599 example.setEnabled(true);
600 textArea.setEnabled(true);
602 close.setEnabled(true);
609 if (!database.hasSelection())
611 error += "Please select the source database\n";
613 // TODO: make this transformation more configurable
614 com.stevesoft.pat.Regex empty;
615 if (replacePunctuation.isEnabled() && replacePunctuation.isSelected())
617 empty = new com.stevesoft.pat.Regex(
618 // replace commas and spaces with a semicolon
619 "(\\s|[,; ])+", ";");
623 // just turn spaces and semicolons into single semicolons
624 empty = new com.stevesoft.pat.Regex("(\\s|[; ])+", ";");
626 textArea.setText(empty.replaceAll(textArea.getText()));
627 // see if there's anthing to search with
628 if (!new com.stevesoft.pat.Regex("[A-Za-z0-9_.]").search(textArea
631 error += "Please enter a (semi-colon separated list of) database id(s)";
633 if (error.length() > 0)
635 showErrorMessage(error);
639 // TODO: Refactor to GUI independent code and write tests.
640 // indicate if successive sources should be merged into one alignment.
641 boolean addToLast = false;
642 List<String> aresultq = new ArrayList<String>();
643 List<String> presultTitle = new ArrayList<String>();
644 List<AlignmentI> presult = new ArrayList<AlignmentI>();
645 List<AlignmentI> aresult = new ArrayList<AlignmentI>();
646 Iterator<DbSourceProxy> proxies = database.getSelectedSources()
649 List<String> nextFetch = Arrays.asList(qries = textArea.getText()
651 Iterator<String> en = Arrays.asList(new String[0]).iterator();
652 int nqueries = qries.length;
654 FeatureSettingsModelI preferredFeatureColours = null;
655 while (proxies.hasNext() && (en.hasNext() || nextFetch.size() > 0))
657 if (!en.hasNext() && nextFetch.size() > 0)
659 en = nextFetch.iterator();
660 nqueries = nextFetch.size();
661 // save the remaining queries in the original array
662 qries = nextFetch.toArray(new String[nqueries]);
663 nextFetch = new ArrayList<String>();
666 DbSourceProxy proxy = proxies.next();
671 .setProgressBar(MessageManager.formatMessage(
672 "status.fetching_sequence_queries_from",
674 Integer.valueOf(nqueries).toString(),
675 proxy.getDbName() }), Thread.currentThread()
677 if (proxy.getMaximumQueryCount() == 1)
680 * proxy only handles one accession id at a time
684 String acc = en.next();
685 if (!fetchSingleAccession(proxy, acc, aresultq, aresult))
694 * proxy can fetch multiple accessions at one time
696 fetchMultipleAccessions(proxy, en, aresultq, aresult, nextFetch);
698 } catch (Exception e)
700 showErrorMessage("Error retrieving " + textArea.getText()
701 + " from " + database.getSelectedItem());
703 // +="Couldn't retrieve sequences from "+database.getSelectedItem();
704 System.err.println("Retrieval failed for source ='"
705 + database.getSelectedItem() + "' and query\n'"
706 + textArea.getText() + "'\n");
708 } catch (OutOfMemoryError e)
710 showErrorMessage("Out of Memory when retrieving "
713 + database.getSelectedItem()
714 + "\nPlease see the Jalview FAQ for instructions for increasing the memory available to Jalview.\n");
718 showErrorMessage("Serious Error retrieving " + textArea.getText()
719 + " from " + database.getSelectedItem());
723 // Stack results ready for opening in alignment windows
724 if (aresult != null && aresult.size() > 0)
726 FeatureSettingsModelI proxyColourScheme = proxy
727 .getFeatureColourScheme();
728 if (proxyColourScheme != null)
730 preferredFeatureColours = proxyColourScheme;
733 AlignmentI ar = null;
734 if (proxy.isAlignmentSource())
737 // new window for each result
738 while (aresult.size() > 0)
740 presult.add(aresult.remove(0));
741 presultTitle.add(aresultq.remove(0) + " "
742 + getDefaultRetrievalTitle());
748 if (addToLast && presult.size() > 0)
750 ar = presult.remove(presult.size() - 1);
751 titl = presultTitle.remove(presultTitle.size() - 1);
753 // concatenate all results in one window
754 while (aresult.size() > 0)
758 ar = aresult.remove(0);
762 ar.append(aresult.remove(0));
767 presultTitle.add(titl);
770 guiWindow.setProgressBar(MessageManager
771 .getString("status.finshed_querying"), Thread.currentThread()
774 guiWindow.setProgressBar(
775 (presult.size() > 0) ? MessageManager
776 .getString("status.parsing_results") : MessageManager
777 .getString("status.processing"), Thread.currentThread()
780 while (presult.size() > 0)
782 parseResult(presult.remove(0), presultTitle.remove(0), null,
783 preferredFeatureColours);
785 // only remove visual delay after we finished parsing.
786 guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
787 if (nextFetch.size() > 0)
789 StringBuffer sb = new StringBuffer();
790 sb.append("Didn't retrieve the following "
791 + (nextFetch.size() == 1 ? "query" : nextFetch.size()
792 + " queries") + ": \n");
793 int l = sb.length(), lr = 0;
794 for (String s : nextFetch)
796 if (l != sb.length())
800 if (lr - sb.length() > 40)
806 showErrorMessage(sb.toString());
812 * Tries to fetch one or more accession ids from the database proxy
816 * the queries to fetch
818 * a successful queries list to add to
820 * a list of retrieved alignments to add to
822 * failed queries are added to this list
825 void fetchMultipleAccessions(DbSourceProxy proxy,
826 Iterator<String> accessions, List<String> aresultq,
827 List<AlignmentI> aresult, List<String> nextFetch)
830 StringBuilder multiacc = new StringBuilder();
831 List<String> tosend = new ArrayList<String>();
832 while (accessions.hasNext())
834 String nel = accessions.next();
836 multiacc.append(nel);
837 if (accessions.hasNext())
839 multiacc.append(proxy.getAccessionSeparator());
845 String query = multiacc.toString();
846 AlignmentI rslt = proxy.getSequenceRecords(query);
847 if (rslt == null || rslt.getHeight() == 0)
849 // no results - pass on all queries to next source
850 nextFetch.addAll(tosend);
856 if (tosend.size() > 1)
858 checkResultForQueries(rslt, tosend, nextFetch, proxy);
861 } catch (OutOfMemoryError oome)
863 new OOMWarning("fetching " + multiacc + " from "
864 + database.getSelectedItem(), oome, this);
869 * Query for a single accession id via the database proxy
874 * a list of successful queries to add to
876 * a list of retrieved alignments to add to
877 * @return true if the fetch was successful, else false
879 boolean fetchSingleAccession(DbSourceProxy proxy, String accession,
880 List<String> aresultq, List<AlignmentI> aresult)
882 boolean success = false;
889 // give the server a chance to breathe
891 } catch (Exception e)
897 AlignmentI indres = null;
900 indres = proxy.getSequenceRecords(accession);
901 } catch (OutOfMemoryError oome)
903 new OOMWarning("fetching " + accession + " from "
904 + proxy.getDbName(), oome, this);
908 aresultq.add(accession);
912 } catch (Exception e)
915 "Error retrieving " + accession
916 + " from " + proxy.getDbName(), e);
922 * Checks which of the queries were successfully retrieved by searching the
923 * DBRefs of the retrieved sequences for a match. Any not found are added to
924 * the 'nextFetch' list.
931 void checkResultForQueries(AlignmentI rslt, List<String> queries,
932 List<String> nextFetch, DbSourceProxy proxy)
934 SequenceI[] rs = rslt.getSequencesArray();
936 for (String q : queries)
938 DBRefEntry dbr = new DBRefEntry();
939 dbr.setSource(proxy.getDbSource());
940 dbr.setVersion(null);
941 String accId = proxy.getAccessionIdFromQuery(q);
942 dbr.setAccessionId(accId);
943 boolean rfound = false;
944 for (int r = 0; r < rs.length; r++)
948 List<DBRefEntry> found = DBRefUtils.searchRefs(rs[r].getDBRefs(),
950 if (!found.isEmpty())
966 * @return a standard title for any results retrieved using the currently
967 * selected source and settings
969 public String getDefaultRetrievalTitle()
971 return "Retrieved from " + database.getSelectedItem();
974 AlignmentI parseResult(AlignmentI al, String title,
975 String currentFileFormat,
976 FeatureSettingsModelI preferredFeatureColours)
979 if (al != null && al.getHeight() > 0)
983 title = getDefaultRetrievalTitle();
985 if (alignFrame == null)
987 AlignFrame af = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
988 AlignFrame.DEFAULT_HEIGHT);
989 if (currentFileFormat != null)
991 af.currentFileFormat = currentFileFormat; // WHAT IS THE DEFAULT
993 // NON-FormatAdapter Sourced
997 SequenceFeature[] sfs = null;
998 List<SequenceI> alsqs;
999 synchronized (alsqs = al.getSequences())
1001 for (SequenceI sq : alsqs)
1003 if ((sfs = sq.getSequenceFeatures()) != null)
1007 af.setShowSeqFeatures(true);
1015 if (preferredFeatureColours != null)
1017 af.getViewport().applyFeaturesStyle(preferredFeatureColours);
1019 if (Cache.getDefault("HIDE_INTRONS", true))
1021 af.hideFeatureColumns(SequenceOntologyI.EXON, false);
1023 if (newAlframes != null)
1025 newAlframes.add(af);
1027 Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH,
1028 AlignFrame.DEFAULT_HEIGHT);
1030 af.statusBar.setText(MessageManager
1031 .getString("label.successfully_pasted_alignment_file"));
1035 af.setMaximum(Cache.getDefault("SHOW_FULLSCREEN",
1037 } catch (Exception ex)
1043 alignFrame.viewport.addAlignment(al, title);
1049 void showErrorMessage(final String error)
1052 javax.swing.SwingUtilities.invokeLater(new Runnable()
1057 JOptionPane.showInternalMessageDialog(Desktop.desktop, error,
1058 MessageManager.getString("label.error_retrieving_data"),
1059 JOptionPane.WARNING_MESSAGE);
1064 public IProgressIndicator getProgressIndicator()
1066 return progressIndicator;
1069 public void setProgressIndicator(IProgressIndicator progressIndicator)
1071 this.progressIndicator = progressIndicator;
1075 * Make this panel visible (after a selection has been made in the database
1080 frame.setVisible(true);
1084 * Hide this panel (on clicking the database button to open the database
1089 frame.setVisible(false);