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


Java VertexIconAndShapeFunction类代码示例

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


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

示例1: GraphPreviewPanel

import edu.uci.ics.jung.graph.decorators.VertexIconAndShapeFunction; //导入依赖的package包/类
/**
 * create an instance of a simple graph with controls to demo the zoom features.
 *
 * @param peopleList
 *            the people list
 * @param links
 *            the links
 * @throws UNISoNException
 *             the UNI so n exception
 */
public GraphPreviewPanel(final LinkedList<String> peopleList, final List<Relationship> links)
        throws UNISoNException {
	// create a simple graph for the demo
	this.graph = new DirectedSparseGraph();
	final Vertex[] v = this.createEdges(links, peopleList);

	final PluggableRenderer pr = new PluggableRenderer();
	pr.setVertexStringer(new UnicodeVertexStringer(v, peopleList));
	pr.setVertexPaintFunction(
	        new PickableVertexPaintFunction(pr, Color.lightGray, Color.white, Color.yellow));
	pr.setGraphLabelRenderer(new DefaultGraphLabelRenderer(Color.cyan, Color.cyan));
	final VertexIconAndShapeFunction dvisf = new VertexIconAndShapeFunction(
	        new EllipseVertexShapeFunction());
	pr.setVertexShapeFunction(dvisf);
	pr.setVertexIconFunction(dvisf);
	this.vv = new VisualizationViewer(new FRLayout(this.graph), pr);
	this.vv.setPickSupport(new ShapePickSupport());
	pr.setEdgeShapeFunction(new EdgeShape.QuadCurve());
	this.vv.setBackground(Color.white);

	// add my listener for ToolTips
	this.vv.setToolTipFunction(new DefaultToolTipFunction());

	// create a frome to hold the graph
	final GraphZoomScrollPane panel = new GraphZoomScrollPane(this.vv);
	this.add(panel);
	// this.add(vv);
	final ModalGraphMouse gm = new DefaultModalGraphMouse();
	this.vv.setGraphMouse(gm);

	// showLabels = true;
}
 
开发者ID:leonarduk,项目名称:unison,代码行数:43,代码来源:GraphPreviewPanel.java


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