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.SequenceI;
28 import jalview.fts.core.GFTSPanel;
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 JButton back = new JButton();
83 JPanel jPanel1 = new JPanel();
85 JTextArea textArea = new JTextArea();
87 JScrollPane jScrollPane1 = new JScrollPane();
89 JPanel jPanel2 = new JPanel();
91 JPanel jPanel3 = new JPanel();
93 JPanel jPanel4 = new JPanel();
95 BorderLayout borderLayout1 = new BorderLayout();
97 BorderLayout borderLayout2 = new BorderLayout();
99 BorderLayout borderLayout3 = new BorderLayout();
101 JInternalFrame frame;
103 IProgressIndicator guiWindow;
105 AlignFrame alignFrame;
109 final String noDbSelected = "-- Select Database --";
111 private static jalview.ws.SequenceFetcher sfetch = null;
113 private static long lastDasSourceRegistry = -3;
115 private static DasSourceRegistryI dasRegistry = null;
117 private static boolean _initingFetcher = false;
119 private static Thread initingThread = null;
121 public JTextArea getTextArea()
127 * Blocking method that initialises and returns the shared instance of the
128 * SequenceFetcher client
131 * - where the initialisation delay message should be shown
132 * @return the singleton instance of the sequence fetcher client
134 public static jalview.ws.SequenceFetcher getSequenceFetcherSingleton(
135 final IProgressIndicator guiWindow)
137 if (_initingFetcher && initingThread != null && initingThread.isAlive())
139 if (guiWindow != null)
141 guiWindow.setProgressBar(
142 MessageManager.getString(
143 "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)
161 guiWindow.setProgressBar(
162 MessageManager.getString(
163 "status.waiting_sequence_database_fetchers_init"),
164 Thread.currentThread().hashCode());
167 if (sfetch == null || dasRegistry != Cache.getDasSourceRegistry()
168 || lastDasSourceRegistry != (Cache.getDasSourceRegistry()
170 + Cache.getDasSourceRegistry().getLocalSourceString())
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(
181 MessageManager.getString(
182 "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()
194 + dasRegistry.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()
238 JvOptionPane.showInternalMessageDialog(Desktop.desktop,
239 MessageManager.getString(
240 "warn.couldnt_create_sequence_fetcher_client"),
241 MessageManager.getString(
242 "label.couldnt_create_sequence_fetcher"),
243 JvOptionPane.ERROR_MESSAGE);
247 // raise warning dialog
255 * blocking call which creates a new sequence fetcher panel, configures it and
256 * presses the OK button with the given database and query.
261 public static List<AlignFrame> fetchAndShow(String database, String query)
263 final SequenceFetcher sf = new SequenceFetcher(Desktop.instance,
265 while (sf._isConstructing)
270 } catch (Exception q)
272 return Collections.emptyList();
275 sf.newAlframes = new ArrayList<>();
277 return sf.newAlframes;
280 private class DatabaseAuthority extends DefaultMutableTreeNode
285 private class DatabaseSource extends DefaultMutableTreeNode
291 * initialise the database and query for this fetcher panel
294 * - string that should correspond to a sequence fetcher
296 * - string that will be entered in the query dialog
297 * @return true if UI was configured with valid database and query string
299 protected boolean setInitialQuery(String selectedDb, String queryString)
301 if (selectedDb == null || selectedDb.trim().length() == 0)
307 List<DbSourceProxy> sp = sfetch.getSourceProxy(selectedDb);
308 for (DbSourceProxy sourcep : sp)
310 if (sourcep.getTier() == 0)
312 database.selection = Arrays
313 .asList(new DbSourceProxy[]
318 if (database.selection == null || database.selection.size() == 0)
321 "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)
383 ? MessageManager.getString("label.new_sequence_fetcher")
385 .getString("label.additional_sequence_fetcher"));
388 GFTSPanel parentFTSframe = null;
390 * change the buttons so they fit with the FTS panel.
392 public void embedWithFTSPanel(GFTSPanel toClose)
394 back.setVisible(true);
395 parentFTSframe = toClose;
397 private void jbInit() throws Exception
399 this.setLayout(borderLayout2);
401 database.setFont(JvSwingUtils.getLabelFont());
402 dbeg.setFont(new java.awt.Font("Verdana", Font.BOLD, 11));
403 jLabel1.setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
404 jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
405 jLabel1.setText(MessageManager
406 .getString("label.separate_multiple_accession_ids"));
408 replacePunctuation.setHorizontalAlignment(SwingConstants.CENTER);
410 .setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
411 replacePunctuation.setText(
412 MessageManager.getString("label.replace_commas_semicolons"));
413 ok.setText(MessageManager.getString("action.ok"));
414 ok.addActionListener(new ActionListener()
417 public void actionPerformed(ActionEvent e)
419 ok_actionPerformed();
422 clear.setText(MessageManager.getString("action.clear"));
423 clear.addActionListener(new ActionListener()
426 public void actionPerformed(ActionEvent e)
428 clear_actionPerformed();
432 example.setText(MessageManager.getString("label.example"));
433 example.addActionListener(new ActionListener()
436 public void actionPerformed(ActionEvent e)
438 example_actionPerformed();
441 close.setText(MessageManager.getString("action.cancel"));
442 close.addActionListener(new ActionListener()
445 public void actionPerformed(ActionEvent e)
447 close_actionPerformed(e);
450 back.setText(MessageManager.getString("action.back"));
451 back.addActionListener(new ActionListener()
454 public void actionPerformed(ActionEvent e)
456 parentFTSframe.btn_back_ActionPerformed();
459 // back not visible unless embedded
460 back.setVisible(false);
461 textArea.setFont(JvSwingUtils.getLabelFont());
462 textArea.setLineWrap(true);
463 textArea.addKeyListener(new KeyAdapter()
466 public void keyPressed(KeyEvent e)
468 if (e.getKeyCode() == KeyEvent.VK_ENTER)
470 ok_actionPerformed();
474 jPanel3.setLayout(borderLayout1);
475 borderLayout1.setVgap(5);
477 jPanel1.add(example);
481 jPanel2.setLayout(borderLayout3);
482 databaseButt = /*database.getDatabaseSelectorButton();
483 final JButton viewdbs =*/new JButton(
484 MessageManager.getString("action.select_ddbb"));
485 databaseButt.addActionListener(new ActionListener()
489 public void actionPerformed(ActionEvent arg0)
492 database.showDialog();
495 databaseButt.setFont(JvSwingUtils.getLabelFont());
496 database.addActionListener(new ActionListener()
499 public void actionPerformed(ActionEvent e)
501 String currentSelection = database.getSelectedItem();
502 if (currentSelection == null)
504 close_actionPerformed(null);
509 if ("pdb".equalsIgnoreCase(currentSelection))
513 else if ("uniprot".equalsIgnoreCase(currentSelection))
515 uniprotSourceAction();
521 database.action = -1;
526 jPanel2.add(databaseButt, java.awt.BorderLayout.NORTH);
527 jPanel2.add(dbeg, java.awt.BorderLayout.CENTER);
528 JPanel jPanel2a = new JPanel(new BorderLayout());
529 jPanel2a.add(jLabel1, java.awt.BorderLayout.NORTH);
530 jPanel2a.add(replacePunctuation, java.awt.BorderLayout.SOUTH);
531 jPanel2.add(jPanel2a, java.awt.BorderLayout.SOUTH);
532 // jPanel2.setPreferredSize(new Dimension())
533 jPanel3.add(jScrollPane1, java.awt.BorderLayout.CENTER);
534 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
535 this.add(jPanel3, java.awt.BorderLayout.CENTER);
536 this.add(jPanel2, java.awt.BorderLayout.NORTH);
537 jScrollPane1.getViewport().add(textArea);
540 private void pdbSourceAction()
542 databaseButt.setText(database.getSelectedItem());
543 new PDBFTSPanel(this);
547 private void uniprotSourceAction()
549 databaseButt.setText(database.getSelectedItem());
550 new UniprotFTSPanel(this);
554 private void otherSourceAction()
558 databaseButt.setText(database.getSelectedItem()
559 + (database.getSelectedSources().size() > 1 ? " (and "
560 + database.getSelectedSources().size() + " others)"
562 String eq = database.getExampleQueries();
563 dbeg.setText(MessageManager.formatMessage("label.example_query_param",
566 boolean enablePunct = !(eq != null && eq.indexOf(",") > -1);
567 for (DbSourceProxy dbs : database.getSelectedSources())
569 if (dbs instanceof jalview.ws.dbsources.das.datamodel.DasSequenceSource)
575 replacePunctuation.setEnabled(enablePunct);
577 } catch (Exception ex)
580 replacePunctuation.setEnabled(true);
585 protected void example_actionPerformed()
587 DbSourceProxy db = null;
590 textArea.setText(database.getExampleQueries());
591 } catch (Exception ex)
597 protected void clear_actionPerformed()
599 textArea.setText("");
603 public void close_actionPerformed(ActionEvent e)
607 frame.setClosed(true);
608 if (parentFTSframe!=null)
610 parentFTSframe.btn_cancel_ActionPerformed();
612 } catch (Exception ex)
617 public void ok_actionPerformed()
619 databaseButt.setEnabled(false);
620 example.setEnabled(false);
621 textArea.setEnabled(false);
622 ok.setEnabled(false);
623 close.setEnabled(false);
624 back.setEnabled(false);
625 Thread worker = new Thread(this);
629 private void resetDialog()
631 databaseButt.setEnabled(true);
632 example.setEnabled(true);
633 textArea.setEnabled(true);
635 close.setEnabled(true);
636 back.setEnabled(parentFTSframe != null);
643 if (!database.hasSelection())
645 error += "Please select the source database\n";
647 // TODO: make this transformation more configurable
648 com.stevesoft.pat.Regex empty;
649 if (replacePunctuation.isEnabled() && replacePunctuation.isSelected())
651 empty = new com.stevesoft.pat.Regex(
652 // replace commas and spaces with a semicolon
653 "(\\s|[,; ])+", ";");
657 // just turn spaces and semicolons into single semicolons
658 empty = new com.stevesoft.pat.Regex("(\\s|[; ])+", ";");
660 textArea.setText(empty.replaceAll(textArea.getText()));
661 // see if there's anthing to search with
662 if (!new com.stevesoft.pat.Regex("[A-Za-z0-9_.]")
663 .search(textArea.getText()))
665 error += "Please enter a (semi-colon separated list of) database id(s)";
667 if (error.length() > 0)
669 showErrorMessage(error);
673 // TODO: Refactor to GUI independent code and write tests.
674 // indicate if successive sources should be merged into one alignment.
675 boolean addToLast = false;
676 List<String> aresultq = new ArrayList<>();
677 List<String> presultTitle = new ArrayList<>();
678 List<AlignmentI> presult = new ArrayList<>();
679 List<AlignmentI> aresult = new ArrayList<>();
680 Iterator<DbSourceProxy> proxies = database.getSelectedSources()
683 List<String> nextFetch = Arrays
684 .asList(qries = textArea.getText().split(";"));
685 Iterator<String> en = Arrays.asList(new String[0]).iterator();
686 int nqueries = qries.length;
688 FeatureSettingsModelI preferredFeatureColours = null;
689 while (proxies.hasNext() && (en.hasNext() || nextFetch.size() > 0))
691 if (!en.hasNext() && nextFetch.size() > 0)
693 en = nextFetch.iterator();
694 nqueries = nextFetch.size();
695 // save the remaining queries in the original array
696 qries = nextFetch.toArray(new String[nqueries]);
697 nextFetch = new ArrayList<>();
700 DbSourceProxy proxy = proxies.next();
704 guiWindow.setProgressBar(MessageManager.formatMessage(
705 "status.fetching_sequence_queries_from", new String[]
706 { Integer.valueOf(nqueries).toString(),
707 proxy.getDbName() }),
708 Thread.currentThread().hashCode());
709 if (proxy.getMaximumQueryCount() == 1)
712 * proxy only handles one accession id at a time
716 String acc = en.next();
717 if (!fetchSingleAccession(proxy, acc, aresultq, aresult))
726 * proxy can fetch multiple accessions at one time
728 fetchMultipleAccessions(proxy, en, aresultq, aresult, nextFetch);
730 } catch (Exception e)
732 showErrorMessage("Error retrieving " + textArea.getText() + " from "
733 + database.getSelectedItem());
735 // +="Couldn't retrieve sequences from "+database.getSelectedItem();
736 System.err.println("Retrieval failed for source ='"
737 + database.getSelectedItem() + "' and query\n'"
738 + textArea.getText() + "'\n");
740 } catch (OutOfMemoryError e)
742 showErrorMessage("Out of Memory when retrieving "
743 + textArea.getText() + " from " + database.getSelectedItem()
744 + "\nPlease see the Jalview FAQ for instructions for increasing the memory available to Jalview.\n");
748 showErrorMessage("Serious Error retrieving " + textArea.getText()
749 + " from " + database.getSelectedItem());
753 // Stack results ready for opening in alignment windows
754 if (aresult != null && aresult.size() > 0)
756 FeatureSettingsModelI proxyColourScheme = proxy
757 .getFeatureColourScheme();
758 if (proxyColourScheme != null)
760 preferredFeatureColours = proxyColourScheme;
763 AlignmentI ar = null;
764 if (proxy.isAlignmentSource())
767 // new window for each result
768 while (aresult.size() > 0)
770 presult.add(aresult.remove(0));
772 aresultq.remove(0) + " " + getDefaultRetrievalTitle());
778 if (addToLast && presult.size() > 0)
780 ar = presult.remove(presult.size() - 1);
781 titl = presultTitle.remove(presultTitle.size() - 1);
783 // concatenate all results in one window
784 while (aresult.size() > 0)
788 ar = aresult.remove(0);
792 ar.append(aresult.remove(0));
797 presultTitle.add(titl);
800 guiWindow.setProgressBar(
801 MessageManager.getString("status.finshed_querying"),
802 Thread.currentThread().hashCode());
808 .getString("status.parsing_results")
809 : MessageManager.getString("status.processing"),
810 Thread.currentThread().hashCode());
812 while (presult.size() > 0)
814 parseResult(presult.remove(0), presultTitle.remove(0), null,
815 preferredFeatureColours);
817 // only remove visual delay after we finished parsing.
818 guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
819 if (nextFetch.size() > 0)
821 StringBuffer sb = new StringBuffer();
822 sb.append("Didn't retrieve the following "
823 + (nextFetch.size() == 1 ? "query"
824 : nextFetch.size() + " queries")
826 int l = sb.length(), lr = 0;
827 for (String s : nextFetch)
829 if (l != sb.length())
833 if (lr - sb.length() > 40)
839 showErrorMessage(sb.toString());
845 * Tries to fetch one or more accession ids from the database proxy
849 * the queries to fetch
851 * a successful queries list to add to
853 * a list of retrieved alignments to add to
855 * failed queries are added to this list
858 void fetchMultipleAccessions(DbSourceProxy proxy,
859 Iterator<String> accessions, List<String> aresultq,
860 List<AlignmentI> aresult, List<String> nextFetch) throws Exception
862 StringBuilder multiacc = new StringBuilder();
863 List<String> tosend = new ArrayList<>();
864 while (accessions.hasNext())
866 String nel = accessions.next();
868 multiacc.append(nel);
869 if (accessions.hasNext())
871 multiacc.append(proxy.getAccessionSeparator());
877 String query = multiacc.toString();
878 AlignmentI rslt = proxy.getSequenceRecords(query);
879 if (rslt == null || rslt.getHeight() == 0)
881 // no results - pass on all queries to next source
882 nextFetch.addAll(tosend);
888 if (tosend.size() > 1)
890 checkResultForQueries(rslt, tosend, nextFetch, proxy);
893 } catch (OutOfMemoryError oome)
895 new OOMWarning("fetching " + multiacc + " from "
896 + database.getSelectedItem(), oome, this);
901 * Query for a single accession id via the database proxy
906 * a list of successful queries to add to
908 * a list of retrieved alignments to add to
909 * @return true if the fetch was successful, else false
911 boolean fetchSingleAccession(DbSourceProxy proxy, String accession,
912 List<String> aresultq, List<AlignmentI> aresult)
914 boolean success = false;
921 // give the server a chance to breathe
923 } catch (Exception e)
929 AlignmentI indres = null;
932 indres = proxy.getSequenceRecords(accession);
933 } catch (OutOfMemoryError oome)
936 "fetching " + accession + " from " + proxy.getDbName(),
941 aresultq.add(accession);
945 } catch (Exception e)
947 Cache.log.info("Error retrieving " + accession + " from "
948 + proxy.getDbName(), e);
954 * Checks which of the queries were successfully retrieved by searching the
955 * DBRefs of the retrieved sequences for a match. Any not found are added to
956 * the 'nextFetch' list.
963 void checkResultForQueries(AlignmentI rslt, List<String> queries,
964 List<String> nextFetch, DbSourceProxy proxy)
966 SequenceI[] rs = rslt.getSequencesArray();
968 for (String q : queries)
970 DBRefEntry dbr = new DBRefEntry();
971 dbr.setSource(proxy.getDbSource());
972 dbr.setVersion(null);
973 String accId = proxy.getAccessionIdFromQuery(q);
974 dbr.setAccessionId(accId);
975 boolean rfound = false;
976 for (int r = 0; r < rs.length; r++)
980 List<DBRefEntry> found = DBRefUtils.searchRefs(rs[r].getDBRefs(),
982 if (!found.isEmpty())
998 * @return a standard title for any results retrieved using the currently
999 * selected source and settings
1001 public String getDefaultRetrievalTitle()
1003 return "Retrieved from " + database.getSelectedItem();
1006 AlignmentI parseResult(AlignmentI al, String title,
1007 FileFormatI currentFileFormat,
1008 FeatureSettingsModelI preferredFeatureColours)
1011 if (al != null && al.getHeight() > 0)
1015 title = getDefaultRetrievalTitle();
1017 if (alignFrame == null)
1019 AlignFrame af = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
1020 AlignFrame.DEFAULT_HEIGHT);
1021 if (currentFileFormat != null)
1023 af.currentFileFormat = currentFileFormat; // WHAT IS THE DEFAULT
1025 // NON-FormatAdapter Sourced
1029 List<SequenceI> alsqs = al.getSequences();
1030 synchronized (alsqs)
1032 for (SequenceI sq : alsqs)
1034 if (sq.getFeatures().hasFeatures())
1036 af.setShowSeqFeatures(true);
1042 if (preferredFeatureColours != null)
1044 af.getViewport().applyFeaturesStyle(preferredFeatureColours);
1046 if (Cache.getDefault("HIDE_INTRONS", true))
1048 af.hideFeatureColumns(SequenceOntologyI.EXON, false);
1050 if (newAlframes != null)
1052 newAlframes.add(af);
1054 Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH,
1055 AlignFrame.DEFAULT_HEIGHT);
1057 af.statusBar.setText(MessageManager
1058 .getString("label.successfully_pasted_alignment_file"));
1062 af.setMaximum(Cache.getDefault("SHOW_FULLSCREEN", false));
1063 } catch (Exception ex)
1069 alignFrame.viewport.addAlignment(al, title);
1075 void showErrorMessage(final String error)
1078 javax.swing.SwingUtilities.invokeLater(new Runnable()
1083 JvOptionPane.showInternalMessageDialog(Desktop.desktop, error,
1084 MessageManager.getString("label.error_retrieving_data"),
1085 JvOptionPane.WARNING_MESSAGE);
1090 public IProgressIndicator getProgressIndicator()
1092 return progressIndicator;
1095 public void setProgressIndicator(IProgressIndicator progressIndicator)
1097 this.progressIndicator = progressIndicator;
1101 * Make this panel visible (after a selection has been made in the database
1106 frame.setVisible(true);
1110 * Hide this panel (on clicking the database button to open the database
1115 frame.setVisible(false);
1118 public void setDatabaseChooserVisible(boolean b)
1120 databaseButt.setVisible(b);