JAL-3048 code reordered for JalviewJS compliance
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 10 Jul 2018 14:01:18 +0000 (15:01 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 10 Jul 2018 14:01:18 +0000 (15:01 +0100)
src/jalview/gui/Finder.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/OOMWarning.java
src/jalview/gui/Preferences.java
src/jalview/ws/jws2/MsaWSClient.java

index ef69aa8..fd8eb0c 100755 (executable)
@@ -301,6 +301,8 @@ public class Finder extends GFinder
       searchResults = null;
     }
 
+    searchBox.updateCache();
+
     // if allResults is null, this effectively switches displaySearch flag in
     // seqCanvas
     ap.highlightSearchResults(searchResults);
@@ -308,11 +310,11 @@ public class Finder extends GFinder
     // 'SelectRegion' selection
     if (!haveResults)
     {
+      resIndex = -1;
+      seqIndex = 0;
       JvOptionPane.showInternalMessageDialog(this,
               MessageManager.getString("label.finished_searching"), null,
               JvOptionPane.INFORMATION_MESSAGE);
-      resIndex = -1;
-      seqIndex = 0;
     }
     else
     {
@@ -330,13 +332,12 @@ public class Finder extends GFinder
           message += searchResults.getSize()
                   + " subsequence matches found.";
         }
-        JvOptionPane.showInternalMessageDialog(this, message, null,
-                JvOptionPane.INFORMATION_MESSAGE);
         resIndex = -1;
         seqIndex = 0;
+        JvOptionPane.showInternalMessageDialog(this, message, null,
+                JvOptionPane.INFORMATION_MESSAGE);
       }
     }
-    searchBox.updateCache();
   }
 
   /**
index 9285754..81816aa 100644 (file)
@@ -52,7 +52,6 @@ import jalview.schemabinding.version2.Annotation;
 import jalview.schemabinding.version2.AnnotationColours;
 import jalview.schemabinding.version2.AnnotationElement;
 import jalview.schemabinding.version2.CalcIdParam;
-import jalview.schemabinding.version2.Colour;
 import jalview.schemabinding.version2.CompoundMatcher;
 import jalview.schemabinding.version2.DBRef;
 import jalview.schemabinding.version2.Features;
@@ -2678,6 +2677,7 @@ public class Jalview2XML
     if (errorMessage != null)
     {
       final String finalErrorMessage = errorMessage;
+      errorMessage = null;
       if (raiseGUI)
       {
         javax.swing.SwingUtilities.invokeLater(new Runnable()
@@ -2695,10 +2695,10 @@ public class Jalview2XML
       }
       else
       {
-        System.err.println("Problem loading Jalview file: " + errorMessage);
+        System.err.println(
+                "Problem loading Jalview file: " + finalErrorMessage);
       }
     }
-    errorMessage = null;
   }
 
   Map<String, String> alreadyLoadedPDB = new HashMap<>();
index 7b9da79..02c8fe1 100644 (file)
@@ -78,12 +78,12 @@ public class OOMWarning implements Runnable
   @Override
   public void run()
   {
+    oomInprogress = false;
     JvOptionPane.showInternalMessageDialog(desktop, MessageManager
             .formatMessage("warn.out_of_memory_when_action", new String[]
             { action }), MessageManager.getString("label.out_of_memory"),
             JvOptionPane.WARNING_MESSAGE);
     // hope that there's enough memory left that no more appear.
-    oomInprogress = false;
   }
 
 }
index 473e3fc..92854ad 100755 (executable)
@@ -23,7 +23,6 @@ package jalview.gui;
 import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
 import jalview.bin.Cache;
 import jalview.gui.Help.HelpId;
-import jalview.gui.JalviewColourChooser.ColourChooserListener;
 import jalview.gui.StructureViewer.ViewerType;
 import jalview.io.FileFormatI;
 import jalview.io.JalviewFileChooser;
@@ -55,7 +54,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import javax.help.HelpSetException;
-import javax.swing.JColorChooser;
 import javax.swing.JFileChooser;
 import javax.swing.JInternalFrame;
 import javax.swing.JPanel;
@@ -1126,12 +1124,12 @@ public class Preferences extends GPreferences
       }
     } catch (NumberFormatException x)
     {
+      userIdWidth.setText("");
       JvOptionPane.showInternalMessageDialog(Desktop.desktop,
               MessageManager
                       .getString("warn.user_defined_width_requirements"),
               MessageManager.getString("label.invalid_id_column_width"),
               JvOptionPane.WARNING_MESSAGE);
-      userIdWidth.setText("");
     }
   }
 
index 7e68d3b..bddc1b1 100644 (file)
@@ -181,11 +181,11 @@ public class MsaWSClient extends Jws2Client
     }
     else
     {
+      wsInfo.setVisible(false);
       JvOptionPane.showMessageDialog(alignFrame,
               MessageManager.getString("info.invalid_msa_input_mininfo"),
               MessageManager.getString("info.invalid_msa_notenough"),
               JvOptionPane.INFORMATION_MESSAGE);
-      wsInfo.setVisible(false);
     }
   }