fix merge conflicts for finess on JAL-1140 (introduced by 1a8f953dd71a9e319e910261927...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 4 Dec 2012 16:11:26 +0000 (16:11 +0000)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Wed, 13 Feb 2013 18:56:58 +0000 (18:56 +0000)
22 files changed:
src/MCview/PDBViewer.java
src/MCview/PDBfile.java
src/jalview/appletgui/AlignFrame.java
src/jalview/datamodel/Annotation.java
src/jalview/ext/jmol/PDBFileWithJmol.java
src/jalview/gui/AssociatePdbFileWithSeq.java
src/jalview/gui/PopupMenu.java
src/jalview/io/AlignFile.java
src/jalview/io/BLCFile.java
src/jalview/io/ClustalFile.java
src/jalview/io/FastaFile.java
src/jalview/io/FeaturesFile.java
src/jalview/io/JPredFile.java
src/jalview/io/MSFfile.java
src/jalview/io/PIRFile.java
src/jalview/io/PfamFile.java
src/jalview/io/PileUpfile.java
src/jalview/io/RnamlFile.java
src/jalview/io/SimpleBlastFile.java
src/jalview/io/StockholmFile.java
src/jalview/io/TCoffeeScoreFile.java
test/jalview/io/TCoffeeScoreFileTest.java

index e79c017..c8dbe66 100755 (executable)
@@ -49,8 +49,7 @@ public class PDBViewer extends JInternalFrame implements Runnable
   String tmpPDBFile;
 
   public PDBViewer(PDBEntry pdbentry, SequenceI[] seq, String[] chains,
-          AlignmentPanel ap, String protocol) throws Exception
-
+          AlignmentPanel ap, String protocol)
   {
     this.pdbentry = pdbentry;
     this.seq = seq;
index fc286a8..95dec13 100755 (executable)
@@ -22,7 +22,6 @@ import java.util.*;
 
 import java.awt.*;
 
-
 import jalview.analysis.AlignSeq;
 import jalview.datamodel.*;
 import jalview.io.FileParse;
@@ -39,12 +38,12 @@ public class PDBfile extends jalview.io.AlignFile
    */
   boolean VisibleChainAnnotation = false;
 
-  public PDBfile(String inFile, String inType) throws Exception
+  public PDBfile(String inFile, String inType) throws IOException
   {
     super(inFile, inType);
   }
 
-  public PDBfile(FileParse source) throws Exception
+  public PDBfile(FileParse source) throws IOException
   {
     super(source);
   }
@@ -54,7 +53,7 @@ public class PDBfile extends jalview.io.AlignFile
     return null;
   }
 
-  public void parse() throws Exception
+  public void parse() throws IOException
   {
     // TODO set the filename sensibly - try using data source name.
     id = safeName(getDataName());
index 085c9dd..299d1db 100644 (file)
@@ -83,7 +83,6 @@ import java.awt.event.KeyListener;
 import java.awt.event.WindowAdapter;\r
 import java.awt.event.WindowEvent;\r
 import java.io.IOException;\r
-import java.io.InputStreamReader;\r
 import java.net.URL;\r
 import java.net.URLEncoder;\r
 import java.util.Enumeration;\r
@@ -92,15 +91,6 @@ import java.util.List;
 import java.util.StringTokenizer;\r
 import java.util.Vector;\r
 \r
-import javax.xml.parsers.ParserConfigurationException;\r
-\r
-import org.xml.sax.SAXException;\r
-\r
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;\r
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;\r
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;\r
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;\r
-\r
 public class AlignFrame extends EmbmenuFrame implements ActionListener,\r
         ItemListener, KeyListener\r
 {\r
@@ -3720,15 +3710,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
    *          File/URL/T-COFFEE score file contents\r
    * @throws IOException\r
    * @return true if alignment was annotated with data from source\r
-   * @throws SAXException\r
-   * @throws ParserConfigurationException\r
-   * @throws ExceptionFileFormatOrSyntax\r
-   * @throws ExceptionLoadingFailed\r
-   * @throws ExceptionPermissionDenied\r
-   * @throws InterruptedException\r
-   * @throws ExceptionUnmatchedClosingParentheses\r
    */\r
-  public boolean loadScoreFile(String source) throws Exception\r
+  public boolean loadScoreFile(String source) throws IOException\r
   {\r
 \r
     TCoffeeScoreFile file = new TCoffeeScoreFile(source,\r
index fd1021f..042e0f7 100755 (executable)
@@ -18,9 +18,6 @@
 package jalview.datamodel;
 
 import java.awt.*;
-import java.util.ArrayList;
-
-import fr.orsay.lri.varna.models.rna.RNA;
 
 /**
  * DOCUMENT ME!
index 962fe3c..1059021 100644 (file)
@@ -20,13 +20,9 @@ package jalview.ext.jmol;
 import java.io.IOException;
 import java.util.Map;
 
-import javax.xml.parsers.ParserConfigurationException;
-
 import org.jmol.api.JmolStatusListener;
 import org.jmol.api.JmolViewer;
 import org.jmol.constant.EnumCallback;
-import org.jmol.constant.EnumStructure;
-import org.jmol.modelset.Chain;
 import org.jmol.modelset.Group;
 import org.jmol.modelset.Model;
 import org.jmol.modelset.ModelSet;
@@ -34,12 +30,7 @@ import org.jmol.modelset.Polymer;
 import org.jmol.modelsetbio.BioPolymer;
 import org.jmol.viewer.Viewer;
 import org.openscience.jmol.app.JmolApp;
-import org.xml.sax.SAXException;
 
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Annotation;
 import jalview.datamodel.PDBEntry;
@@ -62,10 +53,7 @@ public class PDBFileWithJmol extends AlignFile implements
   Viewer viewer = null;
 
   public PDBFileWithJmol(String inFile, String type)
-          throws ExceptionUnmatchedClosingParentheses, IOException,
-          ExceptionFileFormatOrSyntax, ParserConfigurationException,
-          SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed,
-          InterruptedException
+          throws IOException
   {
     super(inFile, type);
   }
@@ -128,10 +116,7 @@ public class PDBFileWithJmol extends AlignFile implements
    * @see jalview.io.AlignFile#parse()
    */
   @Override
-  public void parse() throws IOException, ExceptionFileFormatOrSyntax,
-          ParserConfigurationException, SAXException,
-          ExceptionPermissionDenied, ExceptionLoadingFailed,
-          InterruptedException, ExceptionUnmatchedClosingParentheses
+  public void parse() throws IOException
   {
     Viewer jmd = getJmolData();
     jmd.openReader(getDataName(), getDataName(), getReader());
index ef7dad0..4c31ce4 100644 (file)
 package jalview.gui;
 
 import javax.swing.JOptionPane;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
-
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceI;
 
@@ -39,23 +30,19 @@ import jalview.datamodel.SequenceI;
 public class AssociatePdbFileWithSeq
 {
 
-/**
- * assocate the given PDB file with 
- * @param choice
- * @param sequence
- * @throws IOException 
- */
-  public PDBEntry associatePdbWithSeq(String choice, String protocol, SequenceI sequence, boolean prompt) throws Exception
+  /**
+   * assocate the given PDB file with
+   * 
+   * @param choice
+   * @param sequence
+   */
+  public PDBEntry associatePdbWithSeq(String choice, String protocol,
+          SequenceI sequence, boolean prompt)
   {
     PDBEntry entry = new PDBEntry();
     try
     {
-               System.out.println("This is a annotation PDB");
-       
-       
-      MCview.PDBfile pdbfile = new MCview.PDBfile(choice,
-              protocol);
+      MCview.PDBfile pdbfile = new MCview.PDBfile(choice, protocol);
 
       if (pdbfile.id == null)
       {
@@ -81,7 +68,7 @@ public class AssociatePdbFileWithSeq
       {
         entry.setId(pdbfile.id);
       }
-       
+
     } catch (java.io.IOException ex)
     {
       ex.printStackTrace();
@@ -90,7 +77,5 @@ public class AssociatePdbFileWithSeq
     entry.setFile(choice);
     sequence.getDatasetSequence().addPDBId(entry);
     return entry;
-    
   }
-
 }
index 6bc8daf..9c5a222 100644 (file)
@@ -23,14 +23,6 @@ import java.awt.*;
 import java.awt.event.*;
 
 import javax.swing.*;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
 
 import jalview.analysis.*;
 import jalview.commands.*;
@@ -1064,12 +1056,7 @@ public class PopupMenu extends JPopupMenu
     {
       public void actionPerformed(ActionEvent e)
       {
-        try {
-                       pdbFromFile_actionPerformed();
-               } catch (Exception e1) {
-                       // TODO Auto-generated catch block
-                       e1.printStackTrace();
-               }
+        pdbFromFile_actionPerformed();
       }
     });
 //    RNAFold.setText("From RNA Fold with predict2D");
@@ -1985,7 +1972,7 @@ public class PopupMenu extends JPopupMenu
     oal = null;
   }
 
-  public void pdbFromFile_actionPerformed() throws Exception
+  public void pdbFromFile_actionPerformed()
   {
     jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
             jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
index c0f8531..81d0ae4 100755 (executable)
@@ -27,15 +27,6 @@ import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.Vector;
 
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
-
 /**
  * DOCUMENT ME!
  * 
@@ -85,9 +76,8 @@ public abstract class AlignFile extends FileParse
    *          Filename to read from.
    * @param type
    *          What type of file to read from (File, URL)
- * @throws Exception 
    */
-  public AlignFile(String inFile, String type) throws Exception
+  public AlignFile(String inFile, String type) throws IOException
   {
     super(inFile, type);
     initData();
@@ -104,9 +94,9 @@ public abstract class AlignFile extends FileParse
    * off.
    * 
    * @param source
- * @throws Exception 
+   * @throws IOException
    */
-  public AlignFile(FileParse source) throws Exception
+  public AlignFile(FileParse source) throws IOException
   {
     super(source);
     initData();
@@ -251,9 +241,8 @@ public abstract class AlignFile extends FileParse
 
   /**
    * This method must be implemented to parse the contents of the file.
-
    */
-  public abstract void parse() throws Exception;
+  public abstract void parse() throws IOException;
 
   /**
    * Print out in alignment file format the Sequences in the seqs Vector.
index 71c95b5..5b02b59 100755 (executable)
@@ -20,15 +20,6 @@ package jalview.io;
 import java.io.*;
 import java.util.*;
 
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
-
 import jalview.datamodel.*;
 
 /**
@@ -55,14 +46,16 @@ public class BLCFile extends AlignFile
    *          DOCUMENT ME!
    * @param type
    *          DOCUMENT ME!
- * @throws Exception 
+   * 
+   * @throws IOException
+   *           DOCUMENT ME!
    */
-  public BLCFile(String inFile, String type) throws Exception
+  public BLCFile(String inFile, String type) throws IOException
   {
     super(inFile, type);
   }
 
-  public BLCFile(FileParse source) throws Exception
+  public BLCFile(FileParse source) throws IOException
   {
     super(source);
   }
index c789139..4ae5e77 100755 (executable)
@@ -20,15 +20,6 @@ package jalview.io;
 import java.io.*;
 import java.util.*;
 
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
-
 import jalview.datamodel.*;
 import jalview.util.*;
 
@@ -39,12 +30,12 @@ public class ClustalFile extends AlignFile
   {
   }
 
-  public ClustalFile(String inFile, String type) throws Exception
+  public ClustalFile(String inFile, String type) throws IOException
   {
     super(inFile, type);
   }
 
-  public ClustalFile(FileParse source) throws Exception
+  public ClustalFile(FileParse source) throws IOException
   {
     super(source);
   }
index f809443..0e964b3 100755 (executable)
@@ -19,14 +19,6 @@ package jalview.io;
 
 import java.io.*;
 
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
 
 import jalview.datamodel.*;
 
@@ -59,14 +51,16 @@ public class FastaFile extends AlignFile
    *          DOCUMENT ME!
    * @param type
    *          DOCUMENT ME!
- * @throws Exception 
+   * 
+   * @throws IOException
+   *           DOCUMENT ME!
    */
-  public FastaFile(String inFile, String type) throws Exception
+  public FastaFile(String inFile, String type) throws IOException
   {
     super(inFile, type);
   }
 
-  public FastaFile(FileParse source) throws Exception
+  public FastaFile(FileParse source) throws IOException
   {
     super(source);
   }
index 7b45600..5faf334 100755 (executable)
@@ -20,15 +20,6 @@ package jalview.io;
 import java.io.*;
 import java.util.*;
 
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
-
 import jalview.analysis.SequenceIdMatcher;
 import jalview.datamodel.*;
 import jalview.schemes.*;
@@ -65,14 +56,16 @@ public class FeaturesFile extends AlignFile
    *          DOCUMENT ME!
    * @param type
    *          DOCUMENT ME!
- * @throws Exception 
+   * 
+   * @throws IOException
+   *           DOCUMENT ME!
    */
-  public FeaturesFile(String inFile, String type) throws Exception
+  public FeaturesFile(String inFile, String type) throws IOException
   {
     super(inFile, type);
   }
 
-  public FeaturesFile(FileParse source) throws Exception
+  public FeaturesFile(FileParse source) throws IOException
   {
     super(source);
   }
index fc77ad6..abdfed0 100755 (executable)
@@ -25,15 +25,6 @@ package jalview.io;
 import java.io.*;
 import java.util.*;
 
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
-
 import jalview.datamodel.*;
 
 /**
@@ -72,14 +63,16 @@ public class JPredFile extends AlignFile
    *          DOCUMENT ME!
    * @param type
    *          DOCUMENT ME!
- * @throws Exception 
+   * 
+   * @throws IOException
+   *           DOCUMENT ME!
    */
-  public JPredFile(String inFile, String type) throws Exception
+  public JPredFile(String inFile, String type) throws IOException
   {
     super(inFile, type);
   }
 
-  public JPredFile(FileParse source) throws Exception
+  public JPredFile(FileParse source) throws IOException
   {
     super(source);
   }
@@ -354,9 +347,8 @@ public class JPredFile extends AlignFile
    * 
    * @param args
    *          DOCUMENT ME!
- * @throws Exception 
    */
-  public static void main(String[] args) throws Exception
+  public static void main(String[] args) 
   {
     try
     {
index dcbe37d..7c70a09 100755 (executable)
@@ -20,15 +20,6 @@ package jalview.io;
 import java.io.*;
 import java.util.*;
 
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
-
 import jalview.datamodel.*;
 import jalview.util.*;
 
@@ -55,14 +46,16 @@ public class MSFfile extends AlignFile
    *          DOCUMENT ME!
    * @param type
    *          DOCUMENT ME!
- * @throws Exception 
+   * 
+   * @throws IOException
+   *           DOCUMENT ME!
    */
-  public MSFfile(String inFile, String type) throws Exception
+  public MSFfile(String inFile, String type) throws IOException
   {
     super(inFile, type);
   }
 
-  public MSFfile(FileParse source) throws Exception
+  public MSFfile(FileParse source) throws IOException
   {
     super(source);
   }
index d910b0f..9431cc5 100755 (executable)
@@ -20,15 +20,6 @@ package jalview.io;
 import java.io.*;
 import java.util.*;
 
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
-
 import jalview.datamodel.*;
 
 public class PIRFile extends AlignFile
@@ -41,12 +32,12 @@ public class PIRFile extends AlignFile
   {
   }
 
-  public PIRFile(String inFile, String type) throws Exception
+  public PIRFile(String inFile, String type) throws IOException
   {
     super(inFile, type);
   }
 
-  public PIRFile(FileParse source) throws Exception
+  public PIRFile(FileParse source) throws IOException
   {
     super(source);
   }
index 30b5076..c5ef4f7 100755 (executable)
@@ -20,14 +20,6 @@ package jalview.io;
 import java.io.*;
 import java.util.*;
 
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
 
 import jalview.datamodel.*;
 import jalview.util.*;
@@ -39,12 +31,12 @@ public class PfamFile extends AlignFile
   {
   }
 
-  public PfamFile(String inFile, String type) throws Exception
+  public PfamFile(String inFile, String type) throws IOException
   {
     super(inFile, type);
   }
 
-  public PfamFile(FileParse source) throws Exception
+  public PfamFile(FileParse source) throws IOException
   {
     super(source);
   }
index 95fb203..39f367b 100755 (executable)
@@ -34,15 +34,6 @@ package jalview.io;
  */
 import java.io.*;
 
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
-
 import jalview.datamodel.*;
 import jalview.util.*;
 
@@ -63,14 +54,17 @@ public class PileUpfile extends MSFfile
    *          DOCUMENT ME!
    * @param type
    *          DOCUMENT ME!
- * @throws Exception 
+   * 
+   * @throws IOException
+   *           DOCUMENT ME!
+
    */
-  public PileUpfile(String inFile, String type) throws Exception
+  public PileUpfile(String inFile, String type) throws IOException
   {
     super(inFile, type);
   }
 
-  public PileUpfile(FileParse source) throws Exception
+  public PileUpfile(FileParse source) throws IOException
   {
     super(source);
   }
index 0029e60..1d14dae 100644 (file)
@@ -20,6 +20,7 @@ package jalview.io;
 import java.io.BufferedReader;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Vector;
 import java.util.regex.Matcher;
@@ -29,20 +30,19 @@ import jalview.analysis.SecStrConsensus;
 import jalview.analysis.SecStrConsensus.SimpleBP;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Annotation;
-import jalview.datamodel.SecondaryStructureAnnotation;
 import jalview.datamodel.Sequence;
-import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
 
 import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
 import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
 import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
 import fr.orsay.lri.varna.factories.RNAFactory;
-import fr.orsay.lri.varna.factories.RNAFactory.RNAFileType;
 import fr.orsay.lri.varna.models.rna.RNA;
-import fr.orsay.lri.varna.utils.RNAMLParser;
 
+/**
+ * @author jimp
+ *
+ */
 public class RnamlFile extends AlignFile {
        public int id;
        public String namefile;
@@ -72,8 +72,25 @@ public class RnamlFile extends AlignFile {
                return r;
        }
 
+       /* (non-Javadoc)
+        * @see jalview.io.AlignFile#parse()
+        */
+       public void parse() throws IOException
+       {
+        // rather than lose exception semantics whilst parsing RNAML with VARNA we
+        // wrap the routine and catch all exceptions before passing them up the
+        // chain as an IOException
+         try {
+           _parse();
+         } catch (Exception x)
+         {
+           error=true;
+           errormessage="Problem parsing data as RNAML ("+x.getMessage()+")";
+           throw new IOException("Couldn't parse the datasource as RNAML",x);
+         }
+       }
        @SuppressWarnings("unchecked")
-       public void parse() throws FileNotFoundException,
+       public void _parse() throws FileNotFoundException,
                        ExceptionPermissionDenied, ExceptionLoadingFailed,
                        ExceptionFileFormatOrSyntax {
 
index 53d2790..5cbf78d 100644 (file)
@@ -20,15 +20,6 @@ package jalview.io;
 import java.io.*;
 import java.util.*;
 
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
-
 import jalview.datamodel.*;
 
 /**
@@ -54,12 +45,12 @@ public class SimpleBlastFile extends AlignFile
   {
   }
 
-  public SimpleBlastFile(String inFile, String type) throws Exception
+  public SimpleBlastFile(String inFile, String type) throws IOException
   {
     super(inFile, type);
   }
 
-  public SimpleBlastFile(FileParse source) throws Exception
+  public SimpleBlastFile(FileParse source) throws IOException
   {
     super(source);
   }
index 987cdcd..71cc5c5 100644 (file)
@@ -91,7 +91,7 @@ public class StockholmFile extends AlignFile
    *           If there is an error with the input file\r
  * @throws ExceptionUnmatchedClosingParentheses \r
    */\r
-  public void parse() throws Exception\r
+  public void parse() throws IOException\r
   {\r
        \r
       StringBuffer treeString = new StringBuffer();\r
index 9776b56..158ba6b 100644 (file)
@@ -33,15 +33,6 @@ import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
-
 /**
  * A file parse for T-Coffee score ascii format. This file contains the
  * alignment consensus for each resude in any sequence.
@@ -97,13 +88,13 @@ import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
  */
 public class TCoffeeScoreFile extends AlignFile {
        
-  public TCoffeeScoreFile(String inFile, String type) throws Exception
+  public TCoffeeScoreFile(String inFile, String type) throws IOException
   {
     super(inFile, type);
 
   }
 
-  public TCoffeeScoreFile(FileParse source) throws Exception
+  public TCoffeeScoreFile(FileParse source) throws IOException
   {
     super(source);
   }
index 78de7bf..b2fbe14 100644 (file)
@@ -42,7 +42,7 @@ public class TCoffeeScoreFileTest {
     final static File ALIGN_FILE = new File("test/jalview/io/tcoffee.fasta_aln");
        
        @Test
-       public void testReadHeader() throws Exception {
+       public void testReadHeader() throws IOException {
 
            TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),AppletFormatAdapter.FILE);
            assertTrue(scoreFile.getWarningMessage(),scoreFile.isValid());
@@ -64,7 +64,7 @@ public class TCoffeeScoreFileTest {
        
        
        @Test
-       public void testWrongFile() throws Exception {
+       public void testWrongFile()  {
            try {
                        TCoffeeScoreFile result = new TCoffeeScoreFile(ALIGN_FILE.getPath(), FormatAdapter.FILE);
                        assertFalse(result.isValid());
@@ -76,7 +76,7 @@ public class TCoffeeScoreFileTest {
        } 
 
        @Test
-       public void testHeightAndWidth() throws Exception {
+       public void testHeightAndWidth() throws IOException {
                TCoffeeScoreFile result = new TCoffeeScoreFile(SCORE_FILE.getPath(), FormatAdapter.FILE);
                assertTrue(result.isValid());
                assertEquals( 8, result.getHeight() );
@@ -116,7 +116,7 @@ public class TCoffeeScoreFileTest {
        }
 
        @Test
-       public void testParse() throws Exception {
+       public void testParse() throws IOException {
 
                TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(), FormatAdapter.FILE);
 
@@ -133,8 +133,7 @@ public class TCoffeeScoreFileTest {
 
        
        @Test
-       public void testGetAsList() throws Exception {
-               
+       public void testGetAsList() throws IOException {
           TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),FormatAdapter.FILE);
           assertTrue(parser.getWarningMessage(),parser.isValid());
                List<String> scores = parser.getScoresList();
@@ -152,7 +151,7 @@ public class TCoffeeScoreFileTest {
        
        
        @Test
-       public void testGetAsArray() throws Exception {
+       public void testGetAsArray() throws IOException {
                
           TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),FormatAdapter.FILE);
           assertTrue(parser.getWarningMessage(),parser.isValid());