From: gmungoc Date: Thu, 1 Nov 2018 10:33:35 +0000 (+0000) Subject: Merge branch 'Jalview-BH/JAL-3026' into X-Git-Tag: Release_2_11_4_0~45^2~18^2~436 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b7791df75a2e535cfe438e85b101918eedeb71dc;p=jalview.git Merge branch 'Jalview-BH/JAL-3026' into Jalview-BH/JAL-3026-JAL-3063-JAXB Conflicts: src/jalview/ext/ensembl/EnsemblRestClient.java src/jalview/gui/Desktop.java src/jalview/gui/UserDefinedColours.java src/jalview/jbgui/GDesktop.java --- b7791df75a2e535cfe438e85b101918eedeb71dc diff --cc src/jalview/ext/ensembl/EnsemblRestClient.java index 9e01cc4,e3d695f..79c9a40 --- a/src/jalview/ext/ensembl/EnsemblRestClient.java +++ b/src/jalview/ext/ensembl/EnsemblRestClient.java @@@ -20,6 -20,9 +20,7 @@@ */ package jalview.ext.ensembl; + import jalview.bin.Jalview; -import jalview.io.DataSourceType; -import jalview.io.FileParse; import jalview.util.StringUtils; import java.io.BufferedReader; @@@ -331,10 -333,10 +332,9 @@@ abstract class EnsemblRestClient extend boolean multipleIds = ids != null && ids.size() > 1; connection.setRequestMethod( multipleIds ? HttpMethod.POST : HttpMethod.GET); - connection.setRequestProperty("Content-Type", - getRequestMimeType(multipleIds)); + connection.setRequestProperty("Content-Type", getRequestMimeType()); connection.setRequestProperty("Accept", getResponseMimeType()); - connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(multipleIds); diff --cc src/jalview/gui/Desktop.java index 855ccbc,96f0bf3..6c1ed3a --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@@ -1736,52 -1717,48 +1733,50 @@@ public class Desktop extends jalview.jb "Jalview Project"); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle(MessageManager.getString("label.restore_state")); - - int value = chooser.showOpenDialog(this); - - if (value == JalviewFileChooser.APPROVE_OPTION) + chooser.response(new RunResponse(JalviewFileChooser.APPROVE_OPTION) { - final File selectedFile = chooser.getSelectedFile(); - setProjectFile(selectedFile); - final String choice = selectedFile.getAbsolutePath(); - Cache.setProperty("LAST_DIRECTORY", selectedFile.getParent()); - new Thread(new Runnable() + @Override + public void run() { - @Override - public void run() + File selectedFile = chooser.getSelectedFile(); + setProjectFile(selectedFile); + final String choice = selectedFile.getAbsolutePath(); + Cache.setProperty("LAST_DIRECTORY", selectedFile.getParent()); + new Thread(new Runnable() { - setProgressBar(MessageManager.formatMessage( - "label.loading_jalview_project", new Object[] - { choice }), choice.hashCode()); - try + @Override + public void run() { - if (asCastor) - { - new Jalview2XML().loadJalviewAlign(choice); - } - else - setProgressBar(MessageManager.formatMessage( - "label.loading_jalview_project", new Object[] - { choice }), choice.hashCode()); - try - { - new Jalview2XML().loadJalviewAlign(choice); ++ try { ++ if (asCastor) ++ { ++ new Jalview2XML().loadJalviewAlign(choice); ++ } ++ else ++ { ++ new jalview.project.Jalview2XML().loadJalviewAlign(choice); ++ } + } catch (OutOfMemoryError oom) { - new jalview.project.Jalview2XML().loadJalviewAlign(choice); - } - } catch (OutOfMemoryError oom) - { - new OOMWarning("Whilst loading project from " + choice, oom); + new OOMWarning("Whilst loading project from " + choice, oom); - } catch (Exception ex) - { + } catch (Exception ex) + { - Cache.log.error( - "Problems whilst loading project from " + choice, ex); - JvOptionPane.showMessageDialog(Desktop.desktop, - MessageManager.formatMessage( - "label.error_whilst_loading_project_from", - new Object[] - { choice }), - MessageManager.getString("label.couldnt_load_project"), - JvOptionPane.WARNING_MESSAGE); + Cache.log.error( + "Problems whilst loading project from " + choice, ex); + JvOptionPane.showMessageDialog(Desktop.desktop, + MessageManager.formatMessage( + "label.error_whilst_loading_project_from", + new Object[] + { choice }), + MessageManager.getString("label.couldnt_load_project"), + JvOptionPane.WARNING_MESSAGE); + } - setProgressBar(null, choice.hashCode()); } - setProgressBar(null, choice.hashCode()); - } - }).start(); - } + }).start(); + } + }); + + chooser.showOpenDialog(this); } @Override diff --cc src/jalview/gui/FeatureSettings.java index 44265ed,ea3a667..4f3d7b9 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@@ -36,11 -35,11 +35,12 @@@ import jalview.io.JalviewFileView import jalview.schemes.FeatureColour; import jalview.util.MessageManager; import jalview.util.Platform; + import jalview.util.dialogrunner.RunResponse; import jalview.viewmodel.seqfeatures.FeatureRendererModel.FeatureSettingsBean; +import jalview.xml.binding.jalview.JalviewUserColours; +import jalview.xml.binding.jalview.JalviewUserColours.Colour; +import jalview.xml.binding.jalview.JalviewUserColours.Filter; +import jalview.xml.binding.jalview.ObjectFactory; import java.awt.BorderLayout; import java.awt.Color; diff --cc src/jalview/gui/UserDefinedColours.java index af2a6f6,bee1b14..17b2df7 --- a/src/jalview/gui/UserDefinedColours.java +++ b/src/jalview/gui/UserDefinedColours.java @@@ -32,9 -34,7 +32,10 @@@ import jalview.schemes.UserColourScheme import jalview.util.ColorUtils; import jalview.util.Format; import jalview.util.MessageManager; + import jalview.util.dialogrunner.RunResponse; +import jalview.xml.binding.jalview.JalviewUserColours; +import jalview.xml.binding.jalview.JalviewUserColours.Colour; +import jalview.xml.binding.jalview.ObjectFactory; import java.awt.Color; import java.awt.Font; diff --cc src/jalview/jbgui/GDesktop.java index 17f36cb,e66214f..34c7d31 --- a/src/jalview/jbgui/GDesktop.java +++ b/src/jalview/jbgui/GDesktop.java @@@ -459,16 -441,10 +459,15 @@@ public class GDesktop extends JFram desktopMenubar.add(windowMenu); FileMenu.add(inputMenu); FileMenu.add(inputSequence); - if (!Jalview.isJS()) - FileMenu.addSeparator(); - FileMenu.add(saveState); - FileMenu.add(loadState); - FileMenu.addSeparator(); ++ FileMenu.addSeparator(); ++ FileMenu.add(saveAsJaxb); ++ FileMenu.add(loadAsJaxb); ++ if (!Jalview.isJS()) + { - FileMenu.addSeparator(); + FileMenu.add(saveState); + FileMenu.add(loadState); + } - - FileMenu.add(saveAsJaxb); - FileMenu.add(loadAsJaxb); + FileMenu.addSeparator(); FileMenu.add(quit); HelpMenu.add(aboutMenuItem); HelpMenu.add(documentationMenuItem);