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;
21 import java.awt.event.*;
23 import javax.swing.border.*;
24 import javax.swing.event.*;
26 public class GDasSourceBrowser extends JPanel
28 public GDasSourceBrowser()
33 } catch (Exception ex)
39 private void jbInit() throws Exception
41 this.setLayout(gridBagLayout1);
42 refresh.setText("Refresh Available Sources");
43 refresh.addActionListener(new ActionListener()
45 public void actionPerformed(ActionEvent e)
47 refresh_actionPerformed(e);
50 progressBar.setPreferredSize(new Dimension(450, 20));
51 progressBar.setString("");
52 scrollPane.setBorder(titledBorder1);
53 scrollPane.setBorder(BorderFactory.createEtchedBorder());
54 fullDetailsScrollpane.setBorder(BorderFactory.createEtchedBorder());
55 fullDetails.addHyperlinkListener(new HyperlinkListener()
57 public void hyperlinkUpdate(HyperlinkEvent e)
59 fullDetails_hyperlinkUpdate(e);
62 fullDetails.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
63 fullDetails.setEditable(false);
64 registryLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
65 registryLabel.setHorizontalAlignment(SwingConstants.TRAILING);
66 registryLabel.setText("Use Registry");
67 addLocal.setText("Add Local Source");
68 addLocal.addActionListener(new ActionListener()
70 public void actionPerformed(ActionEvent e)
75 jPanel1.setLayout(flowLayout1);
76 jPanel1.setMinimumSize(new Dimension(596, 30));
77 jPanel1.setPreferredSize(new Dimension(596, 30));
78 jScrollPane2.setBorder(titledBorder3);
79 jScrollPane3.setBorder(titledBorder4);
80 jScrollPane4.setBorder(titledBorder5);
82 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
84 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
86 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
87 filter1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
88 filter2.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
89 filter3.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
90 table.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
91 reset.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
92 reset.setMargin(new Insets(2, 2, 2, 2));
93 reset.setText("Reset");
94 reset.addActionListener(new ActionListener()
96 public void actionPerformed(ActionEvent e)
98 reset_actionPerformed(e);
101 jPanel2.setLayout(borderLayout1);
102 borderLayout1.setHgap(5);
103 registryURL.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
104 scrollPane.getViewport().add(table);
105 fullDetailsScrollpane.getViewport().add(fullDetails);
106 jScrollPane3.getViewport().add(filter2);
107 jScrollPane4.getViewport().add(filter3);
108 jPanel1.add(refresh, null);
109 jPanel1.add(addLocal, null);
110 jPanel1.add(progressBar, null);
111 jScrollPane2.getViewport().add(filter1);
112 this.add(jPanel1, new GridBagConstraints(0, 3, 3, 1, 1.0, 1.0,
113 GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
114 new Insets(0, 0, 0, 0), 0, 0));
115 this.add(fullDetailsScrollpane, new GridBagConstraints(1, 0, 2, 1, 1.0,
116 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
117 new Insets(3, 0, 0, 3), 240, 130));
118 this.add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
119 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
120 3, 2, 0, 0), 150, 130));
121 jPanel2.add(registryLabel, java.awt.BorderLayout.WEST);
122 jPanel2.add(registryURL, java.awt.BorderLayout.CENTER);
123 jPanel2.add(reset, java.awt.BorderLayout.EAST);
124 this.add(jPanel2, new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0,
125 GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
126 new Insets(5, 10, 0, 10), 339, 0));
127 this.add(jScrollPane2, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0,
128 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
129 0, 0, 0, 60), 80, 60));
130 this.add(jScrollPane4, new GridBagConstraints(2, 1, 1, 1, 1.0, 1.0,
131 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
132 0, -80, 0, 0), 80, 60));
133 this.add(jScrollPane3, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0,
134 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
135 0, -60, 0, 80), 80, 60));
138 protected JTable table = new JTable();
140 protected JEditorPane fullDetails = new JEditorPane("text/html", "");
142 TitledBorder titledBorder1 = new TitledBorder("Available DAS Sources");
144 protected JButton refresh = new JButton();
146 protected JProgressBar progressBar = new JProgressBar();
148 protected JScrollPane scrollPane = new JScrollPane();
150 TitledBorder titledBorder2 = new TitledBorder("Full Details");
152 protected JScrollPane fullDetailsScrollpane = new JScrollPane();
154 protected JList filter1 = new JList();
156 protected JList filter2 = new JList();
158 protected JList filter3 = new JList();
160 JScrollPane jScrollPane2 = new JScrollPane();
162 JScrollPane jScrollPane3 = new JScrollPane();
164 JScrollPane jScrollPane4 = new JScrollPane();
166 protected JTextField registryURL = new JTextField();
168 protected JLabel registryLabel = new JLabel();
170 protected JButton addLocal = new JButton();
172 JPanel jPanel1 = new JPanel();
174 FlowLayout flowLayout1 = new FlowLayout();
176 GridBagLayout gridBagLayout1 = new GridBagLayout();
178 TitledBorder titledBorder3 = new TitledBorder("Authority:");
180 TitledBorder titledBorder4 = new TitledBorder("Type:");
182 TitledBorder titledBorder5 = new TitledBorder("Label:");
184 JButton reset = new JButton();
186 JPanel jPanel2 = new JPanel();
188 BorderLayout borderLayout1 = new BorderLayout();
190 public void refresh_actionPerformed(ActionEvent e)
195 public void fullDetails_hyperlinkUpdate(HyperlinkEvent e)
200 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
202 jalview.util.BrowserLauncher.openURL(e.getURL().toString());
204 } catch (Exception ex)
206 System.out.println(e.getURL());
207 ex.printStackTrace();
211 public void amendLocal(boolean newSource)
216 public void reset_actionPerformed(ActionEvent e)