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.core.GFTSPanel;
30 import jalview.fts.service.pdb.PDBFTSPanel;
31 import jalview.fts.service.uniprot.UniprotFTSPanel;
32 import jalview.io.FileFormatI;
33 import jalview.io.gff.SequenceOntologyI;
34 import jalview.util.DBRefUtils;
35 import jalview.util.MessageManager;
36 import jalview.util.Platform;
37 import jalview.ws.dbsources.das.api.DasSourceRegistryI;
38 import jalview.ws.seqfetcher.DbSourceProxy;
40 import java.awt.BorderLayout;
42 import java.awt.event.ActionEvent;
43 import java.awt.event.ActionListener;
44 import java.awt.event.KeyAdapter;
45 import java.awt.event.KeyEvent;
46 import java.util.ArrayList;
47 import java.util.Arrays;
48 import java.util.Collections;
49 import java.util.Iterator;
50 import java.util.List;
52 import javax.swing.JButton;
53 import javax.swing.JCheckBox;
54 import javax.swing.JInternalFrame;
55 import javax.swing.JLabel;
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 JButton back = new JButton();
84 JPanel jPanel1 = new JPanel();
86 JTextArea textArea = new JTextArea();
88 JScrollPane jScrollPane1 = new JScrollPane();
90 JPanel jPanel2 = new JPanel();
92 JPanel jPanel3 = new JPanel();
94 JPanel jPanel4 = new JPanel();
96 BorderLayout borderLayout1 = new BorderLayout();
98 BorderLayout borderLayout2 = new BorderLayout();
100 BorderLayout borderLayout3 = new BorderLayout();
102 JInternalFrame frame;
104 IProgressIndicator guiWindow;
106 AlignFrame alignFrame;
110 final String noDbSelected = "-- Select Database --";
112 private static jalview.ws.SequenceFetcher sfetch = null;
114 private static long lastDasSourceRegistry = -3;
116 private static DasSourceRegistryI dasRegistry = null;
118 private static boolean _initingFetcher = false;
120 private static Thread initingThread = null;
122 public JTextArea getTextArea()
128 * Blocking method that initialises and returns the shared instance of the
129 * SequenceFetcher client
132 * - where the initialisation delay message should be shown
133 * @return the singleton instance of the sequence fetcher client
135 public static jalview.ws.SequenceFetcher getSequenceFetcherSingleton(
136 final IProgressIndicator guiWindow)
138 if (_initingFetcher && initingThread != null && initingThread.isAlive())
140 if (guiWindow != null)
142 guiWindow.setProgressBar(
143 MessageManager.getString(
144 "status.waiting_sequence_database_fetchers_init"),
145 Thread.currentThread().hashCode());
147 // initting happening on another thread - so wait around to see if it
149 while (_initingFetcher && initingThread != null
150 && initingThread.isAlive())
155 } catch (Exception e)
160 if (guiWindow != null)
162 guiWindow.setProgressBar(
163 MessageManager.getString(
164 "status.waiting_sequence_database_fetchers_init"),
165 Thread.currentThread().hashCode());
168 if (sfetch == null || dasRegistry != Cache.getDasSourceRegistry()
169 || lastDasSourceRegistry != (Cache.getDasSourceRegistry()
171 + Cache.getDasSourceRegistry().getLocalSourceString())
174 _initingFetcher = true;
175 initingThread = Thread.currentThread();
177 * give a visual indication that sequence fetcher construction is occuring
179 if (guiWindow != null)
181 guiWindow.setProgressBar(
182 MessageManager.getString(
183 "status.init_sequence_database_fetchers"),
184 Thread.currentThread().hashCode());
186 dasRegistry = Cache.getDasSourceRegistry();
187 dasRegistry.refreshSources();
189 jalview.ws.SequenceFetcher sf = new jalview.ws.SequenceFetcher();
190 if (guiWindow != null)
192 guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
194 lastDasSourceRegistry = (dasRegistry.getDasRegistryURL()
195 + dasRegistry.getLocalSourceString()).hashCode();
197 _initingFetcher = false;
198 initingThread = null;
203 private IProgressIndicator progressIndicator;
205 private volatile boolean _isConstructing = false;
207 private List<AlignFrame> newAlframes = null;
209 public SequenceFetcher(IProgressIndicator guiIndic)
211 this(guiIndic, null, null);
214 public SequenceFetcher(IProgressIndicator guiIndic,
215 final String selectedDb, final String queryString)
217 this._isConstructing = true;
218 this.progressIndicator = guiIndic;
219 final SequenceFetcher us = this;
220 // launch initialiser thread
221 Thread sf = new Thread(new Runnable()
227 if (getSequenceFetcherSingleton(progressIndicator) != null)
229 us.initGui(progressIndicator, selectedDb, queryString);
230 us._isConstructing = false;
234 javax.swing.SwingUtilities.invokeLater(new Runnable()
239 JvOptionPane.showInternalMessageDialog(Desktop.desktop,
240 MessageManager.getString(
241 "warn.couldnt_create_sequence_fetcher_client"),
242 MessageManager.getString(
243 "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[]
319 if (database.selection == null || database.selection.size() == 0)
322 "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)
384 ? MessageManager.getString("label.new_sequence_fetcher")
386 .getString("label.additional_sequence_fetcher"));
389 GFTSPanel parentFTSframe = null;
391 * change the buttons so they fit with the FTS panel.
393 public void embedWithFTSPanel(GFTSPanel toClose)
395 back.setVisible(true);
396 parentFTSframe = toClose;
398 private void jbInit() throws Exception
400 this.setLayout(borderLayout2);
402 database.setFont(JvSwingUtils.getLabelFont());
403 dbeg.setFont(new java.awt.Font("Verdana", Font.BOLD, 11));
404 jLabel1.setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
405 jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
406 jLabel1.setText(MessageManager
407 .getString("label.separate_multiple_accession_ids"));
409 replacePunctuation.setHorizontalAlignment(SwingConstants.CENTER);
411 .setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
412 replacePunctuation.setText(
413 MessageManager.getString("label.replace_commas_semicolons"));
414 ok.setText(MessageManager.getString("action.ok"));
415 ok.addActionListener(new ActionListener()
418 public void actionPerformed(ActionEvent e)
420 ok_actionPerformed();
423 clear.setText(MessageManager.getString("action.clear"));
424 clear.addActionListener(new ActionListener()
427 public void actionPerformed(ActionEvent e)
429 clear_actionPerformed();
433 example.setText(MessageManager.getString("label.example"));
434 example.addActionListener(new ActionListener()
437 public void actionPerformed(ActionEvent e)
439 example_actionPerformed();
442 close.setText(MessageManager.getString("action.cancel"));
443 close.addActionListener(new ActionListener()
446 public void actionPerformed(ActionEvent e)
448 close_actionPerformed(e);
451 back.setText(MessageManager.getString("action.back"));
452 back.addActionListener(new ActionListener()
455 public void actionPerformed(ActionEvent e)
457 parentFTSframe.btn_back_ActionPerformed();
460 // back not visible unless embedded
461 back.setVisible(false);
462 textArea.setFont(JvSwingUtils.getLabelFont());
463 textArea.setLineWrap(true);
464 textArea.addKeyListener(new KeyAdapter()
467 public void keyPressed(KeyEvent e)
469 if (e.getKeyCode() == KeyEvent.VK_ENTER)
471 ok_actionPerformed();
475 jPanel3.setLayout(borderLayout1);
476 borderLayout1.setVgap(5);
478 jPanel1.add(example);
482 jPanel2.setLayout(borderLayout3);
483 databaseButt = /*database.getDatabaseSelectorButton();
484 final JButton viewdbs =*/new JButton(
485 MessageManager.getString("action.select_ddbb"));
486 databaseButt.addActionListener(new ActionListener()
490 public void actionPerformed(ActionEvent arg0)
493 database.showDialog();
496 databaseButt.setFont(JvSwingUtils.getLabelFont());
497 database.addActionListener(new ActionListener()
500 public void actionPerformed(ActionEvent e)
502 String currentSelection = database.getSelectedItem();
503 if (currentSelection == null)
505 close_actionPerformed(null);
510 if ("pdb".equalsIgnoreCase(currentSelection))
514 else if ("uniprot".equalsIgnoreCase(currentSelection))
516 uniprotSourceAction();
522 database.action = -1;
527 jPanel2.add(databaseButt, java.awt.BorderLayout.NORTH);
528 jPanel2.add(dbeg, java.awt.BorderLayout.CENTER);
529 JPanel jPanel2a = new JPanel(new BorderLayout());
530 jPanel2a.add(jLabel1, java.awt.BorderLayout.NORTH);
531 jPanel2a.add(replacePunctuation, java.awt.BorderLayout.SOUTH);
532 jPanel2.add(jPanel2a, java.awt.BorderLayout.SOUTH);
533 // jPanel2.setPreferredSize(new Dimension())
534 jPanel3.add(jScrollPane1, java.awt.BorderLayout.CENTER);
535 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
536 this.add(jPanel3, java.awt.BorderLayout.CENTER);
537 this.add(jPanel2, java.awt.BorderLayout.NORTH);
538 jScrollPane1.getViewport().add(textArea);
541 private void pdbSourceAction()
543 databaseButt.setText(database.getSelectedItem());
544 new PDBFTSPanel(this);
548 private void uniprotSourceAction()
550 databaseButt.setText(database.getSelectedItem());
551 new UniprotFTSPanel(this);
555 private void otherSourceAction()
559 databaseButt.setText(database.getSelectedItem()
560 + (database.getSelectedSources().size() > 1 ? " (and "
561 + database.getSelectedSources().size() + " others)"
563 String eq = database.getExampleQueries();
564 dbeg.setText(MessageManager.formatMessage("label.example_query_param",
567 boolean enablePunct = !(eq != null && eq.indexOf(",") > -1);
568 for (DbSourceProxy dbs : database.getSelectedSources())
570 if (dbs instanceof jalview.ws.dbsources.das.datamodel.DasSequenceSource)
576 replacePunctuation.setEnabled(enablePunct);
578 } catch (Exception ex)
581 replacePunctuation.setEnabled(true);
586 protected void example_actionPerformed()
588 DbSourceProxy db = null;
591 textArea.setText(database.getExampleQueries());
592 } catch (Exception ex)
598 protected void clear_actionPerformed()
600 textArea.setText("");
604 public void close_actionPerformed(ActionEvent e)
608 frame.setClosed(true);
609 if (parentFTSframe!=null)
611 parentFTSframe.btn_cancel_ActionPerformed();
613 } catch (Exception ex)
618 public void ok_actionPerformed()
620 databaseButt.setEnabled(false);
621 example.setEnabled(false);
622 textArea.setEnabled(false);
623 ok.setEnabled(false);
624 close.setEnabled(false);
625 back.setEnabled(false);
626 Thread worker = new Thread(this);
630 private void resetDialog()
632 databaseButt.setEnabled(true);
633 example.setEnabled(true);
634 textArea.setEnabled(true);
636 close.setEnabled(true);
637 back.setEnabled(parentFTSframe != null);
644 if (!database.hasSelection())
646 error += "Please select the source database\n";
648 // TODO: make this transformation more configurable
649 com.stevesoft.pat.Regex empty;
650 if (replacePunctuation.isEnabled() && replacePunctuation.isSelected())
652 empty = new com.stevesoft.pat.Regex(
653 // replace commas and spaces with a semicolon
654 "(\\s|[,; ])+", ";");
658 // just turn spaces and semicolons into single semicolons
659 empty = new com.stevesoft.pat.Regex("(\\s|[; ])+", ";");
661 textArea.setText(empty.replaceAll(textArea.getText()));
662 // see if there's anthing to search with
663 if (!new com.stevesoft.pat.Regex("[A-Za-z0-9_.]")
664 .search(textArea.getText()))
666 error += "Please enter a (semi-colon separated list of) database id(s)";
668 if (error.length() > 0)
670 showErrorMessage(error);
674 // TODO: Refactor to GUI independent code and write tests.
675 // indicate if successive sources should be merged into one alignment.
676 boolean addToLast = false;
677 List<String> aresultq = new ArrayList<String>();
678 List<String> presultTitle = new ArrayList<String>();
679 List<AlignmentI> presult = new ArrayList<AlignmentI>();
680 List<AlignmentI> aresult = new ArrayList<AlignmentI>();
681 Iterator<DbSourceProxy> proxies = database.getSelectedSources()
684 List<String> nextFetch = Arrays
685 .asList(qries = textArea.getText().split(";"));
686 Iterator<String> en = Arrays.asList(new String[0]).iterator();
687 int nqueries = qries.length;
689 FeatureSettingsModelI preferredFeatureColours = null;
690 while (proxies.hasNext() && (en.hasNext() || nextFetch.size() > 0))
692 if (!en.hasNext() && nextFetch.size() > 0)
694 en = nextFetch.iterator();
695 nqueries = nextFetch.size();
696 // save the remaining queries in the original array
697 qries = nextFetch.toArray(new String[nqueries]);
698 nextFetch = new ArrayList<String>();
701 DbSourceProxy proxy = proxies.next();
705 guiWindow.setProgressBar(MessageManager.formatMessage(
706 "status.fetching_sequence_queries_from", new String[]
707 { Integer.valueOf(nqueries).toString(),
708 proxy.getDbName() }),
709 Thread.currentThread().hashCode());
710 if (proxy.getMaximumQueryCount() == 1)
713 * proxy only handles one accession id at a time
717 String acc = en.next();
718 if (!fetchSingleAccession(proxy, acc, aresultq, aresult))
727 * proxy can fetch multiple accessions at one time
729 fetchMultipleAccessions(proxy, en, aresultq, aresult, nextFetch);
731 } catch (Exception e)
733 showErrorMessage("Error retrieving " + textArea.getText() + " from "
734 + database.getSelectedItem());
736 // +="Couldn't retrieve sequences from "+database.getSelectedItem();
737 System.err.println("Retrieval failed for source ='"
738 + database.getSelectedItem() + "' and query\n'"
739 + textArea.getText() + "'\n");
741 } catch (OutOfMemoryError e)
743 showErrorMessage("Out of Memory when retrieving "
744 + textArea.getText() + " from " + database.getSelectedItem()
745 + "\nPlease see the Jalview FAQ for instructions for increasing the memory available to Jalview.\n");
749 showErrorMessage("Serious Error retrieving " + textArea.getText()
750 + " from " + database.getSelectedItem());
754 // Stack results ready for opening in alignment windows
755 if (aresult != null && aresult.size() > 0)
757 FeatureSettingsModelI proxyColourScheme = proxy
758 .getFeatureColourScheme();
759 if (proxyColourScheme != null)
761 preferredFeatureColours = proxyColourScheme;
764 AlignmentI ar = null;
765 if (proxy.isAlignmentSource())
768 // new window for each result
769 while (aresult.size() > 0)
771 presult.add(aresult.remove(0));
773 aresultq.remove(0) + " " + getDefaultRetrievalTitle());
779 if (addToLast && presult.size() > 0)
781 ar = presult.remove(presult.size() - 1);
782 titl = presultTitle.remove(presultTitle.size() - 1);
784 // concatenate all results in one window
785 while (aresult.size() > 0)
789 ar = aresult.remove(0);
793 ar.append(aresult.remove(0));
798 presultTitle.add(titl);
801 guiWindow.setProgressBar(
802 MessageManager.getString("status.finshed_querying"),
803 Thread.currentThread().hashCode());
809 .getString("status.parsing_results")
810 : MessageManager.getString("status.processing"),
811 Thread.currentThread().hashCode());
813 while (presult.size() > 0)
815 parseResult(presult.remove(0), presultTitle.remove(0), null,
816 preferredFeatureColours);
818 // only remove visual delay after we finished parsing.
819 guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
820 if (nextFetch.size() > 0)
822 StringBuffer sb = new StringBuffer();
823 sb.append("Didn't retrieve the following "
824 + (nextFetch.size() == 1 ? "query"
825 : nextFetch.size() + " queries")
827 int l = sb.length(), lr = 0;
828 for (String s : nextFetch)
830 if (l != sb.length())
834 if (lr - sb.length() > 40)
840 showErrorMessage(sb.toString());
846 * Tries to fetch one or more accession ids from the database proxy
850 * the queries to fetch
852 * a successful queries list to add to
854 * a list of retrieved alignments to add to
856 * failed queries are added to this list
859 void fetchMultipleAccessions(DbSourceProxy proxy,
860 Iterator<String> accessions, List<String> aresultq,
861 List<AlignmentI> aresult, List<String> nextFetch) throws Exception
863 StringBuilder multiacc = new StringBuilder();
864 List<String> tosend = new ArrayList<String>();
865 while (accessions.hasNext())
867 String nel = accessions.next();
869 multiacc.append(nel);
870 if (accessions.hasNext())
872 multiacc.append(proxy.getAccessionSeparator());
878 String query = multiacc.toString();
879 AlignmentI rslt = proxy.getSequenceRecords(query);
880 if (rslt == null || rslt.getHeight() == 0)
882 // no results - pass on all queries to next source
883 nextFetch.addAll(tosend);
889 if (tosend.size() > 1)
891 checkResultForQueries(rslt, tosend, nextFetch, proxy);
894 } catch (OutOfMemoryError oome)
896 new OOMWarning("fetching " + multiacc + " from "
897 + database.getSelectedItem(), oome, this);
902 * Query for a single accession id via the database proxy
907 * a list of successful queries to add to
909 * a list of retrieved alignments to add to
910 * @return true if the fetch was successful, else false
912 boolean fetchSingleAccession(DbSourceProxy proxy, String accession,
913 List<String> aresultq, List<AlignmentI> aresult)
915 boolean success = false;
922 // give the server a chance to breathe
924 } catch (Exception e)
930 AlignmentI indres = null;
933 indres = proxy.getSequenceRecords(accession);
934 } catch (OutOfMemoryError oome)
937 "fetching " + accession + " from " + proxy.getDbName(),
942 aresultq.add(accession);
946 } catch (Exception e)
948 Cache.log.info("Error retrieving " + accession + " from "
949 + proxy.getDbName(), e);
955 * Checks which of the queries were successfully retrieved by searching the
956 * DBRefs of the retrieved sequences for a match. Any not found are added to
957 * the 'nextFetch' list.
964 void checkResultForQueries(AlignmentI rslt, List<String> queries,
965 List<String> nextFetch, DbSourceProxy proxy)
967 SequenceI[] rs = rslt.getSequencesArray();
969 for (String q : queries)
971 DBRefEntry dbr = new DBRefEntry();
972 dbr.setSource(proxy.getDbSource());
973 dbr.setVersion(null);
974 String accId = proxy.getAccessionIdFromQuery(q);
975 dbr.setAccessionId(accId);
976 boolean rfound = false;
977 for (int r = 0; r < rs.length; r++)
981 List<DBRefEntry> found = DBRefUtils.searchRefs(rs[r].getDBRefs(),
983 if (!found.isEmpty())
999 * @return a standard title for any results retrieved using the currently
1000 * selected source and settings
1002 public String getDefaultRetrievalTitle()
1004 return "Retrieved from " + database.getSelectedItem();
1007 AlignmentI parseResult(AlignmentI al, String title,
1008 FileFormatI currentFileFormat,
1009 FeatureSettingsModelI preferredFeatureColours)
1012 if (al != null && al.getHeight() > 0)
1016 title = getDefaultRetrievalTitle();
1018 if (alignFrame == null)
1020 AlignFrame af = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
1021 AlignFrame.DEFAULT_HEIGHT);
1022 if (currentFileFormat != null)
1024 af.currentFileFormat = currentFileFormat; // WHAT IS THE DEFAULT
1026 // NON-FormatAdapter Sourced
1030 SequenceFeature[] sfs = null;
1031 List<SequenceI> alsqs;
1032 synchronized (alsqs = al.getSequences())
1034 for (SequenceI sq : alsqs)
1036 if (sq.getFeatures().hasFeatures())
1038 af.setShowSeqFeatures(true);
1044 if (preferredFeatureColours != null)
1046 af.getViewport().applyFeaturesStyle(preferredFeatureColours);
1048 if (Cache.getDefault("HIDE_INTRONS", true))
1050 af.hideFeatureColumns(SequenceOntologyI.EXON, false);
1052 if (newAlframes != null)
1054 newAlframes.add(af);
1056 Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH,
1057 AlignFrame.DEFAULT_HEIGHT);
1059 af.statusBar.setText(MessageManager
1060 .getString("label.successfully_pasted_alignment_file"));
1064 af.setMaximum(Cache.getDefault("SHOW_FULLSCREEN", false));
1065 } catch (Exception ex)
1071 alignFrame.viewport.addAlignment(al, title);
1077 void showErrorMessage(final String error)
1080 javax.swing.SwingUtilities.invokeLater(new Runnable()
1085 JvOptionPane.showInternalMessageDialog(Desktop.desktop, error,
1086 MessageManager.getString("label.error_retrieving_data"),
1087 JvOptionPane.WARNING_MESSAGE);
1092 public IProgressIndicator getProgressIndicator()
1094 return progressIndicator;
1097 public void setProgressIndicator(IProgressIndicator progressIndicator)
1099 this.progressIndicator = progressIndicator;
1103 * Make this panel visible (after a selection has been made in the database
1108 frame.setVisible(true);
1112 * Hide this panel (on clicking the database button to open the database
1117 frame.setVisible(false);
1120 public void setDatabaseChooserVisible(boolean b)
1122 databaseButt.setVisible(b);