• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VertexIconShapeTransformer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Reducer类代码示例发布时间:2022-05-23
下一篇:
Java Session类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap