JAL-1807 explicit imports (jalview.gui)
[jalview.git] / src / jalview / gui / DasSourceBrowser.java
old mode 100755 (executable)
new mode 100644 (file)
index 3efde6a..f781473
@@ -1,23 +1,28 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
- * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
  * Jalview is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
  *  
  * Jalview is distributed in the hope that it will be useful, but 
  * WITHOUT ANY WARRANTY; without even the implied warranty 
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
  * PURPOSE.  See the GNU General Public License for more details.
  * 
- * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
  */
 package jalview.gui;
 
+import jalview.bin.Cache;
 import jalview.jbgui.GDasSourceBrowser;
+import jalview.util.MessageManager;
 import jalview.util.TableSorter;
 import jalview.ws.dbsources.das.api.DasSourceRegistryI;
 import jalview.ws.dbsources.das.api.jalviewSourceI;
@@ -59,7 +64,7 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
   {
     fs = featureSettings;
     // TODO DasSourceRegistryProvider API
-    sourceRegistry = jalview.bin.Cache.getDasSourceRegistry();
+    sourceRegistry = Cache.getDasSourceRegistry();
     String registry = sourceRegistry.getDasRegistryURL();
 
     registryURL.setText(registry);
@@ -170,8 +175,9 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
 
     if (nickName == null)
     {
-      fullDetails.setText(text + "Select a DAS service from the table"
-              + " to read a full description here.</font></html>");
+      fullDetails.setText(text
+              + MessageManager
+                      .getString("label.select_das_service_from_table"));
       return;
     }
 
@@ -355,7 +361,7 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
 
   public void refresh_actionPerformed(ActionEvent e)
   {
-    saveProperties(jalview.bin.Cache.applicationProperties);
+    saveProperties(Cache.applicationProperties);
 
     Thread worker = new Thread(this);
     worker.start();
@@ -430,21 +436,25 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
 
     JTextField nametf = new JTextField(nickname, 40);
     JTextField urltf = new JTextField(url, 40);
-    JCheckBox seqs = new JCheckBox("Sequence Source");
+    JCheckBox seqs = new JCheckBox(
+            MessageManager.getString("label.sequence_source"));
     seqs.setSelected(seqsrc);
     JPanel panel = new JPanel(new BorderLayout());
     JPanel pane12 = new JPanel(new BorderLayout());
-    pane12.add(new JLabel("Nickname: "), BorderLayout.CENTER);
+    pane12.add(new JLabel(MessageManager.getString("label.name")),
+            BorderLayout.CENTER);
     pane12.add(nametf, BorderLayout.EAST);
     panel.add(pane12, BorderLayout.NORTH);
     pane12 = new JPanel(new BorderLayout());
-    pane12.add(new JLabel("URL: "), BorderLayout.NORTH);
+    pane12.add(new JLabel(MessageManager.getString("label.url")),
+            BorderLayout.NORTH);
     pane12.add(seqs, BorderLayout.SOUTH);
     pane12.add(urltf, BorderLayout.EAST);
     panel.add(pane12, BorderLayout.SOUTH);
 
     int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
-            panel, "Enter Nickname & URL of Local DAS Source",
+            panel,
+            MessageManager.getString("label.enter_local_das_source"),
             JOptionPane.OK_CANCEL_OPTION);
 
     if (reply != JOptionPane.OK_OPTION)
@@ -516,10 +526,13 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
 
     if (!sourceRegistry.getSource(nickname).isLocal())
     {
-      JOptionPane.showInternalMessageDialog(Desktop.desktop,
-              "You can only edit or remove local DAS Sources!",
-              "Public DAS source - not editable",
-              JOptionPane.WARNING_MESSAGE);
+      JOptionPane
+              .showInternalMessageDialog(
+                      Desktop.desktop,
+                      MessageManager
+                              .getString("label.you_can_only_edit_or_remove_local_das_sources"),
+                      MessageManager.getString("label.public_das_source"),
+                      JOptionPane.WARNING_MESSAGE);
       return;
     }
 
@@ -671,7 +684,7 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
 
   void setSelectedFromProperties()
   {
-    String active = jalview.bin.Cache.getDefault("DAS_ACTIVE_SOURCE",
+    String active = Cache.getDefault("DAS_ACTIVE_SOURCE",
             "uniprot");
     StringTokenizer st = new StringTokenizer(active, "\t");
     selectedSources = new Vector();
@@ -695,11 +708,11 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
   {
     if (registryURL.getText() == null || registryURL.getText().length() < 1)
     {
-      properties.remove(jalview.bin.Cache.DAS_REGISTRY_URL);
+      properties.remove(Cache.DAS_REGISTRY_URL);
     }
     else
     {
-      properties.setProperty(jalview.bin.Cache.DAS_REGISTRY_URL,
+      properties.setProperty(Cache.DAS_REGISTRY_URL,
               registryURL.getText());
     }
 
@@ -712,11 +725,11 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
       }
     }
 
-    properties.setProperty(jalview.bin.Cache.DAS_ACTIVE_SOURCE,
+    properties.setProperty(Cache.DAS_ACTIVE_SOURCE,
             sb.toString());
 
     String sourceprop = sourceRegistry.getLocalSourceString();
-    properties.setProperty(jalview.bin.Cache.DAS_LOCAL_SOURCE, sourceprop);
+    properties.setProperty(Cache.DAS_LOCAL_SOURCE, sourceprop);
   }
 
   class DASTableModel extends AbstractTableModel
@@ -728,7 +741,7 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
     }
 
     private String[] columnNames = new String[]
-    { "Nickname", "Use Source" };
+    { MessageManager.getString("label.nickname"), MessageManager.getString("label.use_source") };
 
     private Object[][] data;