本文整理汇总了Java中edu.uci.ics.jung.visualization.decorators.EllipseVertexShapeTransformer类的典型用法代码示例。如果您正苦于以下问题:Java EllipseVertexShapeTransformer类的具体用法?Java EllipseVertexShapeTransformer怎么用?Java EllipseVertexShapeTransformer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EllipseVertexShapeTransformer类属于edu.uci.ics.jung.visualization.decorators包,在下文中一共展示了EllipseVertexShapeTransformer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initGraph
import edu.uci.ics.jung.visualization.decorators.EllipseVertexShapeTransformer; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void initGraph() {
try {
labelMap = new HashMap();
iconMap = new HashMap();
graph = new DelegateForest();
treeLayout = new TreeLayout(graph);
balloonLayout = new BalloonLayout(graph);
vv = new VisualizationViewer(balloonLayout);
vv.setSize(new Dimension(800, 800));
refreshGraph();
vv.setBackground(Color.white);
vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line());
vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());
vv.setVertexToolTipTransformer(new EntityTransformer());
graphPanel = new GraphZoomScrollPane(vv);
DefaultModalGraphMouse mouse = new DefaultModalGraphMouse();
vv.setGraphMouse(mouse);
mouse.add(new MemoriaGraphMouse(this));
// T O D O MemoriaPanel compile error suppress 2 lines
//VertexStringerImpl localVertexStringerImpl = new VertexStringerImpl(/*this.labelMap*/);
//this.vv.getRenderContext().setVertexLabelTransformer(new VertexStringerImpl(/*localVertexStringerImpl*/));
VertexIconShapeTransformer transformer = new VertexIconShapeTransformer(new EllipseVertexShapeTransformer());
DefaultVertexIconTransformer iconTransformer = new DefaultVertexIconTransformer();
transformer.setIconMap(iconMap);
iconTransformer.setIconMap(iconMap);
vv.getRenderContext().setVertexShapeTransformer(transformer);
vv.getRenderContext().setVertexIconTransformer(iconTransformer);
} catch (Exception exc) {
SbApp.error("MemoriaPanel.initGraph()",exc);
}
}
示例2: createGraphViewer
import edu.uci.ics.jung.visualization.decorators.EllipseVertexShapeTransformer; //导入依赖的package包/类
private void createGraphViewer() {
MyVisualizationViewer vv = this;
vv.addGraphMouseListener(new TestGraphMouseListener<String>());
// add my listeners for ToolTips
vv.setVertexToolTipTransformer(createNodeTooltipTransformer());
final VertexIconShapeTransformer<String> vertexImageShapeFunction =
new VertexIconShapeTransformer<String>(new EllipseVertexShapeTransformer<String>());
vv.getRenderContext().setVertexShapeTransformer(vertexImageShapeFunction);
final DefaultVertexIconTransformer<String> vertexIconFunction =
new DefaultVertexIconTransformer<String>();
vv.getRenderContext().setVertexIconTransformer(vertexIconFunction);
vertexImageShapeFunction.setIconMap(iconMap);
vertexIconFunction.setIconMap(iconMap);
vv.setEdgeToolTipTransformer(createEdgeToolTipTransformer());
vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<String>());
vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.AUTO);
// Set up a new stroke Transformer for the edges
// float dash[] = {10.0f};
// final Stroke edgeStroke = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,
// BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f);
// Transformer<String, Stroke> edgeStrokeTransformer =
// new Transformer<String, Stroke>() {
// public Stroke transform(String s) {
// return edgeStroke;
// }
// };
// vv.getRenderContext().setEdgeStrokeTransformer(edgeStrokeTransformer);
vv.getRenderContext().setEdgeStrokeTransformer(createEdgeStrokeTransformer());
vv.getRenderContext().setEdgeLabelTransformer(createEdgeLabelTransformer());
vv.getRenderContext().setEdgeLabelRenderer(new DefaultEdgeLabelRenderer(Color.cyan));
vv.getRenderContext().setEdgeDrawPaintTransformer(createEdgeDrawPaintTransformer());
}