2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
\r
3 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
\r
5 * This file is part of Jalview.
\r
7 * Jalview is free software: you can redistribute it and/or
\r
8 * modify it under the terms of the GNU General Public License
\r
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
\r
11 * Jalview is distributed in the hope that it will be useful, but
\r
12 * WITHOUT ANY WARRANTY; without even the implied warranty
\r
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
\r
14 * PURPOSE. See the GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
\r
18 package jalview.gui;
\r
23 import java.awt.event.*;
\r
24 import javax.swing.*;
\r
25 import javax.swing.event.*;
\r
26 import javax.swing.table.*;
\r
28 import org.biojava.dasobert.dasregistry.*;
\r
29 import jalview.jbgui.*;
\r
30 import jalview.util.*;
\r
32 public class DasSourceBrowser extends GDasSourceBrowser implements
\r
33 Runnable, ListSelectionListener
\r
35 static DasSource[] dasSources = null;
\r
37 Hashtable localSources = null;
\r
39 Vector selectedSources;
\r
41 public static String DEFAULT_REGISTRY = "http://www.dasregistry.org/das1/sources/";
\r
44 * true if thread is running and we are talking to DAS registry service
\r
46 public boolean loadingDasSources = false;
\r
48 protected static String getDasRegistryURL()
\r
50 String registry = jalview.bin.Cache.getDefault("DAS_REGISTRY_URL",
\r
53 if (registry.indexOf("/registry/das1/sources/") > -1)
\r
55 jalview.bin.Cache.setProperty(jalview.bin.Cache.DAS_REGISTRY_URL,
\r
57 registry = DEFAULT_REGISTRY;
\r
62 public DasSourceBrowser(FeatureSettings featureSettings)
\r
64 fs = featureSettings;
\r
65 String registry = getDasRegistryURL();
\r
67 registryURL.setText(registry);
\r
69 setSelectedFromProperties();
\r
71 displayFullDetails(null);
\r
72 table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
\r
74 filter1.addListSelectionListener(this);
\r
75 filter2.addListSelectionListener(this);
\r
76 filter3.addListSelectionListener(this);
\r
78 // Ask to be notified of selection changes.
\r
79 ListSelectionModel rowSM = table.getSelectionModel();
\r
80 rowSM.addListSelectionListener(new ListSelectionListener()
\r
82 public void valueChanged(ListSelectionEvent e)
\r
84 ListSelectionModel lsm = (ListSelectionModel) e.getSource();
\r
85 if (!lsm.isSelectionEmpty())
\r
87 int selectedRow = lsm.getMinSelectionIndex();
\r
88 displayFullDetails(table.getValueAt(selectedRow, 0).toString());
\r
93 table.addMouseListener(new MouseAdapter()
\r
95 public void mouseClicked(MouseEvent evt)
\r
97 if (evt.getClickCount() == 2
\r
98 || SwingUtilities.isRightMouseButton(evt))
\r
100 editRemoveLocalSource(evt);
\r
105 if (dasSources != null)
\r
111 FeatureSettings fs = null;
\r
113 public DasSourceBrowser()
\r
118 public void paintComponent(java.awt.Graphics g)
\r
120 if (dasSources == null && !loadingDasSources)
\r
122 Thread worker = new Thread(this);
\r
129 int dSize = dasSources.length;
\r
130 Object[][] data = new Object[dSize][2];
\r
131 for (int i = 0; i < dSize; i++)
\r
133 data[i][0] = dasSources[i].getNickname();
\r
134 data[i][1] = new Boolean(selectedSources.contains(dasSources[i]
\r
138 refreshTableData(data);
\r
139 setCapabilities(dasSources);
\r
141 javax.swing.SwingUtilities.invokeLater(new Runnable()
\r
145 TableSorter sorter = (TableSorter) table.getModel();
\r
146 sorter.setSortingStatus(1, TableSorter.DESCENDING);
\r
147 sorter.setSortingStatus(1, TableSorter.NOT_SORTED);
\r
151 progressBar.setIndeterminate(false);
\r
152 progressBar.setVisible(false);
\r
153 addLocal.setVisible(true);
\r
154 refresh.setVisible(true);
\r
157 public void refreshTableData(Object[][] data)
\r
159 TableSorter sorter = new TableSorter(new DASTableModel(data));
\r
160 sorter.setTableHeader(table.getTableHeader());
\r
161 table.setModel(sorter);
\r
164 void displayFullDetails(String nickName)
\r
167 StringBuffer text = new StringBuffer(
\r
168 "<HTML><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\">");
\r
170 if (nickName == null)
\r
172 fullDetails.setText(text + "Select a DAS service from the table"
\r
173 + " to read a full description here.</font></html>");
\r
177 int dSize = dasSources.length;
\r
178 for (int i = 0; i < dSize; i++)
\r
180 if (!dasSources[i].getNickname().equals(nickName))
\r
185 DasSource ds = dasSources[i];
\r
187 text.append("<font color=\"#0000FF\">Id:</font> "
\r
188 + dasSources[i].getId() + "<br>");
\r
189 text.append("<font color=\"#0000FF\">Nickname:</font> "
\r
190 + dasSources[i].getNickname() + "<br>");
\r
191 text.append("<font color=\"#0000FF\">URL:</font> "
\r
192 + dasSources[i].getUrl() + "<br>");
\r
194 text.append("<font color=\"#0000FF\">Admin Email:</font> <a href=\"mailto:"
\r
195 + dasSources[i].getAdminemail()
\r
197 + dasSources[i].getAdminemail() + "</a>" + "<br>");
\r
199 text.append("<font color=\"#0000FF\">Registered at:</font> "
\r
200 + dasSources[i].getRegisterDate() + "<br>");
\r
202 text.append("<font color=\"#0000FF\">Last successful test:</font> "
\r
203 + dasSources[i].getLeaseDate() + "<br>");
\r
205 text.append("<font color=\"#0000FF\">Labels:</font> ");
\r
206 for (int s = 0; s < dasSources[i].getLabels().length; s++)
\r
208 text.append(dasSources[i].getLabels()[s]);
\r
209 if (s < dasSources[i].getLabels().length - 1)
\r
215 text.append("<br>");
\r
217 text.append("<font color=\"#0000FF\">Capabilities:</font> ");
\r
218 String[] scap = dasSources[i].getCapabilities();
\r
219 for (int j = 0; j < scap.length; j++)
\r
221 text.append(scap[j]);
\r
222 if (j < scap.length - 1)
\r
227 text.append("<br>");
\r
229 text.append("<font color=\"#0000FF\">Coordinates:</font> ");
\r
230 DasCoordinateSystem[] dcs = ds.getCoordinateSystem();
\r
231 for (int j = 0; j < dcs.length; j++)
\r
233 text.append("(" + dcs[j].getUniqueId() + ") "
\r
234 + dcs[j].getCategory() + ", " + dcs[j].getName());
\r
235 if (dcs[j].getNCBITaxId() != 0)
\r
237 text.append(", " + dcs[j].getNCBITaxId());
\r
239 if (dcs[j].getOrganismName().length() > 0)
\r
241 text.append(", " + dcs[j].getOrganismName());
\r
244 text.append("<br>");
\r
247 text.append("<font color=\"#0000FF\">Description:</font> "
\r
248 + dasSources[i].getDescription() + "<br>");
\r
250 if (dasSources[i].getHelperurl() != null
\r
251 && dasSources[i].getHelperurl().length() > 0)
\r
253 text.append("<font color=\"#0000FF\"><a href=\""
\r
254 + dasSources[i].getHelperurl()
\r
255 + "\">Go to site</a></font<br>");
\r
258 text.append("</font></html>");
\r
263 fullDetails.setText(text.toString());
\r
264 javax.swing.SwingUtilities.invokeLater(new Runnable()
\r
268 fullDetailsScrollpane.getVerticalScrollBar().setValue(0);
\r
275 loadingDasSources = true;
\r
277 addLocal.setVisible(false);
\r
278 refresh.setVisible(false);
\r
279 progressBar.setVisible(true);
\r
280 progressBar.setIndeterminate(true);
\r
281 setParentGuiEnabled(false);
\r
282 // Refresh the source list.
\r
288 setParentGuiEnabled(true);
\r
289 loadingDasSources = false;
\r
293 private void setParentGuiEnabled(boolean b)
\r
297 fs.fetchDAS.setEnabled(b);
\r
298 fs.saveDAS.setEnabled(b);
\r
302 public Vector getSelectedSources()
\r
304 // wait around if we're still loading.
\r
305 while (dasSources == null)
\r
307 if (!loadingDasSources)
\r
309 new Thread(this).start();
\r
313 } catch (Exception e)
\r
317 while (loadingDasSources)
\r
322 } catch (Exception e)
\r
331 Vector selected = new Vector();
\r
332 for (int r = 0; r < selectedSources.size(); r++)
\r
334 for (int i = 0; i < dasSources.length; i++)
\r
336 if (dasSources[i].getNickname()
\r
337 .equals(selectedSources.elementAt(r)))
\r
339 selected.addElement(dasSources[i]);
\r
349 * retrieve das sources from registry and add local source list
\r
353 public DasSource[] getDASSource()
\r
355 if (dasSources == null)
\r
357 dasSources = jalview.ws.DasSequenceFeatureFetcher.getDASSources();
\r
358 appendLocalSources();
\r
364 public void refresh_actionPerformed(ActionEvent e)
\r
366 saveProperties(jalview.bin.Cache.applicationProperties);
\r
368 Thread worker = new Thread(this);
\r
372 private void setCapabilities(DasSource[] sources)
\r
374 Vector authority = new Vector();
\r
375 Vector type = new Vector();
\r
376 Vector label = new Vector();
\r
378 authority.addElement("Any");
\r
379 type.addElement("Any");
\r
380 label.addElement("Any");
\r
382 for (int i = 0; i < sources.length; i++)
\r
384 DasSource ds = sources[i];
\r
386 DasCoordinateSystem[] dcs = ds.getCoordinateSystem();
\r
388 for (int j = 0; j < dcs.length; j++)
\r
390 if (!type.contains(dcs[j].getCategory()))
\r
392 type.addElement(dcs[j].getCategory());
\r
395 if (!authority.contains(dcs[j].getName()))
\r
397 authority.addElement(dcs[j].getName());
\r
401 String[] slabels = ds.getLabels();
\r
402 for (int s = 0; s < slabels.length; s++)
\r
404 if (!label.contains(slabels[s]))
\r
406 label.addElement(slabels[s]);
\r
412 filter1.setListData(authority);
\r
413 filter2.setListData(type);
\r
414 filter3.setListData(label);
\r
416 javax.swing.SwingUtilities.invokeLater(new Runnable()
\r
420 filter1.setSelectedIndex(0);
\r
421 filter2.setSelectedIndex(0);
\r
422 filter3.setSelectedIndex(0);
\r
427 public void amendLocal(boolean newSource)
\r
429 String url = "http://localhost:8080/", nickname = "";
\r
430 boolean seqsrc = false;
\r
433 int selectedRow = table.getSelectionModel().getMinSelectionIndex();
\r
434 nickname = table.getValueAt(selectedRow, 0).toString();
\r
435 url = ((DasSource) localSources.get(nickname)).getUrl();
\r
436 seqsrc = ((DasSource) localSources.get(nickname))
\r
437 .hasCapability("sequence");
\r
440 JTextField nametf = new JTextField(nickname, 40);
\r
441 JTextField urltf = new JTextField(url, 40);
\r
442 JCheckBox seqs = new JCheckBox("Sequence Source");
\r
443 seqs.setSelected(seqsrc);
\r
444 JPanel panel = new JPanel(new BorderLayout());
\r
445 JPanel pane12 = new JPanel(new BorderLayout());
\r
446 pane12.add(new JLabel("Nickname: "), BorderLayout.CENTER);
\r
447 pane12.add(nametf, BorderLayout.EAST);
\r
448 panel.add(pane12, BorderLayout.NORTH);
\r
449 pane12 = new JPanel(new BorderLayout());
\r
450 pane12.add(new JLabel("URL: "), BorderLayout.NORTH);
\r
451 pane12.add(seqs, BorderLayout.SOUTH);
\r
452 pane12.add(urltf, BorderLayout.EAST);
\r
453 panel.add(pane12, BorderLayout.SOUTH);
\r
455 int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
\r
456 panel, "Enter Nickname & URL of Local DAS Source",
\r
457 JOptionPane.OK_CANCEL_OPTION);
\r
459 if (reply != JOptionPane.OK_OPTION)
\r
464 if (!urltf.getText().endsWith("/"))
\r
466 urltf.setText(urltf.getText() + "/");
\r
469 Das1Source local = new Das1Source();
\r
471 local.setUrl(urltf.getText());
\r
472 local.setNickname(nametf.getText());
\r
473 if (seqs.isSelected())
\r
475 local.setCapabilities(new String[]
\r
476 { "features", "sequence" });
\r
478 if (localSources == null)
\r
480 localSources = new Hashtable();
\r
483 localSources.put(local.getNickname(), local);
\r
485 if (!newSource && !nickname.equals(nametf.getText()))
\r
487 localSources.remove(nickname);
\r
490 int size = dasSources.length;
\r
491 int adjust = newSource ? 1 : 0;
\r
493 Object[][] data = new Object[size + adjust][2];
\r
494 for (int i = 0; i < size; i++)
\r
496 if (!newSource && dasSources[i].getNickname().equals(nickname))
\r
498 ((DasSource) dasSources[i]).setNickname(local.getNickname());
\r
499 ((DasSource) dasSources[i]).setUrl(local.getUrl());
\r
500 data[i][0] = local.getNickname();
\r
501 data[i][1] = new Boolean(true);
\r
505 data[i][0] = dasSources[i].getNickname();
\r
506 data[i][1] = new Boolean(selectedSources.contains(dasSources[i]
\r
513 data[size][0] = local.getNickname();
\r
514 data[size][1] = new Boolean(true);
\r
515 selectedSources.add(local.getNickname());
\r
518 DasSource[] tmp = new DasSource[size + adjust];
\r
520 System.arraycopy(dasSources, 0, tmp, 0, size);
\r
529 refreshTableData(data);
\r
531 SwingUtilities.invokeLater(new Runnable()
\r
535 scrollPane.getVerticalScrollBar().setValue(
\r
536 scrollPane.getVerticalScrollBar().getMaximum());
\r
540 displayFullDetails(local.getNickname());
\r
543 public void editRemoveLocalSource(MouseEvent evt)
\r
545 int selectedRow = table.getSelectionModel().getMinSelectionIndex();
\r
546 if (selectedRow == -1)
\r
551 String nickname = table.getValueAt(selectedRow, 0).toString();
\r
553 if (!localSources.containsKey(nickname))
\r
555 JOptionPane.showInternalMessageDialog(Desktop.desktop,
\r
556 "You can only edit or remove local DAS Sources!",
\r
557 "Public DAS source - not editable",
\r
558 JOptionPane.WARNING_MESSAGE);
\r
563 { "Edit", "Remove", "Cancel" };
\r
564 int choice = JOptionPane.showInternalOptionDialog(Desktop.desktop,
\r
565 "Do you want to edit or remove " + nickname + "?",
\r
566 "Edit / Remove Local DAS Source",
\r
567 JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,
\r
568 null, options, options[2]);
\r
576 localSources.remove(nickname);
\r
577 selectedSources.remove(nickname);
\r
578 Object[][] data = new Object[dasSources.length - 1][2];
\r
579 DasSource[] tmp = new DasSource[dasSources.length - 1];
\r
581 for (int i = 0; i < dasSources.length; i++)
\r
583 if (dasSources[i].getNickname().equals(nickname))
\r
589 tmp[index] = dasSources[i];
\r
590 data[index][0] = dasSources[i].getNickname();
\r
591 data[index][1] = new Boolean(
\r
592 selectedSources.contains(dasSources[i].getNickname()));
\r
597 refreshTableData(data);
\r
598 SwingUtilities.invokeLater(new Runnable()
\r
602 scrollPane.getVerticalScrollBar().setValue(
\r
603 scrollPane.getVerticalScrollBar().getMaximum());
\r
611 void appendLocalSources()
\r
613 if (localSources == null)
\r
617 // note - we add all das sources to list so they can be filtered for the
\r
618 // standard fetchDbRefs function
\r
619 int size = dasSources != null ? dasSources.length : 0;
\r
620 int lsize = localSources.size();
\r
622 Object[][] data = new Object[size + lsize][2];
\r
623 for (int i = 0; i < size; i++)
\r
625 data[i][0] = dasSources[i].getNickname();
\r
626 data[i][1] = new Boolean(selectedSources.contains(dasSources[i]
\r
630 DasSource[] tmp = new DasSource[size + lsize];
\r
631 if (dasSources != null)
\r
633 System.arraycopy(dasSources, 0, tmp, 0, size);
\r
636 Enumeration en = localSources.keys();
\r
638 while (en.hasMoreElements())
\r
640 String key = en.nextElement().toString();
\r
641 data[index][0] = key;
\r
642 data[index][1] = new Boolean(false);
\r
643 tmp[index] = new Das1Source();
\r
644 tmp[index].setNickname(key);
\r
645 tmp[index].setUrl(((DasSource) localSources.get(key)).getUrl());
\r
652 refreshTableData(data);
\r
655 public void valueChanged(ListSelectionEvent evt)
\r
657 // Called when the MainTable selection changes
\r
658 if (evt.getValueIsAdjusting())
\r
663 displayFullDetails(null);
\r
665 // Filter the displayed data sources
\r
666 int dSize = dasSources.length;
\r
668 ArrayList names = new ArrayList();
\r
669 ArrayList selected = new ArrayList();
\r
672 // The features filter is not visible, but we must still
\r
673 // filter the das source list here.
\r
674 // July 2006 - only 6 sources fo not serve features
\r
675 Object[] dummyFeatureList = new Object[]
\r
678 for (int i = 0; i < dSize; i++)
\r
680 ds = dasSources[i];
\r
681 DasCoordinateSystem[] dcs = ds.getCoordinateSystem();
\r
683 if (dcs.length == 0 && ds.getCapabilities().length == 0
\r
684 && filter1.getSelectedIndex() == 0
\r
685 && filter2.getSelectedIndex() == 0
\r
686 && filter3.getSelectedIndex() == 0)
\r
688 // THIS IS A FIX FOR LOCAL SOURCES WHICH DO NOT
\r
689 // HAVE COORDINATE SYSTEMS, INFO WHICH AT PRESENT
\r
690 // IS ADDED FROM THE REGISTRY
\r
691 names.add(ds.getNickname());
\r
692 selected.add(new Boolean(selectedSources.contains(ds.getNickname())));
\r
696 if (!selectedInList(dummyFeatureList, ds.getCapabilities())
\r
697 || !selectedInList(filter3.getSelectedValues(),
\r
703 for (int j = 0; j < dcs.length; j++)
\r
705 if (selectedInList(filter1.getSelectedValues(), new String[]
\r
706 { dcs[j].getName() })
\r
707 && selectedInList(filter2.getSelectedValues(), new String[]
\r
708 { dcs[j].getCategory() }))
\r
710 names.add(ds.getNickname());
\r
711 selected.add(new Boolean(selectedSources.contains(ds
\r
718 dSize = names.size();
\r
719 Object[][] data = new Object[dSize][2];
\r
720 for (int d = 0; d < dSize; d++)
\r
722 data[d][0] = names.get(d);
\r
723 data[d][1] = selected.get(d);
\r
726 refreshTableData(data);
\r
729 boolean selectedInList(Object[] selection, String[] items)
\r
731 for (int i = 0; i < selection.length; i++)
\r
733 if (selection[i].equals("Any"))
\r
738 for (int j = 0; j < items.length; j++)
\r
740 if (selection[i].equals(items[j]))
\r
750 void setSelectedFromProperties()
\r
752 String active = jalview.bin.Cache.getDefault("DAS_ACTIVE_SOURCE",
\r
754 StringTokenizer st = new StringTokenizer(active, "\t");
\r
755 selectedSources = new Vector();
\r
756 while (st.hasMoreTokens())
\r
758 selectedSources.addElement(st.nextToken());
\r
761 Vector _localSources = jalview.bin.Cache.getLocalDasSources();
\r
762 if (_localSources != null)
\r
764 if (localSources == null)
\r
766 localSources = new Hashtable();
\r
768 Enumeration sources = _localSources.elements();
\r
769 while (sources.hasMoreElements())
\r
771 Das1Source source = (Das1Source) sources.nextElement();
\r
772 localSources.put(source.getNickname(), source);
\r
777 public void reset_actionPerformed(ActionEvent e)
\r
779 registryURL.setText(DEFAULT_REGISTRY);
\r
783 * set the DAS source settings in the given jalview properties.
\r
785 * @param properties
\r
787 public void saveProperties(Properties properties)
\r
789 if (registryURL.getText() == null || registryURL.getText().length() < 1)
\r
791 properties.remove(jalview.bin.Cache.DAS_REGISTRY_URL);
\r
795 properties.setProperty(jalview.bin.Cache.DAS_REGISTRY_URL,
\r
796 registryURL.getText());
\r
799 StringBuffer sb = new StringBuffer();
\r
800 for (int r = 0; r < table.getModel().getRowCount(); r++)
\r
802 if (((Boolean) table.getValueAt(r, 1)).booleanValue())
\r
804 sb.append(table.getValueAt(r, 0) + "\t");
\r
808 properties.setProperty(jalview.bin.Cache.DAS_ACTIVE_SOURCE,
\r
811 if (localSources != null)
\r
813 sb = new StringBuffer();
\r
814 Enumeration en = localSources.keys();
\r
815 while (en.hasMoreElements())
\r
817 String token = en.nextElement().toString();
\r
820 + (((DasSource) localSources.get(token))
\r
821 .hasCapability("sequence") ? "sequence:" : "")
\r
822 + ((DasSource) localSources.get(token)).getUrl() + "\t");
\r
825 properties.setProperty(jalview.bin.Cache.DAS_LOCAL_SOURCE,
\r
831 class DASTableModel extends AbstractTableModel
\r
834 public DASTableModel(Object[][] data)
\r
839 private String[] columnNames = new String[]
\r
840 { "Nickname", "Use Source" };
\r
842 private Object[][] data;
\r
844 public int getColumnCount()
\r
846 return columnNames.length;
\r
849 public int getRowCount()
\r
851 return data.length;
\r
854 public String getColumnName(int col)
\r
856 return columnNames[col];
\r
859 public Object getValueAt(int row, int col)
\r
861 return data[row][col];
\r
865 * JTable uses this method to determine the default renderer/ editor for
\r
866 * each cell. If we didn't implement this method, then the last column would
\r
867 * contain text ("true"/"false"), rather than a check box.
\r
869 public Class getColumnClass(int c)
\r
871 return getValueAt(0, c).getClass();
\r
875 * Don't need to implement this method unless your table's editable.
\r
877 public boolean isCellEditable(int row, int col)
\r
879 // Note that the data/cell address is constant,
\r
880 // no matter where the cell appears onscreen.
\r
886 * Don't need to implement this method unless your table's data can change.
\r
888 public void setValueAt(Object value, int row, int col)
\r
890 data[row][col] = value;
\r
891 fireTableCellUpdated(row, col);
\r
893 String name = getValueAt(row, 0).toString();
\r
894 boolean selected = ((Boolean) value).booleanValue();
\r
896 if (selectedSources.contains(name) && !selected)
\r
898 selectedSources.remove(name);
\r
901 if (!selectedSources.contains(name) && selected)
\r
903 selectedSources.add(name);
\r
908 public void initDasSources()
\r
911 Thread thr = new Thread(new Runnable()
\r
915 // this actually initialises the das source list
\r
916 paintComponent(null); // yuk
\r
920 while (loadingDasSources || dasSources == null)
\r
925 } catch (Exception e)
\r
932 public Vector resolveSourceNicknames(Vector sources)
\r
935 Vector resolved = new Vector();
\r
936 if (sources != null)
\r
938 for (int i = 0; i < dasSources.length; i++)
\r
940 if (sources.contains(dasSources[i].getNickname()))
\r
942 if (!resolved.contains(dasSources[i]))
\r
944 resolved.addElement(dasSources[i]);
\r
953 * disable or enable the buttons on the source browser
\r
957 public void setGuiEnabled(boolean b)
\r
959 refresh.setEnabled(b);
\r
960 addLocal.setEnabled(b);
\r