本文整理汇总了Java中edu.uci.ics.jung.visualization.decorators.VertexIconShapeTransformer类的典型用法代码示例。如果您正苦于以下问题:Java VertexIconShapeTransformer类的具体用法?Java VertexIconShapeTransformer怎么用?Java VertexIconShapeTransformer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VertexIconShapeTransformer类属于edu.uci.ics.jung.visualization.decorators包,在下文中一共展示了VertexIconShapeTransformer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initGraph
import edu.uci.ics.jung.visualization.decorators.VertexIconShapeTransformer; //导入依赖的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);
}
}
开发者ID:markkohdev,项目名称:oStorybook,代码行数:33,代码来源:MemoriaPanel.java
示例2: createGraphViewer
import edu.uci.ics.jung.visualization.decorators.VertexIconShapeTransformer; //导入依赖的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());
}
开发者ID:iTransformers,项目名称:netTransformer,代码行数:36,代码来源:MyVisualizationViewer.java
注:本文中的edu.uci.ics.jung.visualization.decorators.VertexIconShapeTransformer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论