当前位置: 首页>>代码示例>>Java>>正文


Java RenderContext.setEdgeFillPaintTransformer方法代码示例

本文整理汇总了Java中edu.uci.ics.jung.visualization.RenderContext.setEdgeFillPaintTransformer方法的典型用法代码示例。如果您正苦于以下问题:Java RenderContext.setEdgeFillPaintTransformer方法的具体用法?Java RenderContext.setEdgeFillPaintTransformer怎么用?Java RenderContext.setEdgeFillPaintTransformer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.uci.ics.jung.visualization.RenderContext的用法示例。


在下文中一共展示了RenderContext.setEdgeFillPaintTransformer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MapperEngine

import edu.uci.ics.jung.visualization.RenderContext; //导入方法依赖的package包/类
public MapperEngine() {
    graph = new SparseMultigraph<Room, Exit>();
    mapperLayout = new MapperLayout( graph );
    mapperLayout.setSize( new Dimension( 500, 500 ) ); //????
    vv = new VisualizationViewer<Room, Exit>( mapperLayout );
    pickedState = vv.getPickedVertexState();
    pickedState.addItemListener( this );
    vv.setPreferredSize( new Dimension( 500, 500 ) ); //????
    RenderContext<Room, Exit> rc = vv.getRenderContext();

    rc.setEdgeLabelTransformer( new ToStringLabeller<Exit>() );
    rc.setEdgeLabelRenderer( new ExitLabelRenderer() );
    rc.setEdgeShapeTransformer( new EdgeShape.QuadCurve<Room, Exit>() );
    rc.setEdgeShapeTransformer( new EdgeShape.Wedge<Room, Exit>( 30 ) );
    rc.setEdgeFillPaintTransformer( new ExitPaintTransformer( vv ) );

    rc.setVertexShapeTransformer( new RoomShape( graph ) );
    rc.setVertexIconTransformer( new RoomIconTransformer() );

    vv.getRenderContext().setLabelOffset( 5 );

    PluggableGraphMouse pgm = new PluggableGraphMouse();
    pgm.add( new MapperPickingGraphMousePlugin<Room, Exit>( MouseEvent.BUTTON1_MASK, MouseEvent.BUTTON3_MASK ) );
    pgm.add( new TranslatingGraphMousePlugin( MouseEvent.BUTTON1_MASK ) );
    scaler = new ScalingGraphMousePlugin( new CrossoverScalingControl(), 0, 1 / 1.1f, 1.1f );
    pgm.add( scaler );
    mousePlugin = new MapperEditingGraphMousePlugin( this );
    pgm.add( mousePlugin );
    vv.setGraphMouse( pgm );
    panel = new MapperPanel( this );
}
 
开发者ID:lauriholmas,项目名称:batmapper,代码行数:32,代码来源:MapperEngine.java

示例2: applyEdgeHighlights

import edu.uci.ics.jung.visualization.RenderContext; //导入方法依赖的package包/类
public static <V extends Node> void applyEdgeHighlights(RenderContext<V, Edge<V>> renderContext,
		Collection<Edge<V>> edges, HighlightConditionList edgeHighlightConditions, int edgeThickness,
		Integer edgeMaxThickness) {
	HighlightResult<Edge<V>> result = getResult(edges, edgeHighlightConditions);
	Pair<Transformer<Edge<V>, Stroke>, Transformer<Context<Graph<V, Edge<V>>, Edge<V>>, Shape>> strokeAndArrowTransformers = JungUtils
			.newEdgeStrokeArrowTransformers(edgeThickness, edgeMaxThickness, result.thicknessValues);

	renderContext.setEdgeFillPaintTransformer(JungUtils.newEdgeFillTransformer(renderContext, result.colors));
	renderContext.setEdgeStrokeTransformer(strokeAndArrowTransformers.getFirst());
	renderContext.setEdgeArrowTransformer(strokeAndArrowTransformers.getSecond());
	renderContext.setEdgeLabelTransformer(edge -> result.labels.get(edge));
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:13,代码来源:CanvasUtils.java


注:本文中的edu.uci.ics.jung.visualization.RenderContext.setEdgeFillPaintTransformer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。