本文整理汇总了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;
}