2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
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 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package jalview.jbgui;
20 import jalview.util.MessageManager;
23 import java.awt.event.*;
25 import javax.swing.border.*;
26 import javax.swing.event.*;
28 public class GDasSourceBrowser extends JPanel
30 public GDasSourceBrowser()
35 } catch (Exception ex)
41 private void jbInit() throws Exception
43 this.setLayout(gridBagLayout1);
44 refresh.setText(MessageManager.getString("label.refresh_available_sources"));
45 refresh.addActionListener(new ActionListener()
47 public void actionPerformed(ActionEvent e)
49 refresh_actionPerformed(e);
52 progressBar.setPreferredSize(new Dimension(450, 20));
53 progressBar.setString("");
54 scrollPane.setBorder(titledBorder1);
55 scrollPane.setBorder(BorderFactory.createEtchedBorder());
56 fullDetailsScrollpane.setBorder(BorderFactory.createEtchedBorder());
57 fullDetails.addHyperlinkListener(new HyperlinkListener()
59 public void hyperlinkUpdate(HyperlinkEvent e)
61 fullDetails_hyperlinkUpdate(e);
64 fullDetails.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
65 fullDetails.setEditable(false);
66 registryLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
67 registryLabel.setHorizontalAlignment(SwingConstants.TRAILING);
68 registryLabel.setText(MessageManager.getString("label.use_registry"));
69 addLocal.setText(MessageManager.getString("label.add_local_source"));
70 addLocal.addActionListener(new ActionListener()
72 public void actionPerformed(ActionEvent e)
77 jPanel1.setLayout(flowLayout1);
78 jPanel1.setMinimumSize(new Dimension(596, 30));
79 jPanel1.setPreferredSize(new Dimension(596, 30));
80 jScrollPane2.setBorder(titledBorder3);
81 jScrollPane3.setBorder(titledBorder4);
82 jScrollPane4.setBorder(titledBorder5);
84 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
86 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
88 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
89 filter1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
90 filter2.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
91 filter3.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
92 table.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
93 reset.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
94 reset.setMargin(new Insets(2, 2, 2, 2));
95 reset.setText(MessageManager.getString("action.reset"));
96 reset.addActionListener(new ActionListener()
98 public void actionPerformed(ActionEvent e)
100 reset_actionPerformed(e);
103 jPanel2.setLayout(borderLayout1);
104 borderLayout1.setHgap(5);
105 registryURL.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
106 scrollPane.getViewport().add(table);
107 fullDetailsScrollpane.getViewport().add(fullDetails);
108 jScrollPane3.getViewport().add(filter2);
109 jScrollPane4.getViewport().add(filter3);
110 jPanel1.add(refresh, null);
111 jPanel1.add(addLocal, null);
112 jPanel1.add(progressBar, null);
113 jScrollPane2.getViewport().add(filter1);
114 this.add(jPanel1, new GridBagConstraints(0, 3, 3, 1, 1.0, 1.0,
115 GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
116 new Insets(0, 0, 0, 0), 0, 0));
117 this.add(fullDetailsScrollpane, new GridBagConstraints(1, 0, 2, 1, 1.0,
118 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
119 new Insets(3, 0, 0, 3), 240, 130));
120 this.add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
121 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
122 3, 2, 0, 0), 150, 130));
123 jPanel2.add(registryLabel, java.awt.BorderLayout.WEST);
124 jPanel2.add(registryURL, java.awt.BorderLayout.CENTER);
125 jPanel2.add(reset, java.awt.BorderLayout.EAST);
126 this.add(jPanel2, new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0,
127 GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
128 new Insets(5, 10, 0, 10), 339, 0));
129 this.add(jScrollPane2, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0,
130 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
131 0, 0, 0, 60), 80, 60));
132 this.add(jScrollPane4, new GridBagConstraints(2, 1, 1, 1, 1.0, 1.0,
133 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
134 0, -80, 0, 0), 80, 60));
135 this.add(jScrollPane3, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0,
136 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
137 0, -60, 0, 80), 80, 60));
140 protected JTable table = new JTable();
142 protected JEditorPane fullDetails = new JEditorPane("text/html", "");
144 TitledBorder titledBorder1 = new TitledBorder(MessageManager.getString("label.available_das_sources"));
146 protected JButton refresh = new JButton();
148 protected JProgressBar progressBar = new JProgressBar();
150 protected JScrollPane scrollPane = new JScrollPane();
152 TitledBorder titledBorder2 = new TitledBorder(MessageManager.getString("label.full_details"));
154 protected JScrollPane fullDetailsScrollpane = new JScrollPane();
156 protected JList filter1 = new JList();
158 protected JList filter2 = new JList();
160 protected JList filter3 = new JList();
162 JScrollPane jScrollPane2 = new JScrollPane();
164 JScrollPane jScrollPane3 = new JScrollPane();
166 JScrollPane jScrollPane4 = new JScrollPane();
168 protected JTextField registryURL = new JTextField();
170 protected JLabel registryLabel = new JLabel();
172 protected JButton addLocal = new JButton();
174 JPanel jPanel1 = new JPanel();
176 FlowLayout flowLayout1 = new FlowLayout();
178 GridBagLayout gridBagLayout1 = new GridBagLayout();
180 TitledBorder titledBorder3 = new TitledBorder(MessageManager.getString("label.authority") + ":");
182 TitledBorder titledBorder4 = new TitledBorder(MessageManager.getString("label.type") + ":");
184 TitledBorder titledBorder5 = new TitledBorder(MessageManager.getString("label.label") + ":");
186 JButton reset = new JButton();
188 JPanel jPanel2 = new JPanel();
190 BorderLayout borderLayout1 = new BorderLayout();
192 public void refresh_actionPerformed(ActionEvent e)
197 public void fullDetails_hyperlinkUpdate(HyperlinkEvent e)
202 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
204 jalview.util.BrowserLauncher.openURL(e.getURL().toString());
206 } catch (Exception ex)
208 System.out.println(e.getURL());
209 ex.printStackTrace();
213 public void amendLocal(boolean newSource)
218 public void reset_actionPerformed(ActionEvent e)