JAL-1668 house keeping
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 1 Sep 2015 11:37:59 +0000 (12:37 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 1 Sep 2015 11:37:59 +0000 (12:37 +0100)
resources/lang/Messages.properties
src/jalview/gui/StructureChooser.java

index 4aeeccd..d9f13f2 100644 (file)
@@ -1255,8 +1255,13 @@ action.export_hidden_sequences = Export Hidden Sequences
 action.export_features = Export Features
 label.export_settings = Export Settings
 label.save_as_biojs_html = Save as BioJs HTML
+label.pdb_web-service_error = PDB Web-service Error
+label.structure_chooser_manual_association = Structure Chooser - Manual association
+label.structure_chooser_filter_time = Structure Chooser - Filter time ({0})
+label.structure_chooser_no_of_structures = Structure Chooser - {0} Found ({1})
+info.no_pdb_entry_found_for = No PDB entry found for {0}
 exception.unable_to_detect_internet_connection = Jalview is unable to detect an internet connection
 exception.pdb_rest_service_no_longer_available = PDB rest services no longer available!
 exception.resource_not_be_found = The requested resource could not be found
 exception.pdb_server_error = There seems to be an error from the PDB server
-exception.pdb_server_unreachable = Jalview is unable to reach the PDB host server at \'www.ebi.ac.uk\'. Please ensure that you are connected to the internet and try again.
+exception.pdb_server_unreachable = Jalview is unable to reach the PDBe Solr server. Please ensure that you are connected to the internet and try again.
index 9a5f87b..510ce78 100644 (file)
@@ -180,12 +180,14 @@ public class StructureChooser extends GStructureChooser
               discoveredStructuresSet));
       structuresDiscovered = true;
       noOfStructuresFound = discoveredStructuresSet.size();
-      mainFrame.setTitle("Structure Chooser - " + noOfStructuresFound
-              + " Found (" + totalTime + ")");
+      mainFrame.setTitle(MessageManager.formatMessage(
+              "label.structure_chooser_no_of_structures",
+              noOfStructuresFound, totalTime));
     }
     else
     {
-      mainFrame.setTitle("Structure Chooser - Manual association");
+      mainFrame.setTitle(MessageManager
+              .getString("label.structure_chooser_manual_association"));
       if (errors.size() > 0)
       {
         StringBuilder errorMsg = new StringBuilder();
@@ -194,7 +196,8 @@ public class StructureChooser extends GStructureChooser
           errorMsg.append(error).append("\n");
         }
         JOptionPane.showMessageDialog(this, errorMsg.toString(),
-                "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
+                MessageManager.getString("label.pdb_web-service_error"),
+                JOptionPane.ERROR_MESSAGE);
       }
     }
   }
@@ -386,14 +389,15 @@ public class StructureChooser extends GStructureChooser
 
           // Update table selection model here
           tbl_summary.addRowSelectionInterval(0, filterResponseCount - 1);
-
-          mainFrame.setTitle("Structure Chooser - Filter time ("
-                  + totalTime + ")");
+          mainFrame.setTitle(MessageManager.formatMessage(
+                  "label.structure_chooser_filter_time",
+ totalTime));
         }
         else
         {
-          mainFrame.setTitle("Structure Chooser - Filter time ("
-                  + totalTime + ")");
+          mainFrame.setTitle(MessageManager.formatMessage(
+                  "label.structure_chooser_filter_time",
+ totalTime));
           if (errors.size() > 0)
           {
             StringBuilder errorMsg = new StringBuilder();
@@ -402,7 +406,8 @@ public class StructureChooser extends GStructureChooser
               errorMsg.append(error).append("\n");
             }
             JOptionPane.showMessageDialog(null, errorMsg.toString(),
-                    "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
+                    MessageManager.getString("label.pdb_web-service_error"),
+                    JOptionPane.ERROR_MESSAGE);
           }
         }
 
@@ -423,11 +428,11 @@ public class StructureChooser extends GStructureChooser
             jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
     chooser.setFileView(new jalview.io.JalviewFileView());
     chooser.setDialogTitle(MessageManager.formatMessage(
-            "label.select_pdb_file_for", new String[]
-            { selectedSequence.getDisplayId(false) }));
+            "label.select_pdb_file_for",
+            selectedSequence.getDisplayId(false)));
     chooser.setToolTipText(MessageManager.formatMessage(
-            "label.load_pdb_file_associate_with_sequence", new String[]
-            { selectedSequence.getDisplayId(false) }));
+            "label.load_pdb_file_associate_with_sequence",
+            selectedSequence.getDisplayId(false)));
 
     int value = chooser.showOpenDialog(null);
     if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)
@@ -488,7 +493,8 @@ public class StructureChooser extends GStructureChooser
     else if (selectedFilterOpt.getView() == VIEWS_ENTER_ID
             || selectedFilterOpt.getView() == VIEWS_FROM_FILE)
     {
-      mainFrame.setTitle(filterTitle);
+      mainFrame.setTitle(MessageManager
+              .getString("label.structure_chooser_manual_association"));
       idInputAssSeqPanel.loadCmbAssSeq();
       fileChooserAssSeqPanel.loadCmbAssSeq();
     }
@@ -541,8 +547,9 @@ public class StructureChooser extends GStructureChooser
     if (txt_search.getText().length() > 0)
     {
       lbl_pdbManualFetchStatus.setToolTipText(JvSwingUtils.wrapTooltip(
-              true, "No PDB entry found for \'" + txt_search.getText()
-                      + "\'"));
+              true, MessageManager.formatMessage(
+                      "info.no_pdb_entry_found_for",
+                              txt_search.getText())));
     }
 
     if (errorWarning.length() > 0)
@@ -809,6 +816,10 @@ public class StructureChooser extends GStructureChooser
   @Override
   protected void txt_search_ActionPerformed()
   {
+    new Thread()
+    {
+      public void run()
+      {
     errorWarning.setLength(0);
     isValidPBDEntry = false;
     if (txt_search.getText().length() > 0)
@@ -842,6 +853,8 @@ public class StructureChooser extends GStructureChooser
       }
     }
     validateSelections();
+      }
+    }.start();
   }
 
   @Override