2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 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.
21 package jalview.jbgui;
23 import jalview.util.MessageManager;
26 import java.awt.event.*;
28 import javax.swing.border.*;
29 import javax.swing.event.*;
31 public class GDasSourceBrowser extends JPanel
33 public GDasSourceBrowser()
38 } catch (Exception ex)
44 private void jbInit() throws Exception
46 this.setLayout(gridBagLayout1);
47 refresh.setText(MessageManager
48 .getString("label.refresh_available_sources"));
49 refresh.addActionListener(new ActionListener()
51 public void actionPerformed(ActionEvent e)
53 refresh_actionPerformed(e);
56 progressBar.setPreferredSize(new Dimension(450, 20));
57 progressBar.setString("");
58 scrollPane.setBorder(titledBorder1);
59 scrollPane.setBorder(BorderFactory.createEtchedBorder());
60 fullDetailsScrollpane.setBorder(BorderFactory.createEtchedBorder());
61 fullDetails.addHyperlinkListener(new HyperlinkListener()
63 public void hyperlinkUpdate(HyperlinkEvent e)
65 fullDetails_hyperlinkUpdate(e);
68 fullDetails.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
69 fullDetails.setEditable(false);
70 registryLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
71 registryLabel.setHorizontalAlignment(SwingConstants.TRAILING);
72 registryLabel.setText(MessageManager.getString("label.use_registry"));
73 addLocal.setText(MessageManager.getString("label.add_local_source"));
74 addLocal.addActionListener(new ActionListener()
76 public void actionPerformed(ActionEvent e)
81 jPanel1.setLayout(flowLayout1);
82 jPanel1.setMinimumSize(new Dimension(596, 30));
83 jPanel1.setPreferredSize(new Dimension(596, 30));
84 jScrollPane2.setBorder(titledBorder3);
85 jScrollPane3.setBorder(titledBorder4);
86 jScrollPane4.setBorder(titledBorder5);
88 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
90 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
92 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
93 filter1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
94 filter2.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
95 filter3.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
96 table.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
97 reset.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
98 reset.setMargin(new Insets(2, 2, 2, 2));
99 reset.setText(MessageManager.getString("action.reset"));
100 reset.addActionListener(new ActionListener()
102 public void actionPerformed(ActionEvent e)
104 reset_actionPerformed(e);
107 jPanel2.setLayout(borderLayout1);
108 borderLayout1.setHgap(5);
109 registryURL.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
110 scrollPane.getViewport().add(table);
111 fullDetailsScrollpane.getViewport().add(fullDetails);
112 jScrollPane3.getViewport().add(filter2);
113 jScrollPane4.getViewport().add(filter3);
114 jPanel1.add(refresh, null);
115 jPanel1.add(addLocal, null);
116 jPanel1.add(progressBar, null);
117 jScrollPane2.getViewport().add(filter1);
118 this.add(jPanel1, new GridBagConstraints(0, 3, 3, 1, 1.0, 1.0,
119 GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
120 new Insets(0, 0, 0, 0), 0, 0));
121 this.add(fullDetailsScrollpane, new GridBagConstraints(1, 0, 2, 1, 1.0,
122 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
123 new Insets(3, 0, 0, 3), 240, 130));
124 this.add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
125 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
126 3, 2, 0, 0), 150, 130));
127 jPanel2.add(registryLabel, java.awt.BorderLayout.WEST);
128 jPanel2.add(registryURL, java.awt.BorderLayout.CENTER);
129 jPanel2.add(reset, java.awt.BorderLayout.EAST);
130 this.add(jPanel2, new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0,
131 GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
132 new Insets(5, 10, 0, 10), 339, 0));
133 this.add(jScrollPane2, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0,
134 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
135 0, 0, 0, 60), 80, 60));
136 this.add(jScrollPane4, new GridBagConstraints(2, 1, 1, 1, 1.0, 1.0,
137 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
138 0, -80, 0, 0), 80, 60));
139 this.add(jScrollPane3, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0,
140 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
141 0, -60, 0, 80), 80, 60));
144 protected JTable table = new JTable();
146 protected JEditorPane fullDetails = new JEditorPane("text/html", "");
148 TitledBorder titledBorder1 = new TitledBorder(
149 MessageManager.getString("label.available_das_sources"));
151 protected JButton refresh = new JButton();
153 protected JProgressBar progressBar = new JProgressBar();
155 protected JScrollPane scrollPane = new JScrollPane();
157 TitledBorder titledBorder2 = new TitledBorder(
158 MessageManager.getString("label.full_details"));
160 protected JScrollPane fullDetailsScrollpane = new JScrollPane();
162 protected JList filter1 = new JList();
164 protected JList filter2 = new JList();
166 protected JList filter3 = new JList();
168 JScrollPane jScrollPane2 = new JScrollPane();
170 JScrollPane jScrollPane3 = new JScrollPane();
172 JScrollPane jScrollPane4 = new JScrollPane();
174 protected JTextField registryURL = new JTextField();
176 protected JLabel registryLabel = new JLabel();
178 protected JButton addLocal = new JButton();
180 JPanel jPanel1 = new JPanel();
182 FlowLayout flowLayout1 = new FlowLayout();
184 GridBagLayout gridBagLayout1 = new GridBagLayout();
186 TitledBorder titledBorder3 = new TitledBorder(
187 MessageManager.getString("label.authority") + ":");
189 TitledBorder titledBorder4 = new TitledBorder(
190 MessageManager.getString("label.type") + ":");
192 TitledBorder titledBorder5 = new TitledBorder(
193 MessageManager.getString("label.label") + ":");
195 JButton reset = new JButton();
197 JPanel jPanel2 = new JPanel();
199 BorderLayout borderLayout1 = new BorderLayout();
201 public void refresh_actionPerformed(ActionEvent e)
206 public void fullDetails_hyperlinkUpdate(HyperlinkEvent e)
211 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
213 jalview.util.BrowserLauncher.openURL(e.getURL().toString());
215 } catch (Exception ex)
217 System.out.println(e.getURL());
218 ex.printStackTrace();
222 public void amendLocal(boolean newSource)
227 public void reset_actionPerformed(ActionEvent e)