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