JAL-2805 TreeParser now interface based
[jalview.git] / src / jalview / ext / forester / io / TreeParser.java
index b5a29bf..85f57b6 100644 (file)
@@ -12,13 +12,13 @@ import org.forester.archaeopteryx.Archaeopteryx;
 import org.forester.archaeopteryx.MainFrame;
 import org.forester.util.ForesterUtil;
 
-public class TreeParser
+public class TreeParser implements TreeParserI<MainFrame>
 {
   private final String filePath;
 
   private final File file;
 
-  public TreeParser(String treeFilePath)
+  public TreeParser(final String treeFilePath)
   {
     final String possibleError = ForesterUtil.isReadableFile(treeFilePath);
     if (possibleError != null)
@@ -34,7 +34,7 @@ public class TreeParser
 
   }
 
-  public TreeParser(File treeFile) throws IOException
+  public TreeParser(final File treeFile) throws IOException
   {
     final String possibleError = ForesterUtil.isReadableFile(treeFile);
     if (possibleError != null)
@@ -48,16 +48,18 @@ public class TreeParser
     filePath = file.getCanonicalPath();
   }
 
-
-  public void loadTree()
+  @Override
+  public MainFrame loadTree()
   {
     String[] AptxArgs = new String[] { "-c",
         "_aptx_jalview_configuration_file", filePath };
     MainFrame aptx = Archaeopteryx.main(AptxArgs);
     ArchaeopteryxInit.bindFrameToJalview(aptx);
+    return aptx;
 
 
   }
+
 }
 
 /**