edu.uci.ics.jung.visualization.renderers.Renderer.getNodeLabelRenderer()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中edu.uci.ics.jung.visualization.renderers.Renderer.getNodeLabelRenderer方法的一些代码示例,展示了Renderer.getNodeLabelRenderer的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Renderer.getNodeLabelRenderer方法的具体详情如下:
包路径:edu.uci.ics.jung.visualization.renderers.Renderer
类名称:Renderer
方法名:getNodeLabelRenderer

Renderer.getNodeLabelRenderer介绍

暂无

代码示例

代码示例来源:origin: jrtom/jung

e -> {
 Renderer.NodeLabel.Position position = (Renderer.NodeLabel.Position) e.getItem();
 vv.getRenderer().getNodeLabelRenderer().setPosition(position);
 vv.repaint();
});

代码示例来源:origin: jrtom/jung

vv.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.CNTR);

代码示例来源:origin: jrtom/jung

.getNodeLabelRenderer()
.setPosition(getPosition(System.getProperty(NODE_LABEL_POSITION, "SE")));

代码示例来源:origin: jrtom/jung

/** */
public VisualizationImageServerDemo() {
 // create a simple graph for the demo
 graph = createGraph();
 vv = new VisualizationImageServer<>(graph, new KKLayoutAlgorithm<>(), new Dimension(600, 600));
 vv.getRenderer()
   .setNodeRenderer(
     new GradientNodeRenderer<>(vv, Color.white, Color.red, Color.white, Color.blue, false));
 vv.getRenderContext().setEdgeDrawPaintFunction(e -> Color.lightGray);
 vv.getRenderContext().setArrowFillPaintFunction(e -> Color.lightGray);
 vv.getRenderContext().setArrowDrawPaintFunction(e -> Color.lightGray);
 vv.getRenderContext().setNodeLabelFunction(Object::toString);
 vv.getRenderer()
   .getNodeLabelRenderer()
   .setPositioner(new BasicNodeLabelRenderer.InsidePositioner());
 vv.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.AUTO);
 // create a frome to hold the graph
 final JFrame frame = new JFrame();
 Container content = frame.getContentPane();
 frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
 Image im = vv.getImage(new Point2D.Double(300, 300), new Dimension(600, 600));
 Icon icon = new ImageIcon(im);
 JLabel label = new JLabel(icon);
 content.add(label);
 frame.pack();
 frame.setVisible(true);
}

代码示例来源:origin: jrtom/jung

vv.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.CNTR);

代码示例来源:origin: jrtom/jung

vv.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.CNTR);

代码示例来源:origin: jrtom/jung

.setEdgeDrawPaintFunction(new PickableEdgePaintFunction<>(pes, Color.black, Color.cyan));
vv.setBackground(Color.white);
vv.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.W);
  e -> {
   Renderer.NodeLabel.Position position = (Renderer.NodeLabel.Position) e.getItem();
   vv.getRenderer().getNodeLabelRenderer().setPosition(position);
   vv.repaint();
  });

代码示例来源:origin: jrtom/jung

new PickableNodePaintFunction<>(vv.getPickedNodeState(), Color.red, Color.yellow));
vv.getRenderContext().setNodeLabelFunction(Object::toString);
vv.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.CNTR);

代码示例来源:origin: jrtom/jung

vv.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.CNTR);

代码示例来源:origin: jrtom/jung

vv.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.CNTR);
vv.getRenderContext().setNodeLabelFunction(Object::toString);
vv.setForeground(Color.white);

代码示例来源:origin: jrtom/jung

.getNodeLabelRenderer()
  .setPositioner(new BasicNodeLabelRenderer.InsidePositioner());
vv.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.AUTO);

代码示例来源:origin: jrtom/jung

.setNodeRenderer(new GradientNodeRenderer<>(vv1, Color.red, Color.white, true));
vv1.getRenderContext().setNodeLabelFunction(Object::toString);
vv1.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.CNTR);

代码示例来源:origin: jrtom/jung

.getNodeLabelRenderer()
  .setPositioner(new BasicNodeLabelRenderer.InsidePositioner());
vv.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.AUTO);

代码示例来源:origin: jrtom/jung

.getNodeLabelRenderer()
  .setPositioner(new BasicNodeLabelRenderer.InsidePositioner());
vv.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.AUTO);
vv.setForeground(Color.lightGray);

代码示例来源:origin: jrtom/jung

public SimpleGraphSpatialTest() {
 setLayout(new BorderLayout());
 Network g = TestGraphs.getOneComponentGraph();
 Dimension viewPreferredSize = new Dimension(600, 600);
 Dimension layoutPreferredSize = new Dimension(600, 600);
 LayoutAlgorithm layoutAlgorithm = new FRLayoutAlgorithm();
 ScalingControl scaler = new CrossoverScalingControl();
 VisualizationModel model =
   new BaseVisualizationModel(
     g,
     layoutAlgorithm,
     new RandomLocationTransformer(600, 600, System.currentTimeMillis()),
     layoutPreferredSize);
 VisualizationViewer vv = new VisualizationViewer(model, viewPreferredSize);
 final DefaultModalGraphMouse graphMouse = new DefaultModalGraphMouse();
 vv.setGraphMouse(graphMouse);
 vv.getRenderContext().setNodeLabelFunction(Object::toString);
 vv.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.CNTR);
 vv.addKeyListener(graphMouse.getModeKeyListener());
 vv.setToolTipText("<html><center>Type 'p' for Pick mode<p>Type 't' for Transform mode");
 vv.setForeground(Color.white);
 vv.scaleToLayout(scaler);
 this.add(vv);
}

代码示例来源:origin: jrtom/jung

vv2.setBackground(back);
vv0.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.CNTR);
vv0.setForeground(Color.darkGray);
vv1.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.CNTR);
vv1.setForeground(Color.darkGray);
vv2.getRenderer().getNodeLabelRenderer().setPosition(Renderer.NodeLabel.Position.CNTR);
vv2.setForeground(Color.darkGray);

相关文章