예제 #1
0
    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.");
    }
  }
예제 #3
0
 /** @see prefuse.data.Node#getParentEdge() */
 public Edge getParentEdge() {
   return m_graph.getSpanningTree().getParentEdge(this);
 }
예제 #4
0
 /** @see prefuse.data.Node#getParent() */
 public Node getParent() {
   return m_graph.getSpanningTree().getParent(this);
 }
예제 #5
0
 /** @see prefuse.data.Node#getDepth() */
 public int getDepth() {
   return m_graph.getSpanningTree().getDepth(m_row);
 }
예제 #6
0
 /** @see prefuse.data.Node#childEdges() */
 public Iterator childEdges() {
   return m_graph.getSpanningTree().childEdges(this);
 }
예제 #7
0
 /** @see prefuse.data.Node#getNextSibling() */
 public Node getNextSibling() {
   return m_graph.getSpanningTree().getNextSibling(this);
 }
예제 #8
0
 /** @see prefuse.data.Node#getPreviousSibling() */
 public Node getPreviousSibling() {
   return m_graph.getSpanningTree().getPreviousSibling(this);
 }
예제 #9
0
 /** @see prefuse.data.Node#getLastChild() */
 public Node getLastChild() {
   return m_graph.getSpanningTree().getLastChild(this);
 }
예제 #10
0
 /** @see prefuse.data.Node#getChild(int) */
 public Node getChild(int idx) {
   return m_graph.getSpanningTree().getChild(this, idx);
 }
예제 #11
0
 /** @see prefuse.data.Node#getChildIndex(prefuse.data.Node) */
 public int getChildIndex(Node child) {
   return m_graph.getSpanningTree().getChildIndex(this, child);
 }
예제 #12
0
 /** @see prefuse.data.Node#getChildCount() */
 public int getChildCount() {
   return m_graph.getSpanningTree().getChildCount(m_row);
 }