• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java GraphConnection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: flowGraphNodeDoubleClicked

import org.eclipse.zest.core.widgets.GraphConnection; //导入依赖的package包/类
public void flowGraphNodeDoubleClicked(GraphNode node){
	DerivedStreamContainer psc=gs.getContainerNameMap().get(node.getData());
	if(psc==null){
		return;
	}
	for(Long downId: psc.getDownContainerIdList()){
		DerivedStreamContainer downStream=gs.getContainerIdMap().get(downId);
		if(downStream==null){ return; }
		if(flowGraph.getData(downStream.getUniqueName())==null){
			GraphNode downNode=newFlowGraphNode(downStream);
			new GraphConnection(flowGraph, SWT.ARROW, node, downNode);
		}
	}
	flowGraph.removeMouseListener(flowGraphListener);
	flowGraph.setLayoutAlgorithm(flowLayoutAlgorithm, true);
	flowGraph.addMouseListener(flowGraphListener);
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:18,代码来源:WorkerInstancesComposite2.java


示例2: createConnections

import org.eclipse.zest.core.widgets.GraphConnection; //导入依赖的package包/类
private void createConnections(Refinement refinement) {
    int connectionStyle = ZestStyles.CONNECTIONS_DIRECTED;
    for (RefinementReason reason : refinement.getReasons()) {

        VariationPoint sourceVP = reason.getSource();
        VariationPoint targetVP = reason.getTarget();

        GraphNode source = nodeIndex.get(sourceVP);
        GraphNode target = nodeIndex.get(targetVP);

        if (!isValidNewConnection(source, target)) {
            continue;
        }

        GraphConnection connection = new GraphConnection(this, connectionStyle, source, target);
        connection.setHighlightColor(COLOR_CONNECTION_HIGHLIGHT);
        if (!areFocused(sourceVP, targetVP)) {
            connection.setLineStyle(SWT.LINE_DASH);
            connection.setLineColor(COLOR_CONNECTION_NOTFOCUSED);
        } else {
            connection.setLineColor(COLOR_CONNECTION_FOCUSED);
        }
        connection.setTooltip(new Label(reason.getReason()));
        connectedNodes.put(source, target);
    }
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:27,代码来源:RefinementGraph.java


示例3: clear

import org.eclipse.zest.core.widgets.GraphConnection; //导入依赖的package包/类
/**
 * Clear the graph.
 */
public void clear() {
    nodeIndex.clear();
    connectedNodes.clear();
    focusedRefinement = null;

    Object[] nodeArray = getNodes().toArray();
    for (Object nodeObj : nodeArray) {
        ((GraphNode) nodeObj).dispose();
    }
    Object[] connectionArray = getConnections().toArray();
    for (Object connectionObj : connectionArray) {
        ((GraphConnection) connectionObj).dispose();
    }

    this.layout();

}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:21,代码来源:RefinementGraph.java


示例4: instanceTableCellSelected

import org.eclipse.zest.core.widgets.GraphConnection; //导入依赖的package包/类
public void instanceTableCellSelected(String instanceName){
	if(instanceName==null){
		return;
	}
	DerivedStreamContainer dsc=gs.getContainerNameMap().get(instanceName);

	clearGraph(flowGraph);
	if(dsc==null){
		return;
	}
	
	GraphNode selfNode=newFlowGraphNode(dsc);			
	for(Stream upStream: dsc.getUpStreams()){
		GraphNode upNode=newFlowGraphNode(upStream);				
		new GraphConnection(flowGraph, SWT.ARROW, upNode, selfNode); 
	}
	for(Long downId: dsc.getDownContainerIdList()){
		DerivedStreamContainer downStream=gs.getContainerIdMap().get(downId);
		if(downStream==null){ return; }
		GraphNode downNode=newFlowGraphNode(downStream);				
		new GraphConnection(flowGraph, SWT.ARROW, selfNode, downNode);
	}
	flowGraph.removeMouseListener(flowGraphListener);
	flowGraph.setLayoutAlgorithm(flowLayoutAlgorithm, true);
	flowGraph.addMouseListener(flowGraphListener);
	
	updateInstanceStatTable(instanceName);
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:29,代码来源:WorkerInstancesComposite2.java


示例5: addFactoryState

import org.eclipse.zest.core.widgets.GraphConnection; //导入依赖的package包/类
private void addFactoryState(int depth, GraphNode envnode,
		CTFactoryState state) {
	GraphNode factorystatenode = getNode(state, "" + state);
	factorystatenode.setBackgroundColor(graph.LIGHT_BLUE);
	setNodeLocation(depth, factorystatenode);

	new GraphConnection(graph, SWT.NONE, envnode, factorystatenode);

	CTFactory factory = state.getFactory();
	addFactory(depth + 3, factorystatenode, factory);

	List<CTFactoryState> fs = state.getFactories();
	for (CTFactoryState childstate : fs) {
		addFactoryState(depth + 3, factorystatenode, childstate);
	}

	List<CTToolUser> toolusers = state.getToolUsers();
	for (CTToolUser tooluser : toolusers) {
		String toolname = tooluser.getName();
		if (toolname == null) {
			toolname = "" + tooluser;
		}

		GraphNode toolusernode = getNode(tooluser, toolname);
		setNodeLocation(depth, toolusernode);
		new GraphConnection(graph, SWT.NONE, factorystatenode, toolusernode);
	}
}
 
开发者ID:CollabThings,项目名称:collabthings.swt,代码行数:29,代码来源:MapView.java


示例6: addFactory

import org.eclipse.zest.core.widgets.GraphConnection; //导入依赖的package包/类
private void addFactory(int depth, GraphNode parent, CTFactory factory) {
	GraphNode factorynode = getNode(factory, "" + factory);
	setNodeLocation(depth, factorynode);

	new GraphConnection(graph, SWT.NONE, parent, factorynode);

	Set<String> fs = factory.getFactories();
	for (String string : fs) {
		CTAttachedFactory childfactory = factory.getFactory(string);
		addFactory(depth + 3, factorynode, childfactory.getFactory());
	}

	addEnvironment(depth + 1, factorynode, factory.getEnvironment());
}
 
开发者ID:CollabThings,项目名称:collabthings.swt,代码行数:15,代码来源:MapView.java


示例7: addEnvironment

import org.eclipse.zest.core.widgets.GraphConnection; //导入依赖的package包/类
private void addEnvironment(int depth, GraphNode parent,
		CTEnvironment environment) {
	Set<String> tools = environment.getTools();

	for (String string : tools) {
		CTTool tool = environment.getTool(string);
		GraphNode toolnode = getNode(tool, string);
		setNodeLocation(depth, toolnode);
		new GraphConnection(graph, SWT.NONE, parent, toolnode);
	}
}
 
开发者ID:CollabThings,项目名称:collabthings.swt,代码行数:12,代码来源:MapView.java


示例8: clear

import org.eclipse.zest.core.widgets.GraphConnection; //导入依赖的package包/类
private void clear() {
	List<GraphConnection> cs = new LinkedList<GraphConnection>(
			graph.getConnections());
	for (GraphConnection c : cs) {
		c.dispose();
	}

	List<GraphNode> ns = new LinkedList<GraphNode>(graph.getNodes());
	for (GraphNode graphNode : ns) {
		graphNode.dispose();
	}

	nodes.clear();
}
 
开发者ID:CollabThings,项目名称:collabthings.swt,代码行数:15,代码来源:MapView.java


示例9: construct

import org.eclipse.zest.core.widgets.GraphConnection; //导入依赖的package包/类
@Override
public Control construct(Composite parent) {
	Composite content = new Composite(parent, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(content);
	GridLayoutFactory.fillDefaults().numColumns(1).applyTo(content);

	Graph graph = new Graph(content, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(graph);
	// now a few nodes
	GraphNode node1 = new GraphNode(graph, SWT.NONE, "Jim");
	GraphNode node2 = new GraphNode(graph, SWT.NONE, "Jack");
	GraphNode node3 = new GraphNode(graph, SWT.NONE, "Joe");
	GraphNode node4 = new GraphNode(graph, SWT.NONE, "Bill");
	// Lets have a directed connection
	new GraphConnection(graph, ZestStyles.CONNECTIONS_DIRECTED, node1,
			node2);
	// Lets have a dotted graph connection
	new GraphConnection(graph, ZestStyles.CONNECTIONS_DOT, node2, node3);
	// Standard connection
	new GraphConnection(graph, SWT.NONE, node3, node1);
	// Change line color and line width
	GraphConnection graphConnection = new GraphConnection(graph, SWT.NONE,
			node1, node4);
	graphConnection.changeLineColor(parent.getDisplay().getSystemColor(SWT.COLOR_GREEN));
	// Also set a text
	graphConnection.setText("This is a text");
	graphConnection.setHighlightColor(parent.getDisplay().getSystemColor(SWT.COLOR_RED));
	graphConnection.setLineWidth(3);

	graph.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
	// Selection listener on graphConnect or GraphNode is not supported
	// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=236528
	graph.addSelectionListener(new SelectionAdapter() {

		@Override
		public void widgetSelected(SelectionEvent e) {
			System.out.println(e);
		}

	});

	return content;
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:44,代码来源:ZestMockup.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FastFourierTransformer类代码示例发布时间:2022-05-22
下一篇:
Java Locations类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap