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.getString("label.refresh_available_sources"));
48 refresh.addActionListener(new ActionListener()
50 public void actionPerformed(ActionEvent e)
52 refresh_actionPerformed(e);
55 progressBar.setPreferredSize(new Dimension(450, 20));
56 progressBar.setString("");
57 scrollPane.setBorder(titledBorder1);
58 scrollPane.setBorder(BorderFactory.createEtchedBorder());
59 fullDetailsScrollpane.setBorder(BorderFactory.createEtchedBorder());
60 fullDetails.addHyperlinkListener(new HyperlinkListener()
62 public void hyperlinkUpdate(HyperlinkEvent e)
64 fullDetails_hyperlinkUpdate(e);
67 fullDetails.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
68 fullDetails.setEditable(false);
69 registryLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
70 registryLabel.setHorizontalAlignment(SwingConstants.TRAILING);
71 registryLabel.setText(MessageManager.getString("label.use_registry"));
72 addLocal.setText(MessageManager.getString("label.add_local_source"));
73 addLocal.addActionListener(new ActionListener()
75 public void actionPerformed(ActionEvent e)
80 jPanel1.setLayout(flowLayout1);
81 jPanel1.setMinimumSize(new Dimension(596, 30));
82 jPanel1.setPreferredSize(new Dimension(596, 30));
83 jScrollPane2.setBorder(titledBorder3);
84 jScrollPane3.setBorder(titledBorder4);
85 jScrollPane4.setBorder(titledBorder5);
87 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
89 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
91 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
92 filter1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
93 filter2.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
94 filter3.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
95 table.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
96 reset.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
97 reset.setMargin(new Insets(2, 2, 2, 2));
98 reset.setText(MessageManager.getString("action.reset"));
99 reset.addActionListener(new ActionListener()
101 public void actionPerformed(ActionEvent e)
103 reset_actionPerformed(e);
106 jPanel2.setLayout(borderLayout1);
107 borderLayout1.setHgap(5);
108 registryURL.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
109 scrollPane.getViewport().add(table);
110 fullDetailsScrollpane.getViewport().add(fullDetails);
111 jScrollPane3.getViewport().add(filter2);
112 jScrollPane4.getViewport().add(filter3);
113 jPanel1.add(refresh, null);
114 jPanel1.add(addLocal, null);
115 jPanel1.add(progressBar, null);
116 jScrollPane2.getViewport().add(filter1);
117 this.add(jPanel1, new GridBagConstraints(0, 3, 3, 1, 1.0, 1.0,
118 GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
119 new Insets(0, 0, 0, 0), 0, 0));
120 this.add(fullDetailsScrollpane, new GridBagConstraints(1, 0, 2, 1, 1.0,
121 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
122 new Insets(3, 0, 0, 3), 240, 130));
123 this.add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
124 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
125 3, 2, 0, 0), 150, 130));
126 jPanel2.add(registryLabel, java.awt.BorderLayout.WEST);
127 jPanel2.add(registryURL, java.awt.BorderLayout.CENTER);
128 jPanel2.add(reset, java.awt.BorderLayout.EAST);
129 this.add(jPanel2, new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0,
130 GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
131 new Insets(5, 10, 0, 10), 339, 0));
132 this.add(jScrollPane2, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0,
133 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
134 0, 0, 0, 60), 80, 60));
135 this.add(jScrollPane4, new GridBagConstraints(2, 1, 1, 1, 1.0, 1.0,
136 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
137 0, -80, 0, 0), 80, 60));
138 this.add(jScrollPane3, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0,
139 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
140 0, -60, 0, 80), 80, 60));
143 protected JTable table = new JTable();
145 protected JEditorPane fullDetails = new JEditorPane("text/html", "");
147 TitledBorder titledBorder1 = new TitledBorder(MessageManager.getString("label.available_das_sources"));
149 protected JButton refresh = new JButton();
151 protected JProgressBar progressBar = new JProgressBar();
153 protected JScrollPane scrollPane = new JScrollPane();
155 TitledBorder titledBorder2 = new TitledBorder(MessageManager.getString("label.full_details"));
157 protected JScrollPane fullDetailsScrollpane = new JScrollPane();
159 protected JList filter1 = new JList();
161 protected JList filter2 = new JList();
163 protected JList filter3 = new JList();
165 JScrollPane jScrollPane2 = new JScrollPane();
167 JScrollPane jScrollPane3 = new JScrollPane();
169 JScrollPane jScrollPane4 = new JScrollPane();
171 protected JTextField registryURL = new JTextField();
173 protected JLabel registryLabel = new JLabel();
175 protected JButton addLocal = new JButton();
177 JPanel jPanel1 = new JPanel();
179 FlowLayout flowLayout1 = new FlowLayout();
181 GridBagLayout gridBagLayout1 = new GridBagLayout();
183 TitledBorder titledBorder3 = new TitledBorder(MessageManager.getString("label.authority") + ":");
185 TitledBorder titledBorder4 = new TitledBorder(MessageManager.getString("label.type") + ":");
187 TitledBorder titledBorder5 = new TitledBorder(MessageManager.getString("label.label") + ":");
189 JButton reset = new JButton();
191 JPanel jPanel2 = new JPanel();
193 BorderLayout borderLayout1 = new BorderLayout();
195 public void refresh_actionPerformed(ActionEvent e)
200 public void fullDetails_hyperlinkUpdate(HyperlinkEvent e)
205 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
207 jalview.util.BrowserLauncher.openURL(e.getURL().toString());
209 } catch (Exception ex)
211 System.out.println(e.getURL());
212 ex.printStackTrace();
216 public void amendLocal(boolean newSource)
221 public void reset_actionPerformed(ActionEvent e)