From: gmungoc Date: Tue, 10 Jul 2018 14:01:18 +0000 (+0100) Subject: JAL-3048 code reordered for JalviewJS compliance X-Git-Tag: Release_2_11_4_0~45^2~18^2~551^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b3ec8456ea631e97597568e9bc66ec546eb0417f;p=jalview.git JAL-3048 code reordered for JalviewJS compliance --- diff --git a/src/jalview/gui/Finder.java b/src/jalview/gui/Finder.java index ef69aa8..fd8eb0c 100755 --- a/src/jalview/gui/Finder.java +++ b/src/jalview/gui/Finder.java @@ -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(); } /** diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 9285754..81816aa 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -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 alreadyLoadedPDB = new HashMap<>(); diff --git a/src/jalview/gui/OOMWarning.java b/src/jalview/gui/OOMWarning.java index 7b9da79..02c8fe1 100644 --- a/src/jalview/gui/OOMWarning.java +++ b/src/jalview/gui/OOMWarning.java @@ -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; } } diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index 473e3fc..92854ad 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -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(""); } } diff --git a/src/jalview/ws/jws2/MsaWSClient.java b/src/jalview/ws/jws2/MsaWSClient.java index 7e68d3b..bddc1b1 100644 --- a/src/jalview/ws/jws2/MsaWSClient.java +++ b/src/jalview/ws/jws2/MsaWSClient.java @@ -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); } }