JAL-2805 removed unused Aptx instance creation code
[jalview.git] / src / jalview / ext / archaeopteryx / AptxInit.java
index 11ee71e..9b89cea 100644 (file)
@@ -8,7 +8,6 @@ import jalview.ext.treeviewer.TreeI;
 import jalview.ext.treeviewer.TreeViewerUtils;
 import jalview.gui.Desktop;
 import jalview.gui.JvOptionPane;
-import jalview.io.NewickFile;
 import jalview.util.MessageManager;
 import jalview.viewmodel.AlignmentViewport;
 
@@ -33,8 +32,6 @@ import org.forester.io.parsers.util.ParserUtils;
 import org.forester.phylogeny.Phylogeny;
 import org.forester.phylogeny.PhylogenyMethods;
 import org.forester.phylogeny.data.Identifier;
-import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
-import org.forester.phylogeny.factories.PhylogenyFactory;
 import org.forester.util.ForesterUtil;
 
 /**
@@ -75,48 +72,29 @@ public final class AptxInit
   private final static NHXParser.TAXONOMY_EXTRACTION TAXONOMY_EXTRACTION = APTX_CONFIG
           .getTaxonomyExtraction();
 
-  // public static TreeFrameI createInstanceFromCalculation(
-  // final TreeBuilder calculatedTree)
-  // {
-  // TreeBuilderI aptxTreeBuilder = new AptxTreeBuilder(
-  // calculatedTree);
-  //
-  // TreeI aptxTree = aptxTreeBuilder.buildTree();
-  //
-  // TreeFrameI aptxApp = createAptxFrame(aptxTree,
-  // calculatedTree.getAvport(), null);
-  //
-  // return aptxApp;
-  // }
 
-  public static TreeFrameI[] createInstances(String treeTitle,
-          Object source, PhylogenyParser parser, AlignmentViewport viewport)
+  public static TreeFrameI createInstanceFromNhx(String treeTitle,
+          String nhxString, AlignmentViewport viewport)
           throws IOException
   {
-    TreeFrameI[] aptxFrames = null;
-    PhylogenyFactory parserFact = ParserBasedPhylogenyFactory.getInstance();
-    Phylogeny[] trees = parserFact.create(source, parser);
-    aptxFrames = new TreeFrameI[trees.length];
-
-    for (int i = 0; i < trees.length; i++)
+    if (Desktop.instance != null)
     {
-      Phylogeny aptxPhylogeny = trees[i];
+      Desktop.instance.startLoading(treeTitle);
+    }
 
-      // if (nhx_or_nexus && INTERNAL_NUMBERS_AS_CONFIDENCE)
-      // {
-      // PhylogenyMethods
-      // .transferInternalNodeNamesToConfidence(aptxPhylogeny, "");
-      // }
-      aptxPhylogeny.setName(treeTitle);
-      aptxFrames[i] = createAptxFrame(aptxPhylogeny, viewport, treeTitle);
+    Phylogeny aptxPhylogeny = Phylogeny
+            .createInstanceFromNhxString(nhxString);
+    aptxPhylogeny.setName(treeTitle);
+
+    TreeFrameI aptxFrame = createAptxFrame(aptxPhylogeny, viewport,
+            treeTitle);
 
-    }
     if (Desktop.instance != null)
     {
       Desktop.instance.stopLoading();
     }
 
-    return aptxFrames;
+    return aptxFrame;
 
   }
 
@@ -207,13 +185,6 @@ public final class AptxInit
 
     }
 
-  public static TreeFrameI[] createInstancesFromFile(NewickFile newickFile,
-          AlignmentViewport viewport)
-  {
-    return null;
-  }
-
-
   public static TreeFrameI[] createInstancesFromUrl(URL treeUrl,
           AlignmentViewport viewport)
           throws FileNotFoundException, IOException, RuntimeException
@@ -505,12 +476,9 @@ public final class AptxInit
         {
           // Not important if this fails, do nothing.
         }
-        // _main_frame.getContentPane().repaint();
       }
     }
 
-    System.gc();
-
 
     if (Desktop.instance != null)
     {