public void run(double frac) { TupleSet focus = m_vis.getGroup(Visualization.FOCUS_ITEMS); if (focus == null || focus.getTupleCount() == 0) return; Graph g = (Graph) m_vis.getGroup(m_group); Node f = null; @SuppressWarnings("unchecked") Iterator<Node> tuples = focus.tuples(); while (tuples.hasNext() && !g.containsTuple(f = tuples.next())) { f = null; } if (f == null) return; g.getSpanningTree(f); }
/** * Returns the node item which should be used as root of the layout. If the nextRootItem was * explicitly set, this item is returned, otherwise this method behaves like the getLayoutRoot() * method from the RadialTreeLayout */ public NodeItem getLayoutRoot() { if (m_root != null) return m_root; TupleSet ts = m_vis.getGroup(m_group); if (ts instanceof Graph) { if (nextRootItem != null) { ((Graph) ts).getSpanningTree(nextRootItem); NodeItem ret = nextRootItem; nextRootItem = null; return ret; } else { Tree tree = ((Graph) ts).getSpanningTree(); return (NodeItem) tree.getRoot(); } } else { throw new IllegalStateException( "This action's data group does" + "not resolve to a Graph instance."); } }
/** @see prefuse.data.Node#getParentEdge() */ public Edge getParentEdge() { return m_graph.getSpanningTree().getParentEdge(this); }
/** @see prefuse.data.Node#getParent() */ public Node getParent() { return m_graph.getSpanningTree().getParent(this); }
/** @see prefuse.data.Node#getDepth() */ public int getDepth() { return m_graph.getSpanningTree().getDepth(m_row); }
/** @see prefuse.data.Node#childEdges() */ public Iterator childEdges() { return m_graph.getSpanningTree().childEdges(this); }
/** @see prefuse.data.Node#getNextSibling() */ public Node getNextSibling() { return m_graph.getSpanningTree().getNextSibling(this); }
/** @see prefuse.data.Node#getPreviousSibling() */ public Node getPreviousSibling() { return m_graph.getSpanningTree().getPreviousSibling(this); }
/** @see prefuse.data.Node#getLastChild() */ public Node getLastChild() { return m_graph.getSpanningTree().getLastChild(this); }
/** @see prefuse.data.Node#getChild(int) */ public Node getChild(int idx) { return m_graph.getSpanningTree().getChild(this, idx); }
/** @see prefuse.data.Node#getChildIndex(prefuse.data.Node) */ public int getChildIndex(Node child) { return m_graph.getSpanningTree().getChildIndex(this, child); }
/** @see prefuse.data.Node#getChildCount() */ public int getChildCount() { return m_graph.getSpanningTree().getChildCount(m_row); }