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.FileFormatI;
32 import jalview.io.gff.SequenceOntologyI;
33 import jalview.util.DBRefUtils;
34 import jalview.util.MessageManager;
35 import jalview.util.Platform;
36 import jalview.ws.dbsources.das.api.DasSourceRegistryI;
37 import jalview.ws.seqfetcher.DbSourceProxy;
39 import java.awt.BorderLayout;
41 import java.awt.event.ActionEvent;
42 import java.awt.event.ActionListener;
43 import java.awt.event.KeyAdapter;
44 import java.awt.event.KeyEvent;
45 import java.util.ArrayList;
46 import java.util.Arrays;
47 import java.util.Collections;
48 import java.util.Iterator;
49 import java.util.List;
51 import javax.swing.JButton;
52 import javax.swing.JCheckBox;
53 import javax.swing.JInternalFrame;
54 import javax.swing.JLabel;
55 import javax.swing.JOptionPane;
56 import javax.swing.JPanel;
57 import javax.swing.JScrollPane;
58 import javax.swing.JTextArea;
59 import javax.swing.SwingConstants;
60 import javax.swing.tree.DefaultMutableTreeNode;
62 public class SequenceFetcher extends JPanel implements Runnable
64 JLabel dbeg = new JLabel();
66 JDatabaseTree database;
70 JLabel jLabel1 = new JLabel();
72 JCheckBox replacePunctuation = new JCheckBox();
74 JButton ok = new JButton();
76 JButton clear = new JButton();
78 JButton example = new JButton();
80 JButton close = new JButton();
82 JPanel jPanel1 = new JPanel();
84 JTextArea textArea = new JTextArea();
86 JScrollPane jScrollPane1 = new JScrollPane();
88 JPanel jPanel2 = new JPanel();
90 JPanel jPanel3 = new JPanel();
92 JPanel jPanel4 = new JPanel();
94 BorderLayout borderLayout1 = new BorderLayout();
96 BorderLayout borderLayout2 = new BorderLayout();
98 BorderLayout borderLayout3 = new BorderLayout();
100 JInternalFrame frame;
102 IProgressIndicator guiWindow;
104 AlignFrame alignFrame;
108 final String noDbSelected = "-- Select Database --";
110 private static jalview.ws.SequenceFetcher sfetch = null;
112 private static long lastDasSourceRegistry = -3;
114 private static DasSourceRegistryI dasRegistry = null;
116 private static boolean _initingFetcher = false;
118 private static Thread initingThread = null;
120 public JTextArea getTextArea()
126 * Blocking method that initialises and returns the shared instance of the
127 * SequenceFetcher client
130 * - where the initialisation delay message should be shown
131 * @return the singleton instance of the sequence fetcher client
133 public static jalview.ws.SequenceFetcher getSequenceFetcherSingleton(
134 final IProgressIndicator guiWindow)
136 if (_initingFetcher && initingThread != null && initingThread.isAlive())
138 if (guiWindow != null)
143 .getString("status.waiting_sequence_database_fetchers_init"),
144 Thread.currentThread().hashCode());
146 // initting happening on another thread - so wait around to see if it
148 while (_initingFetcher && initingThread != null
149 && initingThread.isAlive())
154 } catch (Exception e)
159 if (guiWindow != null)
164 .getString("status.waiting_sequence_database_fetchers_init"),
165 Thread.currentThread().hashCode());
169 || dasRegistry != Cache.getDasSourceRegistry()
170 || lastDasSourceRegistry != (Cache.getDasSourceRegistry()
171 .getDasRegistryURL() + Cache.getDasSourceRegistry()
172 .getLocalSourceString()).hashCode())
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 JvOptionPane.ERROR_MESSAGE);
249 // raise warning dialog
257 * blocking call which creates a new sequence fetcher panel, configures it and
258 * presses the OK button with the given database and query.
263 public static List<AlignFrame> fetchAndShow(String database, String query)
265 final SequenceFetcher sf = new SequenceFetcher(Desktop.instance,
267 while (sf._isConstructing)
272 } catch (Exception q)
274 return Collections.emptyList();
277 sf.newAlframes = new ArrayList<AlignFrame>();
279 return sf.newAlframes;
282 private class DatabaseAuthority extends DefaultMutableTreeNode
287 private class DatabaseSource extends DefaultMutableTreeNode
293 * initialise the database and query for this fetcher panel
296 * - string that should correspond to a sequence fetcher
298 * - string that will be entered in the query dialog
299 * @return true if UI was configured with valid database and query string
301 protected boolean setInitialQuery(String selectedDb, String queryString)
303 if (selectedDb == null || selectedDb.trim().length() == 0)
309 List<DbSourceProxy> sp = sfetch.getSourceProxy(selectedDb);
310 for (DbSourceProxy sourcep : sp)
312 if (sourcep.getTier() == 0)
314 database.selection = Arrays
315 .asList(new DbSourceProxy[] { sourcep });
319 if (database.selection == null || database.selection.size() == 0)
321 System.err.println("Ignoring fetch parameter db='" + selectedDb
325 textArea.setText(queryString);
326 } catch (Exception q)
328 System.err.println("Ignoring fetch parameter db='" + selectedDb
329 + "' and query='" + queryString + "'");
336 * called by thread spawned by constructor
342 private void initGui(IProgressIndicator guiWindow, String selectedDb,
345 this.guiWindow = guiWindow;
346 if (guiWindow instanceof AlignFrame)
348 alignFrame = (AlignFrame) guiWindow;
350 database = new JDatabaseTree(sfetch);
355 * configure the UI with any query parameters we were called with
357 if (!setInitialQuery(selectedDb, queryString))
360 * none provided, so show the database chooser
362 database.waitForInput();
364 } catch (Exception ex)
366 ex.printStackTrace();
369 frame = new JInternalFrame();
370 frame.setContentPane(this);
371 if (Platform.isAMac())
373 Desktop.addInternalFrame(frame, getFrameTitle(), false, 400, 240);
377 Desktop.addInternalFrame(frame, getFrameTitle(), false, 400, 180);
381 private String getFrameTitle()
383 return ((alignFrame == null) ? MessageManager
384 .getString("label.new_sequence_fetcher") : MessageManager
385 .getString("label.additional_sequence_fetcher"));
388 private void jbInit() throws Exception
390 this.setLayout(borderLayout2);
392 database.setFont(JvSwingUtils.getLabelFont());
393 dbeg.setFont(new java.awt.Font("Verdana", Font.BOLD, 11));
394 jLabel1.setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
395 jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
396 jLabel1.setText(MessageManager
397 .getString("label.separate_multiple_accession_ids"));
399 replacePunctuation.setHorizontalAlignment(SwingConstants.CENTER);
401 .setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
402 replacePunctuation.setText(MessageManager
403 .getString("label.replace_commas_semicolons"));
404 ok.setText(MessageManager.getString("action.ok"));
405 ok.addActionListener(new ActionListener()
408 public void actionPerformed(ActionEvent e)
410 ok_actionPerformed();
413 clear.setText(MessageManager.getString("action.clear"));
414 clear.addActionListener(new ActionListener()
417 public void actionPerformed(ActionEvent e)
419 clear_actionPerformed();
423 example.setText(MessageManager.getString("label.example"));
424 example.addActionListener(new ActionListener()
427 public void actionPerformed(ActionEvent e)
429 example_actionPerformed();
432 close.setText(MessageManager.getString("action.close"));
433 close.addActionListener(new ActionListener()
436 public void actionPerformed(ActionEvent e)
438 close_actionPerformed(e);
441 textArea.setFont(JvSwingUtils.getLabelFont());
442 textArea.setLineWrap(true);
443 textArea.addKeyListener(new KeyAdapter()
446 public void keyPressed(KeyEvent e)
448 if (e.getKeyCode() == KeyEvent.VK_ENTER)
450 ok_actionPerformed();
454 jPanel3.setLayout(borderLayout1);
455 borderLayout1.setVgap(5);
457 jPanel1.add(example);
460 jPanel2.setLayout(borderLayout3);
461 databaseButt = /*database.getDatabaseSelectorButton();
462 final JButton viewdbs =*/new JButton(
463 MessageManager.getString("action.select_ddbb"));
464 databaseButt.addActionListener(new ActionListener()
468 public void actionPerformed(ActionEvent arg0)
471 database.showDialog();
474 databaseButt.setFont(JvSwingUtils.getLabelFont());
475 database.addActionListener(new ActionListener()
478 public void actionPerformed(ActionEvent e)
480 String currentSelection = database.getSelectedItem();
481 if (currentSelection == null)
483 close_actionPerformed(null);
488 if ("pdb".equalsIgnoreCase(currentSelection))
492 else if ("uniprot".equalsIgnoreCase(currentSelection))
494 uniprotSourceAction();
500 database.action = -1;
505 jPanel2.add(databaseButt, java.awt.BorderLayout.NORTH);
506 jPanel2.add(dbeg, java.awt.BorderLayout.CENTER);
507 JPanel jPanel2a = new JPanel(new BorderLayout());
508 jPanel2a.add(jLabel1, java.awt.BorderLayout.NORTH);
509 jPanel2a.add(replacePunctuation, java.awt.BorderLayout.SOUTH);
510 jPanel2.add(jPanel2a, java.awt.BorderLayout.SOUTH);
511 // jPanel2.setPreferredSize(new Dimension())
512 jPanel3.add(jScrollPane1, java.awt.BorderLayout.CENTER);
513 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
514 this.add(jPanel3, java.awt.BorderLayout.CENTER);
515 this.add(jPanel2, java.awt.BorderLayout.NORTH);
516 jScrollPane1.getViewport().add(textArea);
519 private void pdbSourceAction()
521 databaseButt.setText(database.getSelectedItem());
522 new PDBFTSPanel(this);
526 private void uniprotSourceAction()
528 databaseButt.setText(database.getSelectedItem());
529 new UniprotFTSPanel(this);
533 private void otherSourceAction()
537 databaseButt.setText(database.getSelectedItem()
538 + (database.getSelectedSources().size() > 1 ? " (and "
539 + database.getSelectedSources().size() + " others)"
541 String eq = database.getExampleQueries();
542 dbeg.setText(MessageManager.formatMessage(
543 "label.example_query_param", new String[] { eq }));
544 boolean enablePunct = !(eq != null && eq.indexOf(",") > -1);
545 for (DbSourceProxy dbs : database.getSelectedSources())
547 if (dbs instanceof jalview.ws.dbsources.das.datamodel.DasSequenceSource)
553 replacePunctuation.setEnabled(enablePunct);
555 } catch (Exception ex)
558 replacePunctuation.setEnabled(true);
563 protected void example_actionPerformed()
565 DbSourceProxy db = null;
568 textArea.setText(database.getExampleQueries());
569 } catch (Exception ex)
575 protected void clear_actionPerformed()
577 textArea.setText("");
581 public void close_actionPerformed(ActionEvent e)
585 frame.setClosed(true);
586 } catch (Exception ex)
591 public void ok_actionPerformed()
593 databaseButt.setEnabled(false);
594 example.setEnabled(false);
595 textArea.setEnabled(false);
596 ok.setEnabled(false);
597 close.setEnabled(false);
599 Thread worker = new Thread(this);
603 private void resetDialog()
605 databaseButt.setEnabled(true);
606 example.setEnabled(true);
607 textArea.setEnabled(true);
609 close.setEnabled(true);
616 if (!database.hasSelection())
618 error += "Please select the source database\n";
620 // TODO: make this transformation more configurable
621 com.stevesoft.pat.Regex empty;
622 if (replacePunctuation.isEnabled() && replacePunctuation.isSelected())
624 empty = new com.stevesoft.pat.Regex(
625 // replace commas and spaces with a semicolon
626 "(\\s|[,; ])+", ";");
630 // just turn spaces and semicolons into single semicolons
631 empty = new com.stevesoft.pat.Regex("(\\s|[; ])+", ";");
633 textArea.setText(empty.replaceAll(textArea.getText()));
634 // see if there's anthing to search with
635 if (!new com.stevesoft.pat.Regex("[A-Za-z0-9_.]").search(textArea
638 error += "Please enter a (semi-colon separated list of) database id(s)";
640 if (error.length() > 0)
642 showErrorMessage(error);
646 // TODO: Refactor to GUI independent code and write tests.
647 // indicate if successive sources should be merged into one alignment.
648 boolean addToLast = false;
649 List<String> aresultq = new ArrayList<String>();
650 List<String> presultTitle = new ArrayList<String>();
651 List<AlignmentI> presult = new ArrayList<AlignmentI>();
652 List<AlignmentI> aresult = new ArrayList<AlignmentI>();
653 Iterator<DbSourceProxy> proxies = database.getSelectedSources()
656 List<String> nextFetch = Arrays.asList(qries = textArea.getText()
658 Iterator<String> en = Arrays.asList(new String[0]).iterator();
659 int nqueries = qries.length;
661 FeatureSettingsModelI preferredFeatureColours = null;
662 while (proxies.hasNext() && (en.hasNext() || nextFetch.size() > 0))
664 if (!en.hasNext() && nextFetch.size() > 0)
666 en = nextFetch.iterator();
667 nqueries = nextFetch.size();
668 // save the remaining queries in the original array
669 qries = nextFetch.toArray(new String[nqueries]);
670 nextFetch = new ArrayList<String>();
673 DbSourceProxy proxy = proxies.next();
678 .setProgressBar(MessageManager.formatMessage(
679 "status.fetching_sequence_queries_from",
681 Integer.valueOf(nqueries).toString(),
682 proxy.getDbName() }), Thread.currentThread()
684 if (proxy.getMaximumQueryCount() == 1)
687 * proxy only handles one accession id at a time
691 String acc = en.next();
692 if (!fetchSingleAccession(proxy, acc, aresultq, aresult))
701 * proxy can fetch multiple accessions at one time
703 fetchMultipleAccessions(proxy, en, aresultq, aresult, nextFetch);
705 } catch (Exception e)
707 showErrorMessage("Error retrieving " + textArea.getText()
708 + " from " + database.getSelectedItem());
710 // +="Couldn't retrieve sequences from "+database.getSelectedItem();
711 System.err.println("Retrieval failed for source ='"
712 + database.getSelectedItem() + "' and query\n'"
713 + textArea.getText() + "'\n");
715 } catch (OutOfMemoryError e)
717 showErrorMessage("Out of Memory when retrieving "
720 + database.getSelectedItem()
721 + "\nPlease see the Jalview FAQ for instructions for increasing the memory available to Jalview.\n");
725 showErrorMessage("Serious Error retrieving " + textArea.getText()
726 + " from " + database.getSelectedItem());
730 // Stack results ready for opening in alignment windows
731 if (aresult != null && aresult.size() > 0)
733 FeatureSettingsModelI proxyColourScheme = proxy
734 .getFeatureColourScheme();
735 if (proxyColourScheme != null)
737 preferredFeatureColours = proxyColourScheme;
740 AlignmentI ar = null;
741 if (proxy.isAlignmentSource())
744 // new window for each result
745 while (aresult.size() > 0)
747 presult.add(aresult.remove(0));
748 presultTitle.add(aresultq.remove(0) + " "
749 + getDefaultRetrievalTitle());
755 if (addToLast && presult.size() > 0)
757 ar = presult.remove(presult.size() - 1);
758 titl = presultTitle.remove(presultTitle.size() - 1);
760 // concatenate all results in one window
761 while (aresult.size() > 0)
765 ar = aresult.remove(0);
769 ar.append(aresult.remove(0));
774 presultTitle.add(titl);
777 guiWindow.setProgressBar(MessageManager
778 .getString("status.finshed_querying"), Thread.currentThread()
781 guiWindow.setProgressBar(
782 (presult.size() > 0) ? MessageManager
783 .getString("status.parsing_results") : MessageManager
784 .getString("status.processing"), Thread.currentThread()
787 while (presult.size() > 0)
789 parseResult(presult.remove(0), presultTitle.remove(0), null,
790 preferredFeatureColours);
792 // only remove visual delay after we finished parsing.
793 guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
794 if (nextFetch.size() > 0)
796 StringBuffer sb = new StringBuffer();
797 sb.append("Didn't retrieve the following "
798 + (nextFetch.size() == 1 ? "query" : nextFetch.size()
799 + " queries") + ": \n");
800 int l = sb.length(), lr = 0;
801 for (String s : nextFetch)
803 if (l != sb.length())
807 if (lr - sb.length() > 40)
813 showErrorMessage(sb.toString());
819 * Tries to fetch one or more accession ids from the database proxy
823 * the queries to fetch
825 * a successful queries list to add to
827 * a list of retrieved alignments to add to
829 * failed queries are added to this list
832 void fetchMultipleAccessions(DbSourceProxy proxy,
833 Iterator<String> accessions, List<String> aresultq,
834 List<AlignmentI> aresult, List<String> nextFetch)
837 StringBuilder multiacc = new StringBuilder();
838 List<String> tosend = new ArrayList<String>();
839 while (accessions.hasNext())
841 String nel = accessions.next();
843 multiacc.append(nel);
844 if (accessions.hasNext())
846 multiacc.append(proxy.getAccessionSeparator());
852 String query = multiacc.toString();
853 AlignmentI rslt = proxy.getSequenceRecords(query);
854 if (rslt == null || rslt.getHeight() == 0)
856 // no results - pass on all queries to next source
857 nextFetch.addAll(tosend);
863 if (tosend.size() > 1)
865 checkResultForQueries(rslt, tosend, nextFetch, proxy);
868 } catch (OutOfMemoryError oome)
870 new OOMWarning("fetching " + multiacc + " from "
871 + database.getSelectedItem(), oome, this);
876 * Query for a single accession id via the database proxy
881 * a list of successful queries to add to
883 * a list of retrieved alignments to add to
884 * @return true if the fetch was successful, else false
886 boolean fetchSingleAccession(DbSourceProxy proxy, String accession,
887 List<String> aresultq, List<AlignmentI> aresult)
889 boolean success = false;
896 // give the server a chance to breathe
898 } catch (Exception e)
904 AlignmentI indres = null;
907 indres = proxy.getSequenceRecords(accession);
908 } catch (OutOfMemoryError oome)
910 new OOMWarning("fetching " + accession + " from "
911 + proxy.getDbName(), oome, this);
915 aresultq.add(accession);
919 } catch (Exception e)
922 "Error retrieving " + accession + " from "
923 + proxy.getDbName(), e);
929 * Checks which of the queries were successfully retrieved by searching the
930 * DBRefs of the retrieved sequences for a match. Any not found are added to
931 * the 'nextFetch' list.
938 void checkResultForQueries(AlignmentI rslt, List<String> queries,
939 List<String> nextFetch, DbSourceProxy proxy)
941 SequenceI[] rs = rslt.getSequencesArray();
943 for (String q : queries)
945 DBRefEntry dbr = new DBRefEntry();
946 dbr.setSource(proxy.getDbSource());
947 dbr.setVersion(null);
948 String accId = proxy.getAccessionIdFromQuery(q);
949 dbr.setAccessionId(accId);
950 boolean rfound = false;
951 for (int r = 0; r < rs.length; r++)
955 List<DBRefEntry> found = DBRefUtils.searchRefs(rs[r].getDBRefs(),
957 if (!found.isEmpty())
973 * @return a standard title for any results retrieved using the currently
974 * selected source and settings
976 public String getDefaultRetrievalTitle()
978 return "Retrieved from " + database.getSelectedItem();
981 AlignmentI parseResult(AlignmentI al, String title,
982 FileFormatI currentFileFormat,
983 FeatureSettingsModelI preferredFeatureColours)
986 if (al != null && al.getHeight() > 0)
990 title = getDefaultRetrievalTitle();
992 if (alignFrame == null)
994 AlignFrame af = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
995 AlignFrame.DEFAULT_HEIGHT);
996 if (currentFileFormat != null)
998 af.currentFileFormat = currentFileFormat; // WHAT IS THE DEFAULT
1000 // NON-FormatAdapter Sourced
1004 SequenceFeature[] sfs = null;
1005 List<SequenceI> alsqs;
1006 synchronized (alsqs = al.getSequences())
1008 for (SequenceI sq : alsqs)
1010 if ((sfs = sq.getSequenceFeatures()) != null)
1014 af.setShowSeqFeatures(true);
1022 if (preferredFeatureColours != null)
1024 af.getViewport().applyFeaturesStyle(preferredFeatureColours);
1026 if (Cache.getDefault("HIDE_INTRONS", true))
1028 af.hideFeatureColumns(SequenceOntologyI.EXON, false);
1030 if (newAlframes != null)
1032 newAlframes.add(af);
1034 Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH,
1035 AlignFrame.DEFAULT_HEIGHT);
1037 af.statusBar.setText(MessageManager
1038 .getString("label.successfully_pasted_alignment_file"));
1042 af.setMaximum(Cache.getDefault("SHOW_FULLSCREEN", false));
1043 } catch (Exception ex)
1049 alignFrame.viewport.addAlignment(al, title);
1055 void showErrorMessage(final String error)
1058 javax.swing.SwingUtilities.invokeLater(new Runnable()
1063 JvOptionPane.showInternalMessageDialog(Desktop.desktop, error,
1064 MessageManager.getString("label.error_retrieving_data"),
1065 JvOptionPane.WARNING_MESSAGE);
1070 public IProgressIndicator getProgressIndicator()
1072 return progressIndicator;
1075 public void setProgressIndicator(IProgressIndicator progressIndicator)
1077 this.progressIndicator = progressIndicator;
1081 * Make this panel visible (after a selection has been made in the database
1086 frame.setVisible(true);
1090 * Hide this panel (on clicking the database button to open the database
1095 frame.setVisible(false);