本文整理汇总了Java中edu.uci.ics.jung.visualization.RenderContext.setVertexFontTransformer方法的典型用法代码示例。如果您正苦于以下问题:Java RenderContext.setVertexFontTransformer方法的具体用法?Java RenderContext.setVertexFontTransformer怎么用?Java RenderContext.setVertexFontTransformer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.uci.ics.jung.visualization.RenderContext
的用法示例。
在下文中一共展示了RenderContext.setVertexFontTransformer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyStyles
import edu.uci.ics.jung.visualization.RenderContext; //导入方法依赖的package包/类
public static <V, E> void applyStyles(final VisualizationViewer<V, E> visualizationViewer) {
final RenderContext<V, E> renderContext = visualizationViewer.getRenderContext();
renderContext.setEdgeLabelRenderer(new DefaultEdgeLabelRenderer(WidgetUtils.BG_COLOR_BLUE_MEDIUM, false));
renderContext.setEdgeStrokeTransformer(input -> stroke);
renderContext.setEdgeDrawPaintTransformer(input -> WidgetUtils.BG_COLOR_LESS_BRIGHT);
renderContext.setVertexLabelRenderer(new DefaultVertexLabelRenderer(WidgetUtils.BG_COLOR_BLUE_MEDIUM));
renderContext.setEdgeFontTransformer(GraphUtils.createFontTransformer());
renderContext.setVertexFontTransformer(GraphUtils.createFontTransformer());
final DefaultModalGraphMouse<Object, Integer> graphMouse = new DefaultModalGraphMouse<Object, Integer>() {
@Override
public void mouseWheelMoved(final MouseWheelEvent e) {
// avoid zooming
return;
}
};
graphMouse.setMode(ModalGraphMouse.Mode.PICKING);
graphMouse.setZoomAtMouse(false);
visualizationViewer.setGraphMouse(graphMouse);
}
示例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);
}
示例3: init
import edu.uci.ics.jung.visualization.RenderContext; //导入方法依赖的package包/类
private void init() {
// GraphVisualization
RenderContext<AbstractPlanNode, PlanNodeGraph.Edge> context = this.visualizationPanel.getRenderContext();
context.setEdgeShapeTransformer(new EdgeShape.Line<AbstractPlanNode, PlanNodeGraph.Edge>());
context.setVertexFontTransformer(new GraphVisualizationPanel.VertexFontTransformer<AbstractPlanNode>(true));
// PlanFragmentBoundaries boundaryPainter = new PlanFragmentBoundaries();
// this.visualizationPanel.addPostRenderPaintable(boundaryPainter);
// Full Plan Tab
JPanel textInfoPanel = new JPanel();
textInfoPanel.setLayout(new BorderLayout());
JTextArea textInfoTextArea = new JTextArea();
textInfoTextArea.setEditable(false);
textInfoTextArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
textInfoTextArea.setText(PlanNodeUtil.debug(this.root));
textInfoPanel.add(new JScrollPane(textInfoTextArea), BorderLayout.CENTER);
// Node Field Tab
this.nodeField = new JTextArea();
this.nodeField.setEditable(false);
this.nodeField.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
this.nodeField.setText("");
JPanel textInfoPanel2 = new JPanel(new BorderLayout());
textInfoPanel2.add(new JScrollPane(this.nodeField), BorderLayout.CENTER);
this.tabbedPane = new JTabbedPane();
this.tabbedPane.add("Full Plan", textInfoPanel);
this.tabbedPane.add("Selected Node", textInfoPanel2);
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, visualizationPanel, this.tabbedPane);
splitPane.setDividerLocation(AbstractViewer.DEFAULT_WINDOW_HEIGHT - 500);
this.mainPanel.add(splitPane, BorderLayout.CENTER);
}