JAL-2798 rough saving/loading a single Aptx view functionality present
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Tue, 16 Jan 2018 21:36:31 +0000 (21:36 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Tue, 16 Jan 2018 21:36:42 +0000 (21:36 +0000)
src/jalview/gui/Jalview2XML.java
src/jalview/schemabinding/version2/JalviewModelSequence.java

index b4ded67..93a7bcc 100644 (file)
@@ -1115,8 +1115,8 @@ public class Jalview2XML
         try
         {
           tree.writeToXml(new File("word"));
-          copyFileToJar(jout, "word", tree.getTreeName());
-          jms.addExtTreeViewer(treeView);
+          copyFileToJar(jout, "word", "aptx-test");
+
 
         } catch (IOException e)
         {
@@ -3574,10 +3574,14 @@ public class Jalview2XML
   private void loadExternalTrees(jarInputStreamProvider jprovider,
           JalviewModelSequence jms, AlignViewport av)
   {
-   for (TreeFrameI externalTreeViewer: jms.getExtTreeViewer()) {
-      // String treeFile = copyJarEntry(jprovider, errorMessage, "aptx", null);
-      TreeViewerUtils.addTreeViewFrameToJalview(externalTreeViewer);
-
+    String treeFile = copyJarEntry(jprovider, "aptx-test", "aptx", null);
+    try
+    {
+      AptxInit.createInstancesFromFile(treeFile, av);
+    } catch (IOException e)
+    {
+      // TODO Auto-generated catch block
+      e.printStackTrace();
     }
     
   }
index 5ff56dd..2585df0 100644 (file)
@@ -164,11 +164,22 @@ public class JalviewModelSequence implements java.io.Serializable
     this._treeList.add(index, vTree);
   }
 
+  /**
+   * Unused.
+   * 
+   * @param treeViewer
+   */
   public void addExtTreeViewer(jalview.ext.treeviewer.TreeFrameI treeViewer)
   {
     this._extTreeList.add(treeViewer);
   }
 
+  /**
+   * Unused.
+   * 
+   * @param index
+   * @param treeViewer
+   */
   public void addExtTreeViewer(final int index,
           jalview.ext.treeviewer.TreeFrameI treeViewer)
   {
@@ -442,6 +453,13 @@ public class JalviewModelSequence implements java.io.Serializable
     return this._treeList.size();
   }
 
+  /**
+   * Unused.
+   * 
+   * @param index
+   * @return
+   * @throws java.lang.IndexOutOfBoundsException
+   */
   public jalview.ext.treeviewer.TreeFrameI getExtTreeViewer(final int index)
           throws java.lang.IndexOutOfBoundsException
   {
@@ -456,12 +474,22 @@ public class JalviewModelSequence implements java.io.Serializable
     return _extTreeList.get(index);
   }
 
+  /**
+   * Unused.
+   * 
+   * @return
+   */
   public jalview.ext.treeviewer.TreeFrameI[] getExtTreeViewer()
   {
     jalview.ext.treeviewer.TreeFrameI[] array = new jalview.ext.treeviewer.TreeFrameI[0];
     return this._extTreeList.toArray(array);
   }
 
+  /**
+   * Unused.
+   * 
+   * @return
+   */
   public int getExtTreeViewerCount()
   {
     return this._extTreeList.size();