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

Java Graph类代码示例

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

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



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

示例1: GraphViewerZoomable

import org.eclipse.zest.core.widgets.Graph; //导入依赖的package包/类
GraphViewerZoomable(Composite composite, int style) {
	super(composite, style);
	getZoomManager().setZoom(1.0);
	Graph graph = getGraphControl();
	graph.setScrollBarVisibility(FigureCanvas.ALWAYS);
	graph.setTouchEnabled(false);
	graph.addGestureListener(new GestureListener() {
		public void gesture(GestureEvent e) {
			if(e.detail == SWT.GESTURE_MAGNIFY)
				zoom(e.magnification);
		}
	});
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:14,代码来源:GraphViewerZoomable.java


示例2: clearGraph

import org.eclipse.zest.core.widgets.Graph; //导入依赖的package包/类
public static void clearGraph(Graph graph){		
	List<?> nodes=graph.getNodes();
	List<GraphNode> nodeList=new ArrayList<GraphNode>(nodes.size());
	for(Object node: nodes){
		nodeList.add((GraphNode)node);
	}
	for(int i=0;i<nodeList.size();i++){
		nodeList.get(i).dispose();
	}
	nodeList=null;
	if(graph instanceof CGraph){
		((CGraph)graph).removeAllData();
	}
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:15,代码来源:WorkerInstancesComposite2.java


示例3: mouseDown

import org.eclipse.zest.core.widgets.Graph; //导入依赖的package包/类
@Override public void mouseDown(MouseEvent e) {
	System.out.println(e);
	assert(e.getSource()==flowGraph);
	List<?> selection = ((Graph) e.widget).getSelection();
	if(selection.size()==1){
		GraphNode node=(GraphNode)selection.get(0);
		flowGraphNodeSelected(node);
	}
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:10,代码来源:WorkerInstancesComposite2.java


示例4: mouseDoubleClick

import org.eclipse.zest.core.widgets.Graph; //导入依赖的package包/类
@Override
public void mouseDoubleClick(MouseEvent e) {
	System.out.println(e);
	assert(e.getSource()==flowGraph);
	List<?> selection = ((Graph) e.widget).getSelection();
	if(selection.size()==1){
		GraphNode node=(GraphNode)selection.get(0);
		flowGraphNodeDoubleClicked(node);
	}
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:11,代码来源:WorkerInstancesComposite2.java


示例5: createGraphSection

import org.eclipse.zest.core.widgets.Graph; //导入依赖的package包/类
/**
 * Creates the section of the form where the graph is drawn
 *
 * @param parent Composite
 */
private void createGraphSection(Composite parent) {
    Section section = this.toolkit.createSection(parent, Section.TITLE_BAR);
    thumbnailNavigator = new ThumbnailNavigator(section, SWT.NONE);
    viewer = new InternalGraphViewer(thumbnailNavigator, SWT.NONE);
    viewer.getGraphControl().setVerticalScrollBarVisibility(FigureCanvas.NEVER);
    viewer.getGraphControl().setHorizontalScrollBarVisibility(FigureCanvas.NEVER);
    thumbnailNavigator.setGraph((Graph) viewer.getControl());
    thumbnailNavigator.setSize(100, 25);
    section.setClient(thumbnailNavigator);
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:16,代码来源:ResolveVisualizerForm.java


示例6: InternalGraphViewer

import org.eclipse.zest.core.widgets.Graph; //导入依赖的package包/类
public InternalGraphViewer(Composite parent, int style) {
    super(parent, style);
    Graph graph = new Graph(parent, style) {
        public Point computeSize(int hint, int hint2, boolean changed) {
            return new Point(0, 0);
        }
    };
    setControl(graph);
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:10,代码来源:ResolveVisualizerForm.java


示例7: setGraph

import org.eclipse.zest.core.widgets.Graph; //导入依赖的package包/类
public void setGraph(Graph graph) {
    if (graph.getParent() != this) {
        throw new AssertionError("Graph must be a child of this zoomable composite.");
    }
    createContents(graph);
    tb.setViewport(graph.getViewport());
    tb.setSource(graph.getContents());
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:9,代码来源:ResolveVisualizerForm.java


示例8: focusOn

import org.eclipse.zest.core.widgets.Graph; //导入依赖的package包/类
/**
 * Update the view to focus on a particular bundle. If record history is set to true, and bundle does not equal the
 * current bundle, then the current bundle will be saved on the history stack
 *
 * @param focus IvyNodeElement
 */
@SuppressWarnings("unchecked")
public void focusOn(IvyNodeElement focus) {
    viewer.setSelection(new StructuredSelection(focus));
    viewer.setFilters(new ViewerFilter[] {});
    viewer.setInput(focus);

    Graph graph = viewer.getGraphControl();
    Dimension centre = new Dimension(graph.getBounds().width / 2, graph.getBounds().height / 2);
    List<GraphNode> list = (List<GraphNode>) viewer.getGraphControl().getNodes();
    for (GraphNode graphNode : list) {
        if (graphNode.getLocation().x <= 1 && graphNode.getLocation().y <= 1) {
            graphNode.setLocation(centre.width, centre.height);
        }
    }

    currentRoot = focus;

    if (viewer.getGraphControl().getNodes().size() > 0) {
        visualizationForm.enableSearchBox(true);
    } else {
        visualizationForm.enableSearchBox(false);
    }
    visualizationForm.enableSearchBox(true);
    focusOnSelectionAction.setEnabled(true);

    selectionChanged(focus);
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:34,代码来源:ResolveVisualizerView.java


示例9: MapView

import org.eclipse.zest.core.widgets.Graph; //导入依赖的package包/类
public MapView(Composite parent) {
	super(parent, SWT.NONE);
	setLayout(new GridLayout(1, false));

	Composite cupper = new CTComposite(this, SWT.BORDER);
	cupper.setLayout(new GridLayout(1, false));
	cupper.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1,
			1));

	new CTLabel(cupper, SWT.NONE);

	Composite composite = new CTComposite(this, SWT.NONE);
	composite.setLayout(new GridLayout(1, false));
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1,
			1));

	Canvas c = new Canvas(composite, SWT.NONE);
	c.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	composite.addControlListener(new ControlAdapter() {
		@Override
		public void controlResized(ControlEvent arg0) {
			c.setSize(composite.getSize().x, composite.getSize().y);
		}
	});
	c.setLayout(new GridLayout(1, false));

	graph = new Graph(c, SWT.NONE);
	graph.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	c.addPaintListener((e) -> {
		GC gc = e.gc;
		graph.getContents().paint(new SWTGraphics(gc));
	});
}
 
开发者ID:CollabThings,项目名称:collabthings.swt,代码行数:36,代码来源:MapView.java


示例10: construct

import org.eclipse.zest.core.widgets.Graph; //导入依赖的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.Graph类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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