本文整理匯總了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;
}