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


Java RenderContext.setVertexLabelTransformer方法代码示例

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


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

示例1: init

import edu.uci.ics.jung.visualization.RenderContext; //导入方法依赖的package包/类
private void init() {
    setOpaque(true);
    setBackground(new Color(255, 255, 255, 0));

    final RenderContext<Node, Edge> context = getRenderContext();

    context.setVertexFillPaintTransformer(new VertexFillPaintTransformer());
    context.setVertexShapeTransformer(new VertexShapeTransformer(getFontMetrics(getFont())));
    context.setVertexLabelTransformer(new VertexLabelTransformer());
    getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);

    context.setEdgeLabelTransformer(new EdgeLabelTransformer());
    context.setEdgeShapeTransformer(new EdgeShape.Line<Node, Edge>());
    context.setEdgeLabelClosenessTransformer(new EdgeLabelClosenessTransformer());
    context.getEdgeLabelRenderer().setRotateEdgeLabels(rotateEdges);
    getRenderer().setEdgeLabelRenderer(new EdgeLabelRenderer());
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:18,代码来源:DiagramGenerator.java

示例2: init

import edu.uci.ics.jung.visualization.RenderContext; //导入方法依赖的package包/类
private void init() {
    this.vizPanel = GraphVisualizationPanel.factory(this.graph);
    RenderContext<ConflictVertex, ConflictEdge> rc = this.vizPanel.getRenderContext(); 
    rc.setEdgeDrawPaintTransformer(this.edgeColor);
    rc.setEdgeStrokeTransformer(this.edgeStroke);
    rc.setArrowDrawPaintTransformer(this.edgeColor);
    rc.setArrowFillPaintTransformer(this.edgeColor);
    rc.setVertexFillPaintTransformer(this.vertexColor);
    rc.setVertexDrawPaintTransformer(this.vertexLine);
    rc.setVertexShapeTransformer(this.vertexShape);
    rc.setVertexLabelTransformer(this.vertexLabel);
    rc.setVertexFontTransformer(new GraphVisualizationPanel.VertexFontTransformer<ConflictVertex>(true));
    this.vizPanel.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:15,代码来源:ProcedureConflictGraphNode.java

示例3: applyNodeHighlights

import edu.uci.ics.jung.visualization.RenderContext; //导入方法依赖的package包/类
public static <V extends Node> void applyNodeHighlights(RenderContext<V, Edge<V>> renderContext,
		Collection<V> nodes, HighlightConditionList nodeHighlightConditions, int nodeSize, Integer nodeMaxSize,
		String metaNodeProperty) {
	HighlightResult<V> result = getResult(nodes, nodeHighlightConditions);
	Set<V> metaNodes = nodes.stream().filter(n -> Boolean.TRUE.equals(n.getProperties().get(metaNodeProperty)))
			.collect(Collectors.toCollection(LinkedHashSet::new));

	renderContext.setVertexShapeTransformer(
			JungUtils.newNodeShapeTransformer(nodeSize, nodeMaxSize, result.thicknessValues, result.shapes));
	renderContext.setVertexFillPaintTransformer(JungUtils.newNodeFillTransformer(renderContext, result.colors));
	renderContext.setVertexLabelTransformer(node -> result.labels.get(node));
	renderContext.setVertexStrokeTransformer(JungUtils.newNodeStrokeTransformer(renderContext, metaNodes));
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:14,代码来源:CanvasUtils.java

示例4: JungVisualizationViewer

import edu.uci.ics.jung.visualization.RenderContext; //导入方法依赖的package包/类
public JungVisualizationViewer(GraphMatrixWrapper<N, E> graph, boolean showNodeLabels, boolean showEdgeLabels) {
	super(graph.getGraphMatrix().getGUIObject());
	this.graph = graph;
	this.graphMatrix = graph.getGraphMatrix();
	this.matrixGUIObject = (MatrixGUIObject) graphMatrix.getGUIObject();
	this.showNodeLabels = showNodeLabels;
	this.showEdgeLabels = showEdgeLabels;

	if (graph.getVertexCount() < 1000) {
		layout = new FRLayout<N, EdgeWrapper<E>>(graph);
	} else {
		layout = new ISOMLayout<N, EdgeWrapper<E>>(graph);
	}

	VisualizationModel<N, EdgeWrapper<E>> visualizationModel = new DefaultVisualizationModel<N, EdgeWrapper<E>>(
			layout);
	vv = new VisualizationViewer<N, EdgeWrapper<E>>(visualizationModel);
	vv.setForeground(new Color(0, 0, 0, 150));
	vv.setBackground(Color.WHITE);

	DefaultModalGraphMouse<N, E> graphMouse = new DefaultModalGraphMouse<N, E>();
	vv.setGraphMouse(graphMouse);
	graphMouse.setMode(Mode.PICKING);

	RenderContext<N, EdgeWrapper<E>> rc = vv.getRenderContext();
	emptyNodeLabelTransformer = rc.getVertexLabelTransformer();
	emptyEdgeLabelTransformer = rc.getEdgeLabelTransformer();
	rc.setVertexIconTransformer(new VertexIconTransformer<N>(vv.getPickedVertexState()));
	rc.setVertexFillPaintTransformer(new ColorTransformer<N>(vv.getPickedVertexState()));
	rc.setVertexLabelRenderer(new DefaultVertexLabelRenderer(UIDefaults.SELECTEDCOLOR));
	rc.setEdgeDrawPaintTransformer(new ColorTransformer<EdgeWrapper<E>>(vv.getPickedEdgeState()));
	rc.setEdgeLabelRenderer(new DefaultEdgeLabelRenderer(UIDefaults.SELECTEDCOLOR));
	rc.setArrowFillPaintTransformer(new ColorTransformer<EdgeWrapper<E>>(vv.getPickedEdgeState()));
	rc.setArrowDrawPaintTransformer(new ColorTransformer<EdgeWrapper<E>>(vv.getPickedEdgeState()));

	vv.getRenderer().getVertexLabelRenderer().setPositioner(new InsidePositioner());
	vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.AUTO);

	if (showNodeLabels) {
		rc.setVertexLabelTransformer(new ToStringLabeller<N>());
	}

	if (showEdgeLabels) {
		rc.setEdgeLabelTransformer(new ToStringLabeller<EdgeWrapper<E>>());
	}

	vv.setVertexToolTipTransformer(new ToStringLabeller<N>());

	setLayout(new BorderLayout());
	add(vv, BorderLayout.CENTER);

	vv.addMouseListener(this);
	addComponentListener(this);
	vv.addGraphMouseListener(this);

	if (graph instanceof GraphMatrixWrapper) {
		((MatrixGUIObject) ((GraphMatrixWrapper<N, E>) graph).getGraphMatrix().getGUIObject())
				.addTableModelListener(this);
	}
}
 
开发者ID:ujmp,项目名称:universal-java-matrix-package,代码行数:61,代码来源:JungVisualizationViewer.java

示例5: applyNodeLabels

import edu.uci.ics.jung.visualization.RenderContext; //导入方法依赖的package包/类
public static <V extends Node> void applyNodeLabels(RenderContext<V, Edge<V>> renderContext, Collection<V> nodes,
		HighlightConditionList nodeHighlightConditions) {
	HighlightResult<V> result = getResult(nodes, nodeHighlightConditions);

	renderContext.setVertexLabelTransformer(node -> result.labels.get(node));
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:7,代码来源:CanvasUtils.java


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