JAL-1953 some more comments, moved JalviewBinding
[jalview.git] / src / jalview / ext / treeviewer / TreeViewerUtils.java
index d5c1327..7e1a4e9 100644 (file)
@@ -1,7 +1,6 @@
 package jalview.ext.treeviewer;
 
 import jalview.datamodel.SequenceI;
-import jalview.ext.archaeopteryx.JalviewBinding;
 import jalview.util.MessageManager;
 import jalview.viewmodel.AlignmentViewport;
 
@@ -10,15 +9,32 @@ import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
 
+/**
+ * Static class containing generic methods for communicating between the tree
+ * viewer frame and Jalview, currently includes adding the frame to the Jalview
+ * Desktop and triggering an association between an {@link AlignmentViewport}
+ * and {@link TreeFrameI}.
+ * 
+ * @author kjvanderheide
+ *
+ */
 public final class TreeViewerUtils
 {
+  /**
+   * All tree viewers should be added to this map so that Jalview saves them to
+   * its project.
+   */
   private static Map<TreeFrameI, TreeViewerBindingI> activeViews = new HashMap<>();
 
+  /**
+   * Adds the given tree frame to the Jalview {@link Desktop}.
+   * 
+   * @param treeFrame
+   * @return the same tree frame but now as part of Jalview.
+   */
   public static TreeFrameI addTreeViewFrameToJalview(
-          final TreeFrameI treeFrame)
+          final TreeFrameI treeFrame, int width, int height)
   {
-    int width = 400;
-    int height = 550;
     treeFrame.setMinimumSize(new Dimension(width, height));
     // aptxApp.setFont(Desktop.instance.getFont());
     // aptxApp.getMainPanel().setFont(Desktop.instance.getFont());
@@ -41,6 +57,16 @@ public final class TreeViewerUtils
   
   }
 
+  /**
+   * Convience method for building the association between Jalview's alignment
+   * and the tree frame.
+   * 
+   * @param treeFrame
+   * @param jalviewAlignViewport
+   * @param alignMappedToNodes
+   * @param nodesMappedToAlign
+   * @return
+   */
   public static TreeViewerBindingI associateNodesWithJalviewSequences(
           final TreeFrameI treeFrame,
           final AlignmentViewport jalviewAlignViewport,