2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
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 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/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package jalview.jbgui;
22 import java.awt.event.*;
24 import javax.swing.border.*;
25 import javax.swing.event.*;
27 public class GDasSourceBrowser extends JPanel
29 public GDasSourceBrowser()
34 } catch (Exception ex)
40 private void jbInit() throws Exception
42 this.setLayout(gridBagLayout1);
43 refresh.setText("Refresh Available Sources");
44 refresh.addActionListener(new ActionListener()
46 public void actionPerformed(ActionEvent e)
48 refresh_actionPerformed(e);
51 progressBar.setPreferredSize(new Dimension(450, 20));
52 progressBar.setString("");
53 scrollPane.setBorder(titledBorder1);
54 scrollPane.setBorder(BorderFactory.createEtchedBorder());
55 fullDetailsScrollpane.setBorder(BorderFactory.createEtchedBorder());
56 fullDetails.addHyperlinkListener(new HyperlinkListener()
58 public void hyperlinkUpdate(HyperlinkEvent e)
60 fullDetails_hyperlinkUpdate(e);
63 fullDetails.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
64 fullDetails.setEditable(false);
65 registryLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
66 registryLabel.setHorizontalAlignment(SwingConstants.TRAILING);
67 registryLabel.setText("Use Registry");
68 addLocal.setText("Add Local Source");
69 addLocal.addActionListener(new ActionListener()
71 public void actionPerformed(ActionEvent e)
76 jPanel1.setLayout(flowLayout1);
77 jPanel1.setMinimumSize(new Dimension(596, 30));
78 jPanel1.setPreferredSize(new Dimension(596, 30));
79 jScrollPane2.setBorder(titledBorder3);
80 jScrollPane3.setBorder(titledBorder4);
81 jScrollPane4.setBorder(titledBorder5);
83 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
85 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
87 .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
88 filter1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
89 filter2.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
90 filter3.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
91 table.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
92 reset.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
93 reset.setMargin(new Insets(2, 2, 2, 2));
94 reset.setText("Reset");
95 reset.addActionListener(new ActionListener()
97 public void actionPerformed(ActionEvent e)
99 reset_actionPerformed(e);
102 jPanel2.setLayout(borderLayout1);
103 borderLayout1.setHgap(5);
104 registryURL.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
105 scrollPane.getViewport().add(table);
106 fullDetailsScrollpane.getViewport().add(fullDetails);
107 jScrollPane3.getViewport().add(filter2);
108 jScrollPane4.getViewport().add(filter3);
109 jPanel1.add(refresh, null);
110 jPanel1.add(addLocal, null);
111 jPanel1.add(progressBar, null);
112 jScrollPane2.getViewport().add(filter1);
113 this.add(jPanel1, new GridBagConstraints(0, 3, 3, 1, 1.0, 1.0,
114 GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
115 new Insets(0, 0, 0, 0), 0, 0));
116 this.add(fullDetailsScrollpane, new GridBagConstraints(1, 0, 2, 1, 1.0,
117 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
118 new Insets(3, 0, 0, 3), 240, 130));
119 this.add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
120 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
121 3, 2, 0, 0), 150, 130));
122 jPanel2.add(registryLabel, java.awt.BorderLayout.WEST);
123 jPanel2.add(registryURL, java.awt.BorderLayout.CENTER);
124 jPanel2.add(reset, java.awt.BorderLayout.EAST);
125 this.add(jPanel2, new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0,
126 GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
127 new Insets(5, 10, 0, 10), 339, 0));
128 this.add(jScrollPane2, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0,
129 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
130 0, 0, 0, 60), 80, 60));
131 this.add(jScrollPane4, new GridBagConstraints(2, 1, 1, 1, 1.0, 1.0,
132 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
133 0, -80, 0, 0), 80, 60));
134 this.add(jScrollPane3, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0,
135 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
136 0, -60, 0, 80), 80, 60));
139 protected JTable table = new JTable();
141 protected JEditorPane fullDetails = new JEditorPane("text/html", "");
143 TitledBorder titledBorder1 = new TitledBorder("Available DAS Sources");
145 protected JButton refresh = new JButton();
147 protected JProgressBar progressBar = new JProgressBar();
149 protected JScrollPane scrollPane = new JScrollPane();
151 TitledBorder titledBorder2 = new TitledBorder("Full Details");
153 protected JScrollPane fullDetailsScrollpane = new JScrollPane();
155 protected JList filter1 = new JList();
157 protected JList filter2 = new JList();
159 protected JList filter3 = new JList();
161 JScrollPane jScrollPane2 = new JScrollPane();
163 JScrollPane jScrollPane3 = new JScrollPane();
165 JScrollPane jScrollPane4 = new JScrollPane();
167 protected JTextField registryURL = new JTextField();
169 protected JLabel registryLabel = new JLabel();
171 protected JButton addLocal = new JButton();
173 JPanel jPanel1 = new JPanel();
175 FlowLayout flowLayout1 = new FlowLayout();
177 GridBagLayout gridBagLayout1 = new GridBagLayout();
179 TitledBorder titledBorder3 = new TitledBorder("Authority:");
181 TitledBorder titledBorder4 = new TitledBorder("Type:");
183 TitledBorder titledBorder5 = new TitledBorder("Label:");
185 JButton reset = new JButton();
187 JPanel jPanel2 = new JPanel();
189 BorderLayout borderLayout1 = new BorderLayout();
191 public void refresh_actionPerformed(ActionEvent e)
196 public void fullDetails_hyperlinkUpdate(HyperlinkEvent e)
201 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
203 jalview.util.BrowserLauncher.openURL(e.getURL().toString());
205 } catch (Exception ex)
207 System.out.println(e.getURL());
208 ex.printStackTrace();
212 public void amendLocal(boolean newSource)
217 public void reset_actionPerformed(ActionEvent e)