apply version 2.7 copyright
[jalview.git] / src / jalview / jbgui / GDasSourceBrowser.java
index c77627a..f2fc849 100755 (executable)
@@ -1,50 +1,42 @@
 /*\r
- * Jalview - A Sequence Alignment Editor and Viewer\r
- * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
- *\r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * \r
+ * This file is part of Jalview.\r
+ * \r
+ * Jalview is free software: you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License \r
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
+ * \r
+ * Jalview is distributed in the hope that it will be useful, but \r
+ * WITHOUT ANY WARRANTY; without even the implied warranty \r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ * PURPOSE.  See the GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.\r
  */\r
 package jalview.jbgui;\r
 \r
-import javax.swing.*;\r
-import javax.swing.border.TitledBorder;\r
-import java.awt.event.ActionListener;\r
-import java.awt.event.ActionEvent;\r
 import java.awt.*;\r
-import javax.swing.BorderFactory;\r
-import javax.swing.event.HyperlinkListener;\r
-import javax.swing.event.HyperlinkEvent;\r
-import java.awt.Dimension;\r
+import java.awt.event.*;\r
+import javax.swing.*;\r
+import javax.swing.border.*;\r
+import javax.swing.event.*;\r
 \r
-public class GDasSourceBrowser\r
-    extends JPanel\r
+public class GDasSourceBrowser extends JPanel\r
 {\r
   public GDasSourceBrowser()\r
   {\r
     try\r
     {\r
       jbInit();\r
-    }\r
-    catch (Exception ex)\r
+    } catch (Exception ex)\r
     {\r
       ex.printStackTrace();\r
     }\r
   }\r
 \r
-  private void jbInit()\r
-      throws Exception\r
+  private void jbInit() throws Exception\r
   {\r
     this.setLayout(gridBagLayout1);\r
     refresh.setText("Refresh Available Sources");\r
@@ -67,7 +59,9 @@ public class GDasSourceBrowser
         fullDetails_hyperlinkUpdate(e);\r
       }\r
     });\r
+    fullDetails.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
     fullDetails.setEditable(false);\r
+    registryLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
     registryLabel.setHorizontalAlignment(SwingConstants.TRAILING);\r
     registryLabel.setText("Use Registry");\r
     addLocal.setText("Add Local Source");\r
@@ -84,6 +78,29 @@ public class GDasSourceBrowser
     jScrollPane2.setBorder(titledBorder3);\r
     jScrollPane3.setBorder(titledBorder4);\r
     jScrollPane4.setBorder(titledBorder5);\r
+    titledBorder2\r
+            .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
+    titledBorder3\r
+            .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
+    titledBorder4\r
+            .setTitleFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
+    filter1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
+    filter2.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
+    filter3.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
+    table.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
+    reset.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
+    reset.setMargin(new Insets(2, 2, 2, 2));\r
+    reset.setText("Reset");\r
+    reset.addActionListener(new ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        reset_actionPerformed(e);\r
+      }\r
+    });\r
+    jPanel2.setLayout(borderLayout1);\r
+    borderLayout1.setHgap(5);\r
+    registryURL.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
     scrollPane.getViewport().add(table);\r
     fullDetailsScrollpane.getViewport().add(fullDetails);\r
     jScrollPane3.getViewport().add(filter2);\r
@@ -92,66 +109,84 @@ public class GDasSourceBrowser
     jPanel1.add(addLocal, null);\r
     jPanel1.add(progressBar, null);\r
     jScrollPane2.getViewport().add(filter1);\r
-    this.add(registryLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0\r
-        , GridBagConstraints.WEST, GridBagConstraints.NONE,\r
-        new Insets(11, 2, 0, 0), 9, 2));\r
-    this.add(registryURL, new GridBagConstraints(1, 2, 4, 1, 1.0, 0.0\r
-                                                 , GridBagConstraints.WEST,\r
-                                                 GridBagConstraints.HORIZONTAL,\r
-                                                 new Insets(6, 7, 0, 10), 393,\r
-                                                 3));\r
-    this.add(jPanel1, new GridBagConstraints(0, 3, 5, 1, 1.0, 1.0\r
-                                             , GridBagConstraints.CENTER,\r
-                                             GridBagConstraints.HORIZONTAL,\r
-                                             new Insets(0, 0, 0, 0), 0, 0));\r
-    this.add(fullDetailsScrollpane, new GridBagConstraints(2, 0, 3, 1, 1.0, 1.0\r
-        , GridBagConstraints.CENTER, GridBagConstraints.BOTH,\r
-        new Insets(3, 0, 0, 3), 240, 130));\r
-    this.add(jScrollPane3, new GridBagConstraints(2, 1, 1, 1, 1.0, 1.0\r
-                                                  , GridBagConstraints.CENTER,\r
-                                                  GridBagConstraints.BOTH,\r
-                                                  new Insets(0, 0, 0, 0), 80,\r
-                                                  60));\r
-    this.add(jScrollPane4, new GridBagConstraints(4, 1, 1, 1, 1.0, 1.0\r
-                                                  , GridBagConstraints.CENTER,\r
-                                                  GridBagConstraints.BOTH,\r
-                                                  new Insets(0, 0, 0, 0), 80,\r
-                                                  60));\r
-    this.add(jScrollPane2, new GridBagConstraints(0, 1, 2, 1, 1.0, 1.0\r
-                                                  , GridBagConstraints.CENTER,\r
-                                                  GridBagConstraints.BOTH,\r
-                                                  new Insets(0, 0, 0, 0), 80,\r
-                                                  60));\r
-    this.add(scrollPane, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0\r
-                                                , GridBagConstraints.CENTER,\r
-                                                GridBagConstraints.BOTH,\r
-                                                new Insets(3, 2, 0, 0), 150,\r
-                                                130));\r
+    this.add(jPanel1, new GridBagConstraints(0, 3, 3, 1, 1.0, 1.0,\r
+            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,\r
+            new Insets(0, 0, 0, 0), 0, 0));\r
+    this.add(fullDetailsScrollpane, new GridBagConstraints(1, 0, 2, 1, 1.0,\r
+            1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,\r
+            new Insets(3, 0, 0, 3), 240, 130));\r
+    this.add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,\r
+            GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(\r
+                    3, 2, 0, 0), 150, 130));\r
+    jPanel2.add(registryLabel, java.awt.BorderLayout.WEST);\r
+    jPanel2.add(registryURL, java.awt.BorderLayout.CENTER);\r
+    jPanel2.add(reset, java.awt.BorderLayout.EAST);\r
+    this.add(jPanel2, new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0,\r
+            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,\r
+            new Insets(5, 10, 0, 10), 339, 0));\r
+    this.add(jScrollPane2, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0,\r
+            GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(\r
+                    0, 0, 0, 60), 80, 60));\r
+    this.add(jScrollPane4, new GridBagConstraints(2, 1, 1, 1, 1.0, 1.0,\r
+            GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(\r
+                    0, -80, 0, 0), 80, 60));\r
+    this.add(jScrollPane3, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0,\r
+            GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(\r
+                    0, -60, 0, 80), 80, 60));\r
   }\r
 \r
   protected JTable table = new JTable();\r
+\r
   protected JEditorPane fullDetails = new JEditorPane("text/html", "");\r
+\r
   TitledBorder titledBorder1 = new TitledBorder("Available DAS Sources");\r
+\r
   protected JButton refresh = new JButton();\r
+\r
   protected JProgressBar progressBar = new JProgressBar();\r
+\r
   protected JScrollPane scrollPane = new JScrollPane();\r
+\r
   TitledBorder titledBorder2 = new TitledBorder("Full Details");\r
+\r
   protected JScrollPane fullDetailsScrollpane = new JScrollPane();\r
+\r
   protected JList filter1 = new JList();\r
+\r
   protected JList filter2 = new JList();\r
+\r
   protected JList filter3 = new JList();\r
+\r
   JScrollPane jScrollPane2 = new JScrollPane();\r
+\r
   JScrollPane jScrollPane3 = new JScrollPane();\r
+\r
   JScrollPane jScrollPane4 = new JScrollPane();\r
+\r
   protected JTextField registryURL = new JTextField();\r
+\r
   protected JLabel registryLabel = new JLabel();\r
+\r
   protected JButton addLocal = new JButton();\r
+\r
   JPanel jPanel1 = new JPanel();\r
+\r
   FlowLayout flowLayout1 = new FlowLayout();\r
+\r
   GridBagLayout gridBagLayout1 = new GridBagLayout();\r
+\r
   TitledBorder titledBorder3 = new TitledBorder("Authority:");\r
+\r
   TitledBorder titledBorder4 = new TitledBorder("Type:");\r
+\r
   TitledBorder titledBorder5 = new TitledBorder("Label:");\r
+\r
+  JButton reset = new JButton();\r
+\r
+  JPanel jPanel2 = new JPanel();\r
+\r
+  BorderLayout borderLayout1 = new BorderLayout();\r
+\r
   public void refresh_actionPerformed(ActionEvent e)\r
   {\r
 \r
@@ -159,12 +194,14 @@ public class GDasSourceBrowser
 \r
   public void fullDetails_hyperlinkUpdate(HyperlinkEvent e)\r
   {\r
-    try{\r
+    try\r
+    {\r
 \r
       if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)\r
+      {\r
         jalview.util.BrowserLauncher.openURL(e.getURL().toString());\r
-    }\r
-    catch(Exception ex)\r
+      }\r
+    } catch (Exception ex)\r
     {\r
       System.out.println(e.getURL());\r
       ex.printStackTrace();\r
@@ -176,4 +213,9 @@ public class GDasSourceBrowser
 \r
   }\r
 \r
+  public void reset_actionPerformed(ActionEvent e)\r
+  {\r
+\r
+  }\r
+\r
 }\r