From 65b8fbcfb6380b445b49354c27b374aada635c08 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 7 May 2007 13:58:17 +0000 Subject: [PATCH] Use id hash to add pdb mappings back to alignment --- src/jalview/gui/Jalview2XML.java | 55 +++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 48ba7f0..9bf6a21 100755 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -986,6 +986,8 @@ public class Jalview2XML Hashtable gatherToThisFrame = new Hashtable(); + String errorMessage = null; + try { //UNMARSHALLER SEEMS TO CLOSE JARINPUTSTREAM, MOST ANNOYING @@ -1040,22 +1042,19 @@ public class Jalview2XML } while (jarentry != null); } + catch(java.io.FileNotFoundException ex) + { + ex.printStackTrace(); + errorMessage = "Couldn't locate Jalview XML file : "+file; + System.err.println("Exception whilst loading jalview XML file : " + + ex + "\n"); + } catch (java.net.UnknownHostException ex) { ex.printStackTrace(); - System.err.println("Couldn't locate Jalview XML file : " + + errorMessage = "Couldn't locate Jalview XML file : " +file; + System.err.println("Exception whilst loading jalview XML file : " + ex + "\n"); - - javax.swing.SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - JOptionPane.showInternalMessageDialog(Desktop.desktop, - "Couldn't locate " + file, - "URL not found", - JOptionPane.WARNING_MESSAGE); - } - }); } catch (Exception ex) { @@ -1071,17 +1070,6 @@ public class Jalview2XML System.err.println("Exception whilst loading jalview XML file : " + ex + "\n"); - javax.swing.SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - - JOptionPane.showInternalMessageDialog(Desktop.desktop, - "Error loading " + file, - "Error loading Jalview file", - JOptionPane.WARNING_MESSAGE); - } - }); } if (Desktop.instance != null) @@ -1096,6 +1084,21 @@ public class Jalview2XML (AlignFrame) en.nextElement()); } + if(errorMessage!=null) + { + final String finalErrorMessage = errorMessage; + javax.swing.SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + JOptionPane.showInternalMessageDialog(Desktop.desktop, + finalErrorMessage, + "Error loading Jalview file", + JOptionPane.WARNING_MESSAGE); + } + }); + } + return af; } @@ -1906,9 +1909,11 @@ public class Jalview2XML String pdbFile = loadPDBFile(file, ids[p].getId()); - jalview.datamodel.SequenceI[] seq = new jalview.datamodel.SequenceI[] + jalview.datamodel.SequenceI[] seq = new jalview.datamodel. + SequenceI[] { - al.getSequenceAt(i)}; + (jalview.datamodel.SequenceI) + seqRefIds.get(JSEQ[i].getId()+"")}; if (comp == null) -- 1.7.10.2