Hashtable seqRefIds = null;
Vector frefedSequence = null;
+ boolean raiseGUI = true; // whether errors are raised in dialog boxes or not
+ public Jalview2XML()
+ {
+ }
+ public Jalview2XML(boolean raiseGUI)
+ {
+ this.raiseGUI = raiseGUI;
+ }
public void resolveFrefedSequences()
{
} catch (Exception ex)
{
//Is Version 1 Jar file?
- af = new Jalview2XML_V1().LoadJalviewAlign(file);
+ try {
+ af = new Jalview2XML_V1(raiseGUI).LoadJalviewAlign(file);
+ } catch (Exception ex2) {
+ System.err.println("Exception whilst loading as jalviewXMLV1:");
+ ex2.printStackTrace();
+ af = null;
+ }
+ if (Desktop.instance != null)
+ {
+ Desktop.instance.stopLoading();
+ }
if (af != null)
{
System.out.println("Successfully loaded archive file");
if (errorMessage != null)
{
final String finalErrorMessage = errorMessage;
- javax.swing.SwingUtilities.invokeLater(new Runnable()
- {
- public void run()
+ if (raiseGUI)
+ {
+ javax.swing.SwingUtilities.invokeLater(new Runnable()
+ {
+ public void run()
{
JOptionPane.showInternalMessageDialog(Desktop.desktop,
finalErrorMessage, "Error loading Jalview file",
JOptionPane.WARNING_MESSAGE);
}
});
+ } else {
+ System.err.println("Problem loading Jalview file: "+errorMessage);
+ }
}
return af;
*/\r
public class Jalview2XML_V1\r
{\r
+ boolean raiseGUI=true;\r
+ public Jalview2XML_V1() {\r
+ \r
+ };\r
+ public Jalview2XML_V1(boolean raiseGUI) {\r
+ this.raiseGUI = raiseGUI;\r
+ };\r
+ \r
jalview.schemes.UserColourScheme GetUserColourScheme(\r
JalviewModelSequence jms, String id)\r
{\r
catch (final java.net.UnknownHostException ex)\r
{\r
ex.printStackTrace();\r
- javax.swing.SwingUtilities.invokeLater(new Runnable()\r
+ if (raiseGUI)\r
+ {javax.swing.SwingUtilities.invokeLater(new Runnable()\r
{\r
public void run()\r
{\r
"URL not found",\r
JOptionPane.WARNING_MESSAGE);\r
}\r
- });\r
+ });};\r
}\r
catch (Exception ex)\r
{\r
+ System.err.println("Exception whilst loading jalview XML file : ");\r
ex.printStackTrace();\r
- System.err.println("Exception whilst loading jalview XML file : " +\r
- ex + "\n");\r
- javax.swing.SwingUtilities.invokeLater(new Runnable()\r
+ if (raiseGUI)\r
+ { javax.swing.SwingUtilities.invokeLater(new Runnable()\r
{\r
public void run()\r
{\r
JOptionPane.WARNING_MESSAGE);\r
}\r
});\r
+ }\r
}\r
\r
return af;\r