Package org.phylowidget.tree

Examples of org.phylowidget.tree.RootedTree$DepthToRootComparator


    r.render.layoutTrigger();
  }

  public void nodeAddSister() {
    NodeRange r = curRange();
    RootedTree tree = r.render.getTree();
    PhyloNode sis = (PhyloNode) tree.createAndAddVertex("");
    tree.addSisterNode(curNode(), sis);
  }
View Full Code Here


    tree.addSisterNode(curNode(), sis);
  }

  public void nodeAddChild() {
    NodeRange r = curRange();
    RootedTree tree = r.render.getTree();
    tree.addChildNode(curNode());
  }
View Full Code Here

    clipboard.clearClipboard();
  }

  public void nodeDelete() {
    NodeRange r = curRange();
    RootedTree g = r.render.getTree();
    synchronized (g) {
      g.deleteNode(curNode());
    }
  }
View Full Code Here

    }
  }

  public void nodeDeleteSubtree() {
    NodeRange r = curRange();
    RootedTree g = r.render.getTree();
    synchronized (g) {
      g.deleteSubtree(curNode());
    }
  }
View Full Code Here

    t.modPlus();
    layout();
  }

  public void treeAutoSort() {
    RootedTree tree = getCurTree();
    tree.ladderizeSubtree(tree.getRoot());
    layout();
  }
View Full Code Here

    tree.ladderizeSubtree(tree.getRoot());
    layout();
  }

  public void treeRemoveElbows() {
    RootedTree tree = getCurTree();
    synchronized (tree) {
      tree.cullElbowsBelow(tree.getRoot());
    }
    layout();
  }
View Full Code Here

  protected void startEditing(NodeRange r, int editMode)
  {
    PhyloWidget.ui.setMessage("Enter to commit, Esc to revert.");
    this.editMode = editMode;
    curRange = r;
    RootedTree t = r.render.getTree();
    reset();
    oldValue = null;
    switch (editMode)
    {
      case (LABEL):
        oldValue = t.getLabel(r.node);
        break;
      case (BRANCH_LENGTH):
        oldValue = String.valueOf(t.getBranchLength(r.node));
        break;
    }
    text.replace(0, text.length(), oldValue);
    show();
    FocusManager.instance.setModalFocus(this);
View Full Code Here

  }

  void hideAndCommit()
  {
    hide();
    RootedTree t = curRange.render.getTree();
    if (t instanceof PhyloTree)
    {
      PhyloTree pt = (PhyloTree) t;
      pt.updateNewick();
    }
View Full Code Here

      /*
       * If we haven't set a "focused" NodeRange yet, set it to the root
       * node.
       */
      TreeRenderer render = PhyloWidget.trees.getRenderer();
      RootedTree t = render.getTree();
      PhyloNode n = (PhyloNode) t.getRoot();
      curNodeRange = rangeForNode(render, n);
    }
    return curNodeRange;
  }
View Full Code Here

     * The LEFT or RIGHT directions should always go IN or OUT of the tree,
     * while the up and down will use the score-based search.
     */
    if (dir == LEFT || dir == RIGHT)
    {
      RootedTree t = cur.render.getTree();
      PhyloNode curNode = null;
      if (dir == LEFT)
      {
        if (t.getParentOf(cur.node) != null)
        {
          curNode = (PhyloNode) t.getParentOf(cur.node);
          setCurRange(rangeForNode(cur.render, curNode));
          return;
        }
      } else if (dir == RIGHT)
      {
        if (!t.isLeaf(cur.node))
        {
          List kids = t.getChildrenOf(cur.node);
          curNode = (PhyloNode) kids.get(kids.size() - 1);
          setCurRange(rangeForNode(cur.render, curNode));
          return;
        }
      }
View Full Code Here

TOP

Related Classes of org.phylowidget.tree.RootedTree$DepthToRootComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.