2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.jbgui;
\r
22 import java.awt.event.*;
\r
23 import javax.swing.*;
\r
24 import javax.swing.border.*;
\r
25 import javax.swing.event.*;
\r
27 public class GDasSourceBrowser
\r
30 public GDasSourceBrowser()
\r
36 catch (Exception ex)
\r
38 ex.printStackTrace();
\r
42 private void jbInit()
\r
45 this.setLayout(gridBagLayout1);
\r
46 refresh.setText("Refresh Available Sources");
\r
47 refresh.addActionListener(new ActionListener()
\r
49 public void actionPerformed(ActionEvent e)
\r
51 refresh_actionPerformed(e);
\r
54 progressBar.setPreferredSize(new Dimension(450, 20));
\r
55 progressBar.setString("");
\r
56 scrollPane.setBorder(titledBorder1);
\r
57 scrollPane.setBorder(BorderFactory.createEtchedBorder());
\r
58 fullDetailsScrollpane.setBorder(BorderFactory.createEtchedBorder());
\r
59 fullDetails.addHyperlinkListener(new HyperlinkListener()
\r
61 public void hyperlinkUpdate(HyperlinkEvent e)
\r
63 fullDetails_hyperlinkUpdate(e);
\r
66 fullDetails.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
\r
67 fullDetails.setEditable(false);
\r
68 registryLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
\r
69 registryLabel.setHorizontalAlignment(SwingConstants.TRAILING);
\r
70 registryLabel.setText("Use Registry");
\r
71 addLocal.setText("Add Local Source");
\r
72 addLocal.addActionListener(new ActionListener()
\r
74 public void actionPerformed(ActionEvent e)
\r
79 jPanel1.setLayout(flowLayout1);
\r
80 jPanel1.setMinimumSize(new Dimension(596, 30));
\r
81 jPanel1.setPreferredSize(new Dimension(596, 30));
\r
82 jScrollPane2.setBorder(titledBorder3);
\r
83 jScrollPane3.setBorder(titledBorder4);
\r
84 jScrollPane4.setBorder(titledBorder5);
\r
85 titledBorder2.setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
\r
86 titledBorder3.setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
\r
87 titledBorder4.setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
\r
88 filter1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
\r
89 filter2.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
\r
90 filter3.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
\r
91 table.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
\r
92 reset.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
\r
93 reset.setMargin(new Insets(2, 2, 2, 2));
\r
94 reset.setText("Reset");
\r
95 reset.addActionListener(new ActionListener()
\r
97 public void actionPerformed(ActionEvent e)
\r
99 reset_actionPerformed(e);
\r
102 jPanel2.setLayout(borderLayout1);
\r
103 borderLayout1.setHgap(5);
\r
104 registryURL.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
\r
105 scrollPane.getViewport().add(table);
\r
106 fullDetailsScrollpane.getViewport().add(fullDetails);
\r
107 jScrollPane3.getViewport().add(filter2);
\r
108 jScrollPane4.getViewport().add(filter3);
\r
109 jPanel1.add(refresh, null);
\r
110 jPanel1.add(addLocal, null);
\r
111 jPanel1.add(progressBar, null);
\r
112 jScrollPane2.getViewport().add(filter1);
\r
113 this.add(jPanel1, new GridBagConstraints(0, 3, 3, 1, 1.0, 1.0
\r
114 , GridBagConstraints.CENTER,
\r
115 GridBagConstraints.HORIZONTAL,
\r
116 new Insets(0, 0, 0, 0), 0, 0));
\r
117 this.add(fullDetailsScrollpane, new GridBagConstraints(1, 0, 2, 1, 1.0, 1.0
\r
118 , GridBagConstraints.CENTER, GridBagConstraints.BOTH,
\r
119 new Insets(3, 0, 0, 3), 240, 130));
\r
120 this.add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0
\r
121 , GridBagConstraints.CENTER,
\r
122 GridBagConstraints.BOTH,
\r
123 new Insets(3, 2, 0, 0), 150,
\r
125 jPanel2.add(registryLabel, java.awt.BorderLayout.WEST);
\r
126 jPanel2.add(registryURL, java.awt.BorderLayout.CENTER);
\r
127 jPanel2.add(reset, java.awt.BorderLayout.EAST);
\r
128 this.add(jPanel2, new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0
\r
129 , GridBagConstraints.CENTER,
\r
130 GridBagConstraints.HORIZONTAL,
\r
131 new Insets(5, 10, 0, 10), 339, 0));
\r
132 this.add(jScrollPane2, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0
\r
133 , GridBagConstraints.CENTER,
\r
134 GridBagConstraints.BOTH,
\r
135 new Insets(0, 0, 0, 60), 80,
\r
137 this.add(jScrollPane4, new GridBagConstraints(2, 1, 1, 1, 1.0, 1.0
\r
138 , GridBagConstraints.CENTER,
\r
139 GridBagConstraints.BOTH,
\r
140 new Insets(0, -80, 0, 0), 80,
\r
142 this.add(jScrollPane3, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0
\r
143 , GridBagConstraints.CENTER,
\r
144 GridBagConstraints.BOTH,
\r
145 new Insets(0, -60, 0, 80), 80,
\r
149 protected JTable table = new JTable();
\r
150 protected JEditorPane fullDetails = new JEditorPane("text/html", "");
\r
151 TitledBorder titledBorder1 = new TitledBorder("Available DAS Sources");
\r
152 protected JButton refresh = new JButton();
\r
153 protected JProgressBar progressBar = new JProgressBar();
\r
154 protected JScrollPane scrollPane = new JScrollPane();
\r
155 TitledBorder titledBorder2 = new TitledBorder("Full Details");
\r
156 protected JScrollPane fullDetailsScrollpane = new JScrollPane();
\r
157 protected JList filter1 = new JList();
\r
158 protected JList filter2 = new JList();
\r
159 protected JList filter3 = new JList();
\r
160 JScrollPane jScrollPane2 = new JScrollPane();
\r
161 JScrollPane jScrollPane3 = new JScrollPane();
\r
162 JScrollPane jScrollPane4 = new JScrollPane();
\r
163 protected JTextField registryURL = new JTextField();
\r
164 protected JLabel registryLabel = new JLabel();
\r
165 protected JButton addLocal = new JButton();
\r
166 JPanel jPanel1 = new JPanel();
\r
167 FlowLayout flowLayout1 = new FlowLayout();
\r
168 GridBagLayout gridBagLayout1 = new GridBagLayout();
\r
169 TitledBorder titledBorder3 = new TitledBorder("Authority:");
\r
170 TitledBorder titledBorder4 = new TitledBorder("Type:");
\r
171 TitledBorder titledBorder5 = new TitledBorder("Label:");
\r
172 JButton reset = new JButton();
\r
173 JPanel jPanel2 = new JPanel();
\r
174 BorderLayout borderLayout1 = new BorderLayout();
\r
175 public void refresh_actionPerformed(ActionEvent e)
\r
180 public void fullDetails_hyperlinkUpdate(HyperlinkEvent e)
\r
185 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
\r
187 jalview.util.BrowserLauncher.openURL(e.getURL().toString());
\r
190 catch (Exception ex)
\r
192 System.out.println(e.getURL());
\r
193 ex.printStackTrace();
\r
197 public void amendLocal(boolean newSource)
\r
202 public void reset_actionPerformed(ActionEvent e)
\r