当前位置: 首页>>代码示例>>Java>>正文


Java Graph.getSpanningTree方法代码示例

本文整理汇总了Java中prefuse.data.Graph.getSpanningTree方法的典型用法代码示例。如果您正苦于以下问题:Java Graph.getSpanningTree方法的具体用法?Java Graph.getSpanningTree怎么用?Java Graph.getSpanningTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在prefuse.data.Graph的用法示例。


在下文中一共展示了Graph.getSpanningTree方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import prefuse.data.Graph; //导入方法依赖的package包/类
/**
    * @see prefuse.action.Action#run(double)
    */
   public void run(double frac) {
       Graph g = (Graph)m_vis.getGroup(m_group);
       initSchema(g.getNodes());
       
       Arrays.fill(m_depths, 0);
       m_maxDepth = 0;
       
       Point2D a = getLayoutAnchor();
       m_ax = a.getX();
       m_ay = a.getY();
       
       NodeItem root = getLayoutRoot();
       Params rp = getParams(root);

g.getSpanningTree(root);
       
       // do first pass - compute breadth information, collect depth info
       firstWalk(root, 0, 1);
       
       // sum up the depth info
       determineDepths();
       
       // do second pass - assign layout positions
       secondWalk(root, null, -rp.prelim, 0);
   }
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:29,代码来源:NodeLinkTreeLayout.java

示例2: run

import prefuse.data.Graph; //导入方法依赖的package包/类
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;
    Iterator tuples = focus.tuples();
    while (tuples.hasNext() && !g.containsTuple(f=(Node)tuples.next()))
    {
        f = null;
    }
    if ( f == null ) return;
    g.getSpanningTree(f);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:15,代码来源:RadialGraphView.java

示例3: update

import prefuse.data.Graph; //导入方法依赖的package包/类
public void update() {
	Graph templateGraph = TemplateModel.get("Root").getTemplateGraph();
	
	Tree tree = templateGraph.getSpanningTree();
	
	JPrefuseTree.showTreeWindow(tree, "name");
	
	jtree = new JPrefuseTree(tree, "name");
	CheckBoxTreeRenderer render = new CheckBoxTreeRenderer();
	jtree.setCellRenderer(render);
	jtree.setEditable(true);
	
	NodTableEditor editor = new NodTableEditor();
	editor.setListener(new IEventListener() {

		public void onEvent(Event e) {
			EventDispatcher.fireEvent(this, new Event(CEvents.ITEM_MODIFIED, e.getData()));
		}
		
	});

	jtree.setCellEditor(editor);
	JTabbedPane tp = new JTabbedPane();
	tp.add(new JScrollPane(jtree), "Tree");
	tp.add(new TreeView(tree, "name"), "Tree View");
	
	
	add(tp, BorderLayout.CENTER);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:30,代码来源:TemplateTree.java

示例4: run

import prefuse.data.Graph; //导入方法依赖的package包/类
/**
    * @see prefuse.action.Action#run(double)
    */
   public void run(double frac) {
       Graph g = (Graph)m_vis.getGroup(m_group);
       initSchema(g.getNodes());
       
       m_origin = getLayoutAnchor();
       NodeItem n = getLayoutRoot();
       Params np = (Params)n.get(PARAMS);

g.getSpanningTree(n);
       
       // calc relative widths and maximum tree depth
       // performs one pass over the tree
       m_maxDepth = 0;
       calcAngularWidth(n, 0);
       
       if ( m_autoScale ) setScale(getLayoutBounds());
       if ( !m_setTheta ) calcAngularBounds(n);
               
       // perform the layout
       if ( m_maxDepth > 0 )
           layout(n, m_radiusInc, m_theta1, m_theta2);
       
       // update properties of the root node
       setX(n, null, m_origin.getX());
       setY(n, null, m_origin.getY());
       np.angle = m_theta2-m_theta1;
   }
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:31,代码来源:RadialTreeLayout.java


注:本文中的prefuse.data.Graph.getSpanningTree方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。