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.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.getDasSourceRegistry()
171 .getLocalSourceString()).hashCode())
173 _initingFetcher = true;
174 initingThread = Thread.currentThread();
176 * give a visual indication that sequence fetcher construction is occuring
178 if (guiWindow != null)
180 guiWindow.setProgressBar(MessageManager
181 .getString("status.init_sequence_database_fetchers"),
182 Thread.currentThread().hashCode());
184 dasRegistry = Cache.getDasSourceRegistry();
185 dasRegistry.refreshSources();
187 jalview.ws.SequenceFetcher sf = new jalview.ws.SequenceFetcher();
188 if (guiWindow != null)
190 guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
192 lastDasSourceRegistry = (dasRegistry.getDasRegistryURL() + dasRegistry
193 .getLocalSourceString()).hashCode();
195 _initingFetcher = false;
196 initingThread = null;
201 private IProgressIndicator progressIndicator;
203 private volatile boolean _isConstructing = false;
205 private List<AlignFrame> newAlframes = null;
207 public SequenceFetcher(IProgressIndicator guiIndic)
209 this(guiIndic, null, null);
212 public SequenceFetcher(IProgressIndicator guiIndic,
213 final String selectedDb, final String queryString)
215 this._isConstructing = true;
216 this.progressIndicator = guiIndic;
217 final SequenceFetcher us = this;
218 // launch initialiser thread
219 Thread sf = new Thread(new Runnable()
225 if (getSequenceFetcherSingleton(progressIndicator) != null)
227 us.initGui(progressIndicator, selectedDb, queryString);
228 us._isConstructing = false;
232 javax.swing.SwingUtilities.invokeLater(new Runnable()
238 .showInternalMessageDialog(
241 .getString("warn.couldnt_create_sequence_fetcher_client"),
243 .getString("label.couldnt_create_sequence_fetcher"),
244 JvOptionPane.ERROR_MESSAGE);
248 // raise warning dialog
256 * blocking call which creates a new sequence fetcher panel, configures it and
257 * presses the OK button with the given database and query.
262 public static List<AlignFrame> fetchAndShow(String database, String query)
264 final SequenceFetcher sf = new SequenceFetcher(Desktop.instance,
266 while (sf._isConstructing)
271 } catch (Exception q)
273 return Collections.emptyList();
276 sf.newAlframes = new ArrayList<AlignFrame>();
278 return sf.newAlframes;
281 private class DatabaseAuthority extends DefaultMutableTreeNode
286 private class DatabaseSource extends DefaultMutableTreeNode
292 * initialise the database and query for this fetcher panel
295 * - string that should correspond to a sequence fetcher
297 * - string that will be entered in the query dialog
298 * @return true if UI was configured with valid database and query string
300 protected boolean setInitialQuery(String selectedDb, String queryString)
302 if (selectedDb == null || selectedDb.trim().length() == 0)
308 List<DbSourceProxy> sp = sfetch.getSourceProxy(selectedDb);
309 for (DbSourceProxy sourcep : sp)
311 if (sourcep.getTier() == 0)
313 database.selection = Arrays
314 .asList(new DbSourceProxy[] { sourcep });
318 if (database.selection == null || database.selection.size() == 0)
320 System.err.println("Ignoring fetch parameter db='" + selectedDb
324 textArea.setText(queryString);
325 } catch (Exception q)
327 System.err.println("Ignoring fetch parameter db='" + selectedDb
328 + "' and query='" + queryString + "'");
335 * called by thread spawned by constructor
341 private void initGui(IProgressIndicator guiWindow, String selectedDb,
344 this.guiWindow = guiWindow;
345 if (guiWindow instanceof AlignFrame)
347 alignFrame = (AlignFrame) guiWindow;
349 database = new JDatabaseTree(sfetch);
354 * configure the UI with any query parameters we were called with
356 if (!setInitialQuery(selectedDb, queryString))
359 * none provided, so show the database chooser
361 database.waitForInput();
363 } catch (Exception ex)
365 ex.printStackTrace();
368 frame = new JInternalFrame();
369 frame.setContentPane(this);
370 if (Platform.isAMac())
372 Desktop.addInternalFrame(frame, getFrameTitle(), false, 400, 240);
376 Desktop.addInternalFrame(frame, getFrameTitle(), false, 400, 180);
380 private String getFrameTitle()
382 return ((alignFrame == null) ? MessageManager
383 .getString("label.new_sequence_fetcher") : MessageManager
384 .getString("label.additional_sequence_fetcher"));
387 private void jbInit() throws Exception
389 this.setLayout(borderLayout2);
391 database.setFont(JvSwingUtils.getLabelFont());
392 dbeg.setFont(new java.awt.Font("Verdana", Font.BOLD, 11));
393 jLabel1.setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
394 jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
395 jLabel1.setText(MessageManager
396 .getString("label.separate_multiple_accession_ids"));
398 replacePunctuation.setHorizontalAlignment(SwingConstants.CENTER);
400 .setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
401 replacePunctuation.setText(MessageManager
402 .getString("label.replace_commas_semicolons"));
403 ok.setText(MessageManager.getString("action.ok"));
404 ok.addActionListener(new ActionListener()
407 public void actionPerformed(ActionEvent e)
409 ok_actionPerformed();
412 clear.setText(MessageManager.getString("action.clear"));
413 clear.addActionListener(new ActionListener()
416 public void actionPerformed(ActionEvent e)
418 clear_actionPerformed();
422 example.setText(MessageManager.getString("label.example"));
423 example.addActionListener(new ActionListener()
426 public void actionPerformed(ActionEvent e)
428 example_actionPerformed();
431 close.setText(MessageManager.getString("action.close"));
432 close.addActionListener(new ActionListener()
435 public void actionPerformed(ActionEvent e)
437 close_actionPerformed(e);
440 textArea.setFont(JvSwingUtils.getLabelFont());
441 textArea.setLineWrap(true);
442 textArea.addKeyListener(new KeyAdapter()
445 public void keyPressed(KeyEvent e)
447 if (e.getKeyCode() == KeyEvent.VK_ENTER)
449 ok_actionPerformed();
453 jPanel3.setLayout(borderLayout1);
454 borderLayout1.setVgap(5);
456 jPanel1.add(example);
459 jPanel2.setLayout(borderLayout3);
460 databaseButt = /*database.getDatabaseSelectorButton();
461 final JButton viewdbs =*/new JButton(
462 MessageManager.getString("action.select_ddbb"));
463 databaseButt.addActionListener(new ActionListener()
467 public void actionPerformed(ActionEvent arg0)
470 database.showDialog();
473 databaseButt.setFont(JvSwingUtils.getLabelFont());
474 database.addActionListener(new ActionListener()
477 public void actionPerformed(ActionEvent e)
479 String currentSelection = database.getSelectedItem();
480 if (currentSelection == null)
482 close_actionPerformed(null);
487 if ("pdb".equalsIgnoreCase(currentSelection))
491 else if ("uniprot".equalsIgnoreCase(currentSelection))
493 uniprotSourceAction();
499 database.action = -1;
504 jPanel2.add(databaseButt, java.awt.BorderLayout.NORTH);
505 jPanel2.add(dbeg, java.awt.BorderLayout.CENTER);
506 JPanel jPanel2a = new JPanel(new BorderLayout());
507 jPanel2a.add(jLabel1, java.awt.BorderLayout.NORTH);
508 jPanel2a.add(replacePunctuation, java.awt.BorderLayout.SOUTH);
509 jPanel2.add(jPanel2a, java.awt.BorderLayout.SOUTH);
510 // jPanel2.setPreferredSize(new Dimension())
511 jPanel3.add(jScrollPane1, java.awt.BorderLayout.CENTER);
512 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
513 this.add(jPanel3, java.awt.BorderLayout.CENTER);
514 this.add(jPanel2, java.awt.BorderLayout.NORTH);
515 jScrollPane1.getViewport().add(textArea);
518 private void pdbSourceAction()
520 databaseButt.setText(database.getSelectedItem());
521 new PDBFTSPanel(this);
525 private void uniprotSourceAction()
527 databaseButt.setText(database.getSelectedItem());
528 new UniprotFTSPanel(this);
532 private void otherSourceAction()
536 databaseButt.setText(database.getSelectedItem()
537 + (database.getSelectedSources().size() > 1 ? " (and "
538 + database.getSelectedSources().size() + " others)"
540 String eq = database.getExampleQueries();
541 dbeg.setText(MessageManager.formatMessage(
542 "label.example_query_param", new String[] { eq }));
543 boolean enablePunct = !(eq != null && eq.indexOf(",") > -1);
544 for (DbSourceProxy dbs : database.getSelectedSources())
546 if (dbs instanceof jalview.ws.dbsources.das.datamodel.DasSequenceSource)
552 replacePunctuation.setEnabled(enablePunct);
554 } catch (Exception ex)
557 replacePunctuation.setEnabled(true);
562 protected void example_actionPerformed()
564 DbSourceProxy db = null;
567 textArea.setText(database.getExampleQueries());
568 } catch (Exception ex)
574 protected void clear_actionPerformed()
576 textArea.setText("");
580 public void close_actionPerformed(ActionEvent e)
584 frame.setClosed(true);
585 } catch (Exception ex)
590 public void ok_actionPerformed()
592 databaseButt.setEnabled(false);
593 example.setEnabled(false);
594 textArea.setEnabled(false);
595 ok.setEnabled(false);
596 close.setEnabled(false);
598 Thread worker = new Thread(this);
602 private void resetDialog()
604 databaseButt.setEnabled(true);
605 example.setEnabled(true);
606 textArea.setEnabled(true);
608 close.setEnabled(true);
615 if (!database.hasSelection())
617 error += "Please select the source database\n";
619 // TODO: make this transformation more configurable
620 com.stevesoft.pat.Regex empty;
621 if (replacePunctuation.isEnabled() && replacePunctuation.isSelected())
623 empty = new com.stevesoft.pat.Regex(
624 // replace commas and spaces with a semicolon
625 "(\\s|[,; ])+", ";");
629 // just turn spaces and semicolons into single semicolons
630 empty = new com.stevesoft.pat.Regex("(\\s|[; ])+", ";");
632 textArea.setText(empty.replaceAll(textArea.getText()));
633 // see if there's anthing to search with
634 if (!new com.stevesoft.pat.Regex("[A-Za-z0-9_.]").search(textArea
637 error += "Please enter a (semi-colon separated list of) database id(s)";
639 if (error.length() > 0)
641 showErrorMessage(error);
645 // TODO: Refactor to GUI independent code and write tests.
646 // indicate if successive sources should be merged into one alignment.
647 boolean addToLast = false;
648 List<String> aresultq = new ArrayList<String>();
649 List<String> presultTitle = new ArrayList<String>();
650 List<AlignmentI> presult = new ArrayList<AlignmentI>();
651 List<AlignmentI> aresult = new ArrayList<AlignmentI>();
652 Iterator<DbSourceProxy> proxies = database.getSelectedSources()
655 List<String> nextFetch = Arrays.asList(qries = textArea.getText()
657 Iterator<String> en = Arrays.asList(new String[0]).iterator();
658 int nqueries = qries.length;
660 FeatureSettingsModelI preferredFeatureColours = null;
661 while (proxies.hasNext() && (en.hasNext() || nextFetch.size() > 0))
663 if (!en.hasNext() && nextFetch.size() > 0)
665 en = nextFetch.iterator();
666 nqueries = nextFetch.size();
667 // save the remaining queries in the original array
668 qries = nextFetch.toArray(new String[nqueries]);
669 nextFetch = new ArrayList<String>();
672 DbSourceProxy proxy = proxies.next();
677 .setProgressBar(MessageManager.formatMessage(
678 "status.fetching_sequence_queries_from",
680 Integer.valueOf(nqueries).toString(),
681 proxy.getDbName() }), Thread.currentThread()
683 if (proxy.getMaximumQueryCount() == 1)
686 * proxy only handles one accession id at a time
690 String acc = en.next();
691 if (!fetchSingleAccession(proxy, acc, aresultq, aresult))
700 * proxy can fetch multiple accessions at one time
702 fetchMultipleAccessions(proxy, en, aresultq, aresult, nextFetch);
704 } catch (Exception e)
706 showErrorMessage("Error retrieving " + textArea.getText()
707 + " from " + database.getSelectedItem());
709 // +="Couldn't retrieve sequences from "+database.getSelectedItem();
710 System.err.println("Retrieval failed for source ='"
711 + database.getSelectedItem() + "' and query\n'"
712 + textArea.getText() + "'\n");
714 } catch (OutOfMemoryError e)
716 showErrorMessage("Out of Memory when retrieving "
719 + database.getSelectedItem()
720 + "\nPlease see the Jalview FAQ for instructions for increasing the memory available to Jalview.\n");
724 showErrorMessage("Serious Error retrieving " + textArea.getText()
725 + " from " + database.getSelectedItem());
729 // Stack results ready for opening in alignment windows
730 if (aresult != null && aresult.size() > 0)
732 FeatureSettingsModelI proxyColourScheme = proxy
733 .getFeatureColourScheme();
734 if (proxyColourScheme != null)
736 preferredFeatureColours = proxyColourScheme;
739 AlignmentI ar = null;
740 if (proxy.isAlignmentSource())
743 // new window for each result
744 while (aresult.size() > 0)
746 presult.add(aresult.remove(0));
747 presultTitle.add(aresultq.remove(0) + " "
748 + getDefaultRetrievalTitle());
754 if (addToLast && presult.size() > 0)
756 ar = presult.remove(presult.size() - 1);
757 titl = presultTitle.remove(presultTitle.size() - 1);
759 // concatenate all results in one window
760 while (aresult.size() > 0)
764 ar = aresult.remove(0);
768 ar.append(aresult.remove(0));
773 presultTitle.add(titl);
776 guiWindow.setProgressBar(MessageManager
777 .getString("status.finshed_querying"), Thread.currentThread()
780 guiWindow.setProgressBar(
781 (presult.size() > 0) ? MessageManager
782 .getString("status.parsing_results") : MessageManager
783 .getString("status.processing"), Thread.currentThread()
786 while (presult.size() > 0)
788 parseResult(presult.remove(0), presultTitle.remove(0), null,
789 preferredFeatureColours);
791 // only remove visual delay after we finished parsing.
792 guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
793 if (nextFetch.size() > 0)
795 StringBuffer sb = new StringBuffer();
796 sb.append("Didn't retrieve the following "
797 + (nextFetch.size() == 1 ? "query" : nextFetch.size()
798 + " queries") + ": \n");
799 int l = sb.length(), lr = 0;
800 for (String s : nextFetch)
802 if (l != sb.length())
806 if (lr - sb.length() > 40)
812 showErrorMessage(sb.toString());
818 * Tries to fetch one or more accession ids from the database proxy
822 * the queries to fetch
824 * a successful queries list to add to
826 * a list of retrieved alignments to add to
828 * failed queries are added to this list
831 void fetchMultipleAccessions(DbSourceProxy proxy,
832 Iterator<String> accessions, List<String> aresultq,
833 List<AlignmentI> aresult, List<String> nextFetch)
836 StringBuilder multiacc = new StringBuilder();
837 List<String> tosend = new ArrayList<String>();
838 while (accessions.hasNext())
840 String nel = accessions.next();
842 multiacc.append(nel);
843 if (accessions.hasNext())
845 multiacc.append(proxy.getAccessionSeparator());
851 String query = multiacc.toString();
852 AlignmentI rslt = proxy.getSequenceRecords(query);
853 if (rslt == null || rslt.getHeight() == 0)
855 // no results - pass on all queries to next source
856 nextFetch.addAll(tosend);
862 if (tosend.size() > 1)
864 checkResultForQueries(rslt, tosend, nextFetch, proxy);
867 } catch (OutOfMemoryError oome)
869 new OOMWarning("fetching " + multiacc + " from "
870 + database.getSelectedItem(), oome, this);
875 * Query for a single accession id via the database proxy
880 * a list of successful queries to add to
882 * a list of retrieved alignments to add to
883 * @return true if the fetch was successful, else false
885 boolean fetchSingleAccession(DbSourceProxy proxy, String accession,
886 List<String> aresultq, List<AlignmentI> aresult)
888 boolean success = false;
895 // give the server a chance to breathe
897 } catch (Exception e)
903 AlignmentI indres = null;
906 indres = proxy.getSequenceRecords(accession);
907 } catch (OutOfMemoryError oome)
909 new OOMWarning("fetching " + accession + " from "
910 + proxy.getDbName(), oome, this);
914 aresultq.add(accession);
918 } catch (Exception e)
921 "Error retrieving " + accession + " from "
922 + proxy.getDbName(), e);
928 * Checks which of the queries were successfully retrieved by searching the
929 * DBRefs of the retrieved sequences for a match. Any not found are added to
930 * the 'nextFetch' list.
937 void checkResultForQueries(AlignmentI rslt, List<String> queries,
938 List<String> nextFetch, DbSourceProxy proxy)
940 SequenceI[] rs = rslt.getSequencesArray();
942 for (String q : queries)
944 DBRefEntry dbr = new DBRefEntry();
945 dbr.setSource(proxy.getDbSource());
946 dbr.setVersion(null);
947 String accId = proxy.getAccessionIdFromQuery(q);
948 dbr.setAccessionId(accId);
949 boolean rfound = false;
950 for (int r = 0; r < rs.length; r++)
954 List<DBRefEntry> found = DBRefUtils.searchRefs(rs[r].getDBRefs(),
956 if (!found.isEmpty())
972 * @return a standard title for any results retrieved using the currently
973 * selected source and settings
975 public String getDefaultRetrievalTitle()
977 return "Retrieved from " + database.getSelectedItem();
980 AlignmentI parseResult(AlignmentI al, String title,
981 FileFormatI currentFileFormat,
982 FeatureSettingsModelI preferredFeatureColours)
985 if (al != null && al.getHeight() > 0)
989 title = getDefaultRetrievalTitle();
991 if (alignFrame == null)
993 AlignFrame af = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
994 AlignFrame.DEFAULT_HEIGHT);
995 if (currentFileFormat != null)
997 af.currentFileFormat = currentFileFormat; // WHAT IS THE DEFAULT
999 // NON-FormatAdapter Sourced
1003 SequenceFeature[] sfs = null;
1004 List<SequenceI> alsqs;
1005 synchronized (alsqs = al.getSequences())
1007 for (SequenceI sq : alsqs)
1009 if ((sfs = sq.getSequenceFeatures()) != null)
1013 af.setShowSeqFeatures(true);
1021 if (preferredFeatureColours != null)
1023 af.getViewport().applyFeaturesStyle(preferredFeatureColours);
1025 if (Cache.getDefault("HIDE_INTRONS", true))
1027 af.hideFeatureColumns(SequenceOntologyI.EXON, false);
1029 if (newAlframes != null)
1031 newAlframes.add(af);
1033 Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH,
1034 AlignFrame.DEFAULT_HEIGHT);
1036 af.statusBar.setText(MessageManager
1037 .getString("label.successfully_pasted_alignment_file"));
1041 af.setMaximum(Cache.getDefault("SHOW_FULLSCREEN", false));
1042 } catch (Exception ex)
1048 alignFrame.viewport.addAlignment(al, title);
1054 void showErrorMessage(final String error)
1057 javax.swing.SwingUtilities.invokeLater(new Runnable()
1062 JvOptionPane.showInternalMessageDialog(Desktop.desktop, error,
1063 MessageManager.getString("label.error_retrieving_data"),
1064 JvOptionPane.WARNING_MESSAGE);
1069 public IProgressIndicator getProgressIndicator()
1071 return progressIndicator;
1074 public void setProgressIndicator(IProgressIndicator progressIndicator)
1076 this.progressIndicator = progressIndicator;
1080 * Make this panel visible (after a selection has been made in the database
1085 frame.setVisible(true);
1089 * Hide this panel (on clicking the database button to open the database
1094 frame.setVisible(false);