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)
139 guiWindow.setProgressBar(
140 MessageManager.getString(
141 "status.waiting_sequence_database_fetchers_init"),
142 Thread.currentThread().hashCode());
144 // initting happening on another thread - so wait around to see if it
146 while (_initingFetcher && initingThread != null
147 && initingThread.isAlive())
152 } catch (Exception e)
157 if (guiWindow != null)
159 guiWindow.setProgressBar(
160 MessageManager.getString(
161 "status.waiting_sequence_database_fetchers_init"),
162 Thread.currentThread().hashCode());
165 if (sfetch == null || dasRegistry != Cache.getDasSourceRegistry()
166 || lastDasSourceRegistry != (Cache.getDasSourceRegistry()
168 + Cache.getDasSourceRegistry().getLocalSourceString())
171 _initingFetcher = true;
172 initingThread = Thread.currentThread();
174 * give a visual indication that sequence fetcher construction is occuring
176 if (guiWindow != null)
178 guiWindow.setProgressBar(
179 MessageManager.getString(
180 "status.init_sequence_database_fetchers"),
181 Thread.currentThread().hashCode());
183 dasRegistry = Cache.getDasSourceRegistry();
184 dasRegistry.refreshSources();
186 jalview.ws.SequenceFetcher sf = new jalview.ws.SequenceFetcher();
187 if (guiWindow != null)
189 guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
191 lastDasSourceRegistry = (dasRegistry.getDasRegistryURL()
192 + dasRegistry.getLocalSourceString()).hashCode();
194 _initingFetcher = false;
195 initingThread = null;
200 private IProgressIndicator progressIndicator;
202 private volatile boolean _isConstructing = false;
204 private List<AlignFrame> newAlframes = null;
206 public SequenceFetcher(IProgressIndicator guiIndic)
208 this(guiIndic, null, null);
211 public SequenceFetcher(IProgressIndicator guiIndic,
212 final String selectedDb, final String queryString)
214 this._isConstructing = true;
215 this.progressIndicator = guiIndic;
216 final SequenceFetcher us = this;
217 // launch initialiser thread
218 Thread sf = new Thread(new Runnable()
224 if (getSequenceFetcherSingleton(progressIndicator) != null)
226 us.initGui(progressIndicator, selectedDb, queryString);
227 us._isConstructing = false;
231 javax.swing.SwingUtilities.invokeLater(new Runnable()
236 JvOptionPane.showInternalMessageDialog(Desktop.desktop,
237 MessageManager.getString(
238 "warn.couldnt_create_sequence_fetcher_client"),
239 MessageManager.getString(
240 "label.couldnt_create_sequence_fetcher"),
241 JvOptionPane.ERROR_MESSAGE);
245 // raise warning dialog
253 * blocking call which creates a new sequence fetcher panel, configures it and
254 * presses the OK button with the given database and query.
259 public static List<AlignFrame> fetchAndShow(String database, String query)
261 final SequenceFetcher sf = new SequenceFetcher(Desktop.instance,
263 while (sf._isConstructing)
268 } catch (Exception q)
270 return Collections.emptyList();
273 sf.newAlframes = new ArrayList<AlignFrame>();
275 return sf.newAlframes;
278 private class DatabaseAuthority extends DefaultMutableTreeNode
283 private class DatabaseSource extends DefaultMutableTreeNode
289 * initialise the database and query for this fetcher panel
292 * - string that should correspond to a sequence fetcher
294 * - string that will be entered in the query dialog
295 * @return true if UI was configured with valid database and query string
297 protected boolean setInitialQuery(String selectedDb, String queryString)
299 if (selectedDb == null || selectedDb.trim().length() == 0)
305 List<DbSourceProxy> sp = sfetch.getSourceProxy(selectedDb);
306 for (DbSourceProxy sourcep : sp)
308 if (sourcep.getTier() == 0)
310 database.selection = Arrays
311 .asList(new DbSourceProxy[]
316 if (database.selection == null || database.selection.size() == 0)
319 "Ignoring fetch parameter db='" + selectedDb + "'");
322 textArea.setText(queryString);
323 } catch (Exception q)
325 System.err.println("Ignoring fetch parameter db='" + selectedDb
326 + "' and query='" + queryString + "'");
333 * called by thread spawned by constructor
339 private void initGui(IProgressIndicator guiWindow, String selectedDb,
342 this.guiWindow = guiWindow;
343 if (guiWindow instanceof AlignFrame)
345 alignFrame = (AlignFrame) guiWindow;
347 database = new JDatabaseTree(sfetch);
352 * configure the UI with any query parameters we were called with
354 if (!setInitialQuery(selectedDb, queryString))
357 * none provided, so show the database chooser
359 database.waitForInput();
361 } catch (Exception ex)
363 ex.printStackTrace();
366 frame = new JInternalFrame();
367 frame.setContentPane(this);
368 if (Platform.isAMac())
370 Desktop.addInternalFrame(frame, getFrameTitle(), false, 400, 240);
374 Desktop.addInternalFrame(frame, getFrameTitle(), false, 400, 180);
378 private String getFrameTitle()
380 return ((alignFrame == null)
381 ? MessageManager.getString("label.new_sequence_fetcher")
383 .getString("label.additional_sequence_fetcher"));
386 private void jbInit() throws Exception
388 this.setLayout(borderLayout2);
390 database.setFont(JvSwingUtils.getLabelFont());
391 dbeg.setFont(new java.awt.Font("Verdana", Font.BOLD, 11));
392 jLabel1.setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
393 jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
394 jLabel1.setText(MessageManager
395 .getString("label.separate_multiple_accession_ids"));
397 replacePunctuation.setHorizontalAlignment(SwingConstants.CENTER);
399 .setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
400 replacePunctuation.setText(
401 MessageManager.getString("label.replace_commas_semicolons"));
402 ok.setText(MessageManager.getString("action.ok"));
403 ok.addActionListener(new ActionListener()
406 public void actionPerformed(ActionEvent e)
408 ok_actionPerformed();
411 clear.setText(MessageManager.getString("action.clear"));
412 clear.addActionListener(new ActionListener()
415 public void actionPerformed(ActionEvent e)
417 clear_actionPerformed();
421 example.setText(MessageManager.getString("label.example"));
422 example.addActionListener(new ActionListener()
425 public void actionPerformed(ActionEvent e)
427 example_actionPerformed();
430 close.setText(MessageManager.getString("action.close"));
431 close.addActionListener(new ActionListener()
434 public void actionPerformed(ActionEvent e)
436 close_actionPerformed(e);
439 textArea.setFont(JvSwingUtils.getLabelFont());
440 textArea.setLineWrap(true);
441 textArea.addKeyListener(new KeyAdapter()
444 public void keyPressed(KeyEvent e)
446 if (e.getKeyCode() == KeyEvent.VK_ENTER)
448 ok_actionPerformed();
452 jPanel3.setLayout(borderLayout1);
453 borderLayout1.setVgap(5);
455 jPanel1.add(example);
458 jPanel2.setLayout(borderLayout3);
459 databaseButt = /*database.getDatabaseSelectorButton();
460 final JButton viewdbs =*/new JButton(
461 MessageManager.getString("action.select_ddbb"));
462 databaseButt.addActionListener(new ActionListener()
466 public void actionPerformed(ActionEvent arg0)
469 database.showDialog();
472 databaseButt.setFont(JvSwingUtils.getLabelFont());
473 database.addActionListener(new ActionListener()
476 public void actionPerformed(ActionEvent e)
478 String currentSelection = database.getSelectedItem();
479 if (currentSelection == null)
481 close_actionPerformed(null);
486 if ("pdb".equalsIgnoreCase(currentSelection))
490 else if ("uniprot".equalsIgnoreCase(currentSelection))
492 uniprotSourceAction();
498 database.action = -1;
503 jPanel2.add(databaseButt, java.awt.BorderLayout.NORTH);
504 jPanel2.add(dbeg, java.awt.BorderLayout.CENTER);
505 JPanel jPanel2a = new JPanel(new BorderLayout());
506 jPanel2a.add(jLabel1, java.awt.BorderLayout.NORTH);
507 jPanel2a.add(replacePunctuation, java.awt.BorderLayout.SOUTH);
508 jPanel2.add(jPanel2a, java.awt.BorderLayout.SOUTH);
509 // jPanel2.setPreferredSize(new Dimension())
510 jPanel3.add(jScrollPane1, java.awt.BorderLayout.CENTER);
511 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
512 this.add(jPanel3, java.awt.BorderLayout.CENTER);
513 this.add(jPanel2, java.awt.BorderLayout.NORTH);
514 jScrollPane1.getViewport().add(textArea);
517 private void pdbSourceAction()
519 databaseButt.setText(database.getSelectedItem());
520 new PDBFTSPanel(this);
524 private void uniprotSourceAction()
526 databaseButt.setText(database.getSelectedItem());
527 new UniprotFTSPanel(this);
531 private void otherSourceAction()
535 databaseButt.setText(database.getSelectedItem()
536 + (database.getSelectedSources().size() > 1 ? " (and "
537 + database.getSelectedSources().size() + " others)"
539 String eq = database.getExampleQueries();
540 dbeg.setText(MessageManager.formatMessage("label.example_query_param",
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_.]")
635 .search(textArea.getText()))
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
656 .asList(qries = textArea.getText().split(";"));
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();
676 guiWindow.setProgressBar(MessageManager.formatMessage(
677 "status.fetching_sequence_queries_from", new String[]
678 { Integer.valueOf(nqueries).toString(),
679 proxy.getDbName() }),
680 Thread.currentThread().hashCode());
681 if (proxy.getMaximumQueryCount() == 1)
684 * proxy only handles one accession id at a time
688 String acc = en.next();
689 if (!fetchSingleAccession(proxy, acc, aresultq, aresult))
698 * proxy can fetch multiple accessions at one time
700 fetchMultipleAccessions(proxy, en, aresultq, aresult, nextFetch);
702 } catch (Exception e)
704 showErrorMessage("Error retrieving " + textArea.getText() + " from "
705 + database.getSelectedItem());
707 // +="Couldn't retrieve sequences from "+database.getSelectedItem();
708 System.err.println("Retrieval failed for source ='"
709 + database.getSelectedItem() + "' and query\n'"
710 + textArea.getText() + "'\n");
712 } catch (OutOfMemoryError e)
714 showErrorMessage("Out of Memory when retrieving "
715 + textArea.getText() + " from " + database.getSelectedItem()
716 + "\nPlease see the Jalview FAQ for instructions for increasing the memory available to Jalview.\n");
720 showErrorMessage("Serious Error retrieving " + textArea.getText()
721 + " from " + database.getSelectedItem());
725 // Stack results ready for opening in alignment windows
726 if (aresult != null && aresult.size() > 0)
728 FeatureSettingsModelI proxyColourScheme = proxy
729 .getFeatureColourScheme();
730 if (proxyColourScheme != null)
732 preferredFeatureColours = proxyColourScheme;
735 AlignmentI ar = null;
736 if (proxy.isAlignmentSource())
739 // new window for each result
740 while (aresult.size() > 0)
742 presult.add(aresult.remove(0));
744 aresultq.remove(0) + " " + getDefaultRetrievalTitle());
750 if (addToLast && presult.size() > 0)
752 ar = presult.remove(presult.size() - 1);
753 titl = presultTitle.remove(presultTitle.size() - 1);
755 // concatenate all results in one window
756 while (aresult.size() > 0)
760 ar = aresult.remove(0);
764 ar.append(aresult.remove(0));
769 presultTitle.add(titl);
772 guiWindow.setProgressBar(
773 MessageManager.getString("status.finshed_querying"),
774 Thread.currentThread().hashCode());
780 .getString("status.parsing_results")
781 : MessageManager.getString("status.processing"),
782 Thread.currentThread().hashCode());
784 while (presult.size() > 0)
786 parseResult(presult.remove(0), presultTitle.remove(0), null,
787 preferredFeatureColours);
789 // only remove visual delay after we finished parsing.
790 guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
791 if (nextFetch.size() > 0)
793 StringBuffer sb = new StringBuffer();
794 sb.append("Didn't retrieve the following "
795 + (nextFetch.size() == 1 ? "query"
796 : nextFetch.size() + " queries")
798 int l = sb.length(), lr = 0;
799 for (String s : nextFetch)
801 if (l != sb.length())
805 if (lr - sb.length() > 40)
811 showErrorMessage(sb.toString());
817 * Tries to fetch one or more accession ids from the database proxy
821 * the queries to fetch
823 * a successful queries list to add to
825 * a list of retrieved alignments to add to
827 * failed queries are added to this list
830 void fetchMultipleAccessions(DbSourceProxy proxy,
831 Iterator<String> accessions, List<String> aresultq,
832 List<AlignmentI> aresult, List<String> nextFetch) throws Exception
834 StringBuilder multiacc = new StringBuilder();
835 List<String> tosend = new ArrayList<String>();
836 while (accessions.hasNext())
838 String nel = accessions.next();
840 multiacc.append(nel);
841 if (accessions.hasNext())
843 multiacc.append(proxy.getAccessionSeparator());
849 String query = multiacc.toString();
850 AlignmentI rslt = proxy.getSequenceRecords(query);
851 if (rslt == null || rslt.getHeight() == 0)
853 // no results - pass on all queries to next source
854 nextFetch.addAll(tosend);
860 if (tosend.size() > 1)
862 checkResultForQueries(rslt, tosend, nextFetch, proxy);
865 } catch (OutOfMemoryError oome)
867 new OOMWarning("fetching " + multiacc + " from "
868 + database.getSelectedItem(), oome, this);
873 * Query for a single accession id via the database proxy
878 * a list of successful queries to add to
880 * a list of retrieved alignments to add to
881 * @return true if the fetch was successful, else false
883 boolean fetchSingleAccession(DbSourceProxy proxy, String accession,
884 List<String> aresultq, List<AlignmentI> aresult)
886 boolean success = false;
893 // give the server a chance to breathe
895 } catch (Exception e)
901 AlignmentI indres = null;
904 indres = proxy.getSequenceRecords(accession);
905 } catch (OutOfMemoryError oome)
908 "fetching " + accession + " from " + proxy.getDbName(),
913 aresultq.add(accession);
917 } catch (Exception e)
919 Cache.log.info("Error retrieving " + accession + " from "
920 + proxy.getDbName(), e);
926 * Checks which of the queries were successfully retrieved by searching the
927 * DBRefs of the retrieved sequences for a match. Any not found are added to
928 * the 'nextFetch' list.
935 void checkResultForQueries(AlignmentI rslt, List<String> queries,
936 List<String> nextFetch, DbSourceProxy proxy)
938 SequenceI[] rs = rslt.getSequencesArray();
940 for (String q : queries)
942 DBRefEntry dbr = new DBRefEntry();
943 dbr.setSource(proxy.getDbSource());
944 dbr.setVersion(null);
945 String accId = proxy.getAccessionIdFromQuery(q);
946 dbr.setAccessionId(accId);
947 boolean rfound = false;
948 for (int r = 0; r < rs.length; r++)
952 List<DBRefEntry> found = DBRefUtils.searchRefs(rs[r].getDBRefs(),
954 if (!found.isEmpty())
970 * @return a standard title for any results retrieved using the currently
971 * selected source and settings
973 public String getDefaultRetrievalTitle()
975 return "Retrieved from " + database.getSelectedItem();
978 AlignmentI parseResult(AlignmentI al, String title,
979 FileFormatI currentFileFormat,
980 FeatureSettingsModelI preferredFeatureColours)
983 if (al != null && al.getHeight() > 0)
987 title = getDefaultRetrievalTitle();
989 if (alignFrame == null)
991 AlignFrame af = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
992 AlignFrame.DEFAULT_HEIGHT);
993 if (currentFileFormat != null)
995 af.currentFileFormat = currentFileFormat; // WHAT IS THE DEFAULT
997 // NON-FormatAdapter Sourced
1001 SequenceFeature[] sfs = null;
1002 List<SequenceI> alsqs;
1003 synchronized (alsqs = al.getSequences())
1005 for (SequenceI sq : alsqs)
1007 if (sq.getFeatures().hasFeatures())
1009 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", false));
1036 } catch (Exception ex)
1042 alignFrame.viewport.addAlignment(al, title);
1048 void showErrorMessage(final String error)
1051 javax.swing.SwingUtilities.invokeLater(new Runnable()
1056 JvOptionPane.showInternalMessageDialog(Desktop.desktop, error,
1057 MessageManager.getString("label.error_retrieving_data"),
1058 JvOptionPane.WARNING_MESSAGE);
1063 public IProgressIndicator getProgressIndicator()
1065 return progressIndicator;
1068 public void setProgressIndicator(IProgressIndicator progressIndicator)
1070 this.progressIndicator = progressIndicator;
1074 * Make this panel visible (after a selection has been made in the database
1079 frame.setVisible(true);
1083 * Hide this panel (on clicking the database button to open the database
1088 frame.setVisible(false);