*/
package jalview.ext.ensembl;
+ import jalview.bin.Jalview;
-import jalview.io.DataSourceType;
-import jalview.io.FileParse;
import jalview.util.StringUtils;
import java.io.BufferedReader;
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);
"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
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);