Create instance of FormatAdapter
authoramwaterhouse <Andrew Waterhouse>
Thu, 22 Sep 2005 15:49:51 +0000 (15:49 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 22 Sep 2005 15:49:51 +0000 (15:49 +0000)
src/jalview/appletgui/AlignFrame.java
src/jalview/appletgui/CutAndPasteTransfer.java
src/jalview/bin/JalviewLite.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/CutAndPasteTransfer.java
src/jalview/io/FileLoader.java
src/jalview/io/FormatAdapter.java
src/jalview/jbgui/GFinder.java

index 3da1401..988aadd 100755 (executable)
@@ -121,7 +121,7 @@ public class AlignFrame
     jalview.bin.JalviewLite.addFrame(frame,\r
                                      "Alignment output - " + e.getActionCommand(),\r
                                      600, 500);\r
-    cap.setText(FormatAdapter.formatSequences(e.getActionCommand(),\r
+    cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),\r
                                               viewport.getAlignment().\r
                                               getSequences()));\r
   }\r
index f8c3756..90bd343 100755 (executable)
@@ -74,7 +74,7 @@ public class CutAndPasteTransfer
     SequenceI[] sequences = null;\r
 \r
     String format = IdentifyFile.Identify(text, "Paste");\r
-    sequences = FormatAdapter.readFile(text, "Paste", format);\r
+    sequences = new FormatAdapter().readFile(text, "Paste", format);\r
 \r
     if (sequences != null)\r
     {\r
index c9ec391..75f5991 100755 (executable)
@@ -107,7 +107,7 @@ public class JalviewLite extends Applet
       }\r
 \r
       String format = jalview.io.IdentifyFile.Identify(args[0],"File");\r
-      SequenceI[] sequences = FormatAdapter.readFile(args[0], "File", format);\r
+      SequenceI[] sequences = new FormatAdapter().readFile(args[0], "File", format);\r
 \r
       if ( (sequences != null) && (sequences.length > 0))\r
       {\r
@@ -228,7 +228,7 @@ public class JalviewLite extends Applet
         public void run()\r
         {\r
             SequenceI[] sequences = null;\r
-            sequences = FormatAdapter.readFile(file, protocol, format);\r
+            sequences = new FormatAdapter().readFile(file, protocol, format);\r
 \r
             if ((sequences != null) && (sequences.length > 0))\r
             {\r
index a020116..9243e99 100755 (executable)
@@ -279,7 +279,7 @@ public class AlignFrame
     }\r
     else\r
     {\r
-      String output = FormatAdapter.formatSequences(format,\r
+      String output = new FormatAdapter().formatSequences(format,\r
           viewport.getAlignment().\r
           getSequences());\r
       if (output == null)\r
@@ -315,7 +315,7 @@ public class AlignFrame
     Desktop.addInternalFrame(cap,\r
                              "Alignment output - " + e.getActionCommand(), 600,\r
                              500);\r
-    cap.setText(FormatAdapter.formatSequences(e.getActionCommand(),\r
+    cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),\r
                                               viewport.getAlignment().\r
                                               getSequences()));\r
   }\r
@@ -685,7 +685,7 @@ public class AlignFrame
       String str = (String) contents.getTransferData(DataFlavor.stringFlavor);\r
 \r
       String format = IdentifyFile.Identify(str, "Paste");\r
-      SequenceI[] sequences = FormatAdapter.readFile(str, "Paste", format);\r
+      SequenceI[] sequences = new FormatAdapter().readFile(str, "Paste", format);\r
 \r
 \r
       if (newAlignment)\r
index 10f9777..219ad4b 100755 (executable)
@@ -123,7 +123,7 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
 \r
         if (FormatAdapter.formats.contains(format))\r
         {\r
-            sequences = FormatAdapter.readFile(getText(), "Paste", format);\r
+            sequences = new FormatAdapter().readFile(getText(), "Paste", format);\r
         }\r
 \r
         if (sequences != null)\r
index e9735ed..26aff08 100755 (executable)
@@ -80,7 +80,7 @@ public class FileLoader
     {\r
       if (FormatAdapter.formats.contains(format))\r
       {\r
-        sequences = FormatAdapter.readFile(file, protocol, format);\r
+        sequences = new FormatAdapter().readFile(file, protocol, format);\r
       }\r
 \r
       if ( (sequences != null) && (sequences.length > 0))\r
index 18bf76a..61c2331 100755 (executable)
@@ -45,6 +45,8 @@ public class FormatAdapter
         formats.addElement("PFAM");\r
     }\r
 \r
+    AlignFile afile = null;\r
+\r
     /**\r
      * DOCUMENT ME!\r
      *\r
@@ -54,12 +56,10 @@ public class FormatAdapter
      *\r
      * @return DOCUMENT ME!\r
      */\r
-    public static SequenceI[] readFile(String inFile, String type, String format)\r
+    public SequenceI[] readFile(String inFile, String type, String format)\r
     {\r
         try\r
         {\r
-            AlignFile afile = null;\r
-\r
             if (format.equals("FASTA"))\r
             {\r
                 afile = new FastaFile(inFile, type);\r
@@ -101,6 +101,7 @@ public class FormatAdapter
         return null;\r
     }\r
 \r
+\r
     /**\r
      * DOCUMENT ME!\r
      *\r
@@ -109,7 +110,7 @@ public class FormatAdapter
      *\r
      * @return DOCUMENT ME!\r
      */\r
-    public static String formatSequences(String format, Vector seqs)\r
+    public String formatSequences(String format, Vector seqs)\r
     {\r
         SequenceI[] s = new SequenceI[seqs.size()];\r
 \r
index 8ece84d..872d490 100755 (executable)
@@ -166,7 +166,7 @@ public class GFinder
         public void run()\r
         {\r
           String str = textfield.getText();\r
-          SequenceI[] sequences = FormatAdapter.readFile(str, "Paste", "FASTA");\r
+          SequenceI[] sequences = new FormatAdapter().readFile(str, "Paste", "FASTA");\r
           if(sequences!=null && sequences.length>0)\r
           {\r
             str = jalview.analysis.AlignSeq.extractGaps(\r