* 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;
}
}