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


Java DirectedGraph类代码示例

本文整理汇总了Java中org.eclipse.draw2d.graph.DirectedGraph的典型用法代码示例。如果您正苦于以下问题:Java DirectedGraph类的具体用法?Java DirectedGraph怎么用?Java DirectedGraph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: contributeNodesToGraph

import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public void contributeNodesToGraph(DirectedGraph graph, HashMap map){
	Node node = new Node(this);
	node.width = getFigure().getBounds().width;//getNode().getWidth();
	int height = 22;
	if (((CFGNode)getModel()).getBefore() != null){
		height += ((CFGNode)getModel()).getBefore().getChildren().size() * 22;
	}
	if (((CFGNode)getModel()).getAfter() != null){
		height += ((CFGNode)getModel()).getAfter().getChildren().size() * 22;
	}
	node.height = height;//getFigure().getBounds().height;
	graph.nodes.add(node);
	map.put(this, node);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:15,代码来源:CFGNodeEditPart.java

示例2: contributeEdgesToGraph

import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public void contributeEdgesToGraph(DirectedGraph graph, HashMap map) {
	List outgoing = getSourceConnections();
	for (int i = 0; i < outgoing.size(); i++){
		CFGEdgeEditPart edge = (CFGEdgeEditPart)outgoing.get(i);
		edge.contributeToGraph(graph, map);
	}
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:8,代码来源:CFGNodeEditPart.java

示例3: applyGraphResults

import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public void applyGraphResults(DirectedGraph graph, HashMap map){
	Node node = (Node)map.get(this);
	((CFGNodeFigure)getFigure()).setBounds(new Rectangle(node.x, node.y, node.width, node.height));//getFigure().getBounds().height));//getFigure().getBounds().height));
	List outgoing = getSourceConnections();
	for (int i = 0; i < outgoing.size(); i++){
		CFGEdgeEditPart edge = (CFGEdgeEditPart)outgoing.get(i);
		edge.applyGraphResults(graph, map);
	}

}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:11,代码来源:CFGNodeEditPart.java

示例4: visit

import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public void visit(DirectedGraph graph) {
	try {
		this.graph = graph;
		this.nodeList = graph.nodes;
		this.edgeList = graph.edges;

		// iterate through all of the nodes in the node list
		for (Iterator iter = nodeList.iterator(); iter.hasNext();) {
			Node node = (Node) iter.next();

			// check whether we have already come across this node
			if (!encountered.contains(node)) {
				// create a new cluster for this node
				currentCluster = new Cluster();
				clusters.add(currentCluster);
				encountered.add(node);
				currentCluster.set.add(node);

				// System.out.println("Adding to NEW cluster: " + node + ", cluster: "
				// + currentCluster);
				// recursively add any other nodes reachable from it
				int depth = INITIAL_RECURSION_DEPTH;
				recursivelyAddToCluster(node, depth);
			} else {
				// System.out.println("Already encountered: " + node);
			}
		}
		coalesceRemainingClusters();

		// System.out.println("");
		joinClusters();
	} catch (RuntimeException e) {
		e.printStackTrace();
		throw e;
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:37,代码来源:ClusterEdgeCreator.java

示例5: init

import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
/**
 * @param graph
 */
private void init(DirectedGraph graph) {
	this.graph = graph;
	this.nodeList = graph.nodes;
	this.edgeList = graph.edges;
	edgesAdded = new ArrayList<Edge>();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:10,代码来源:DummyEdgeCreator.java

示例6: layoutDiagram

import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public void layoutDiagram(AbstractGraphicalEditPart diagram) {
	partToNodesMap = new HashMap<AbstractGraphicalEditPart, Object>();
	graph = new DirectedGraph();
	graph.setDirection(PositionConstants.EAST);
	addNodes(diagram);
	Rectangle r = diagram.getFigure().getBounds();
	if (r.x < -1000 || r.y < -1000)
		return;
	if (graph.nodes.size() > 0) {
		addEdges(diagram);
		new NodeJoiningDirectedGraphLayout().visit(graph);
		applyChildrenResults(diagram);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:DirectedGraphLayoutVisitor.java

示例7: HierarchicalLayout

import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public HierarchicalLayout()
{
  this.contourToNode = TypeTools.newHashMap();
  this.graph = new DirectedGraph();
  this.nodeColors = TypeTools.newHashMap();
  this.nodeToPosition = TypeTools.newHashMap();
  this.staticNodes = TypeTools.newHashMap();
}
 
开发者ID:UBPL,项目名称:jive,代码行数:9,代码来源:ContourGraphFactory.java

示例8: TabularLayout

import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public TabularLayout()
{
  this.contourToNode = TypeTools.newHashMap();
  this.graph = new DirectedGraph();
  this.nodeCells = TypeTools.newHashMap();
  this.nodeColors = TypeTools.newHashMap();
  this.nodeColumns = TypeTools.newHashMap();
  this.nodeLayers = TypeTools.newHashMap();
  this.nodeSections = TypeTools.newHashMap();
}
 
开发者ID:UBPL,项目名称:jive,代码行数:11,代码来源:ContourGraphFactory.java

示例9: visit

import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
/**
 * Lays out the given graph.
 * 
 * @param graph the graph to layout.
 * @see org.eclipse.draw2d.graph#visit(DirectedGraph)
 */
@Override
public void visit(DirectedGraph graph) {
    super.visit(graph);

    DcaseDirectedGraph ddg = new DcaseDirectedGraph(graph);
    for (int i = 0; i < steps.size(); i++) {
        DcaseGraphVisitor visitor = (DcaseGraphVisitor) steps.get(i);
        visitor.visit(ddg);
    }
}
 
开发者ID:d-case,项目名称:d-case_editor,代码行数:17,代码来源:DcaseDirectedGraphLayout.java

示例10: visit

import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
/**
 * @param clean
 *          next time
 */
public void visit(DirectedGraph g) {
	cleanNextTime = true;
	init(g);
	setDummyEdges();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:10,代码来源:DummyEdgeCreator.java

示例11: DcaseDirectedGraph

import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
/**
 * Creates the DcaseDirectGraph and initializes it.
 * 
 * @param graph the direct graph.
 */
public DcaseDirectedGraph(DirectedGraph graph) {
    this.graph = graph;
    map.clear();
    baseNodeList.clear();
}
 
开发者ID:d-case,项目名称:d-case_editor,代码行数:11,代码来源:DcaseDirectedGraph.java

示例12: visit

import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public void visit(DirectedGraph graph) {

		new DummyEdgeCreator().visit(graph);
		new ClusterEdgeCreator().visit(graph);

		super.visit(graph);
	}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:8,代码来源:NodeJoiningDirectedGraphLayout.java


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