@SuppressWarnings({"rawtypes", "unchecked"}) public static void main(String[] args) throws IOException { JFrame jf = new JFrame(); Network g = getGraph(); LayoutAlgorithm layoutAlgorithm = new FRLayoutAlgorithm(); VisualizationViewer vv = new VisualizationViewer(g, layoutAlgorithm, new Dimension(900, 900)); jf.getContentPane().add(vv); jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); jf.pack(); jf.setVisible(true); }
@SuppressWarnings({ "rawtypes", "unchecked" }) public static void main(String[] args) throws IOException { JFrame jf = new JFrame(); Graph g = getGraph(); VisualizationViewer vv = new VisualizationViewer(new FRLayout(g)); jf.getContentPane().add(vv); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.pack(); jf.setVisible(true); }
@Override public <N, E> void visualize(Graph<N, E> graph, List<VisualizationHelper<N, ? super E>> helpers, boolean modal, Map<String, String> options) { DirectedGraph<NodeVisualization, EdgeVisualization> visGraph = createVisualizationGraph(graph, helpers); Layout<NodeVisualization, EdgeVisualization> layout = new KKLayout<>(visGraph); VisualizationViewer<NodeVisualization, EdgeVisualization> vv = new VisualizationViewer<>(layout); setupRenderContext(vv.getRenderContext()); setupRenderer(vv.getRenderer()); vv.setGraphMouse(mouse); final JDialog frame = new JDialog((Dialog) null, "Visualization", modal); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.getContentPane().add(vv); frame.pack(); frame.setVisible(true); }
@Override public <N, E> void visualize(Graph<N, E> graph, List<VisualizationHelper<N, ? super E>> additionalHelpers, boolean modal, Map<String, String> options) { DirectedGraph<NodeVisualization, EdgeVisualization> visGraph = createVisualizationGraph(graph, additionalHelpers); Layout<NodeVisualization, EdgeVisualization> layout = new KKLayout<>(visGraph); VisualizationViewer<NodeVisualization, EdgeVisualization> vv = new VisualizationViewer<>(layout); setupRenderContext(vv.getRenderContext()); setupRenderer(vv.getRenderer()); vv.setGraphMouse(mouse); final JDialog frame = new JDialog((Dialog) null, "Visualization", modal); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.getContentPane().add(vv); frame.pack(); frame.setVisible(true); }
new PersistentLayoutImpl<String,Number>(new FRLayout<String,Number>(graph)); vv = new VisualizationViewer<String,Number>(persistentLayout);
graph, layout); vv = new VisualizationViewer<String, UnorderedPair<String>>( staticLayout, new Dimension(animationWidth, animationHeight)); vv.getRenderContext().setVertexLabelTransformer(
vv = new VisualizationViewer<Number, Number>(layout, new Dimension(400,400));
vv = new VisualizationViewer<>(graph, layoutAlgorithm, new Dimension(400, 400));
Map<Integer, Icon> iconMap = new HashMap<>(); vv = new VisualizationViewer<>(graph, new FRLayoutAlgorithm<>(), new Dimension(700, 700)); vv.getRenderContext().setNodeLabelFunction(new UnicodeNodeStringer()); vv.getRenderContext().setNodeLabelRenderer(new DefaultNodeLabelRenderer(Color.cyan));
vv = new VisualizationViewer<>(graph, layoutAlgorithm, new Dimension(600, 600)); vv.setBackground(Color.white);
vv = new VisualizationViewer<>(graph, treeLayoutAlgorithm, new Dimension(600, 600)); vv.setBackground(Color.white); vv.getRenderContext().setEdgeShapeFunction(EdgeShape.line());
final VisualizationModel<String, Number> visualizationModel = new BaseVisualizationModel<>(graph, layoutAlgorithm, preferredSize); vv = new VisualizationViewer<>(visualizationModel, preferredSize);
vv = new VisualizationViewer<Number,Number>(layout, new Dimension(600,600));
vv = new VisualizationViewer<>(graph, new FRLayoutAlgorithm<>(), new Dimension(700, 700)); vv.getRenderContext().setNodeLabelFunction(v -> "Node " + v);
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); }
new VisualizationViewer<>(mGraph, layoutAlgorithm, new Dimension(1000, 1000)); vv.setBackground(Color.WHITE);
public DrawnIconVertexDemo(final Deployment dm) { this.dmodel = dm; // create a simple graph for the demo graph = new DirectedSparseGraph<Vertex, Edge>(); vv = new VisualizationViewer<Vertex, Edge>(new SpringLayout2<Vertex, Edge>(graph)); vv.getRenderContext().setVertexLabelRenderer(new DefaultVertexLabelRenderer(Color.cyan)); vv.getRenderContext().setEdgeLabelRenderer(new DefaultEdgeLabelRenderer(Color.cyan)); vv.getRenderContext().setVertexIconTransformer(vertexColor); vv.getRenderContext().setVertexFillPaintTransformer(new PickableVertexPaintTransformer<Vertex>(vv.getPickedVertexState(), Color.white, Color.yellow)); vv.getRenderContext().setEdgeDrawPaintTransformer(edgeColor); vv.setBackground(Color.white); // add my listener for ToolTips vv.setVertexToolTipTransformer(new ToStringLabeller<Vertex>()); }
final VisualizationViewer<String,Number> vv = new VisualizationViewer<String,Number>(layout); vv.setBackground(Color.WHITE);
vv = new VisualizationViewer<N, EdgeWrapper<E>>(visualizationModel); vv.setForeground(new Color(0, 0, 0, 150)); vv.setBackground(Color.WHITE);
vv = new VisualizationViewer<N, EdgeWrapper<E>>(visualizationModel); vv.setForeground(new Color(0, 0, 0, 150)); vv.setBackground(Color.WHITE);