當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。