package jalview.ext.treeviewer;
import jalview.datamodel.SequenceI;
-import jalview.ext.archaeopteryx.JalviewBinding;
import jalview.util.MessageManager;
import jalview.viewmodel.AlignmentViewport;
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());
}
+ /**
+ * 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,