/** * Constructs and draws a new mxGraph from a JGraphT graph. Changes on the JGraphT graph will * not edit this mxGraph any further; use the constructor with the ListenableGraph parameter * instead or use this graph as a normal mxGraph. Throws an IllegalArgumentException if the * parameter is null. * * @param graph is a graph */ public JGraphXAdapter(Graph<V, E> graph) { super(); // Don't accept null as jgrapht graph if (graph == null) { throw new IllegalArgumentException(); } else { this.graphT = graph; } // generate the drawing insertJGraphT(graph); setAutoSizeCells(true); }
/** * Constructs and draws a new mxGraph from a JGraphT graph. Changes on the JGraphT graph will * not edit this mxGraph any further; use the constructor with the ListenableGraph parameter * instead or use this graph as a normal mxGraph. Throws an IllegalArgumentException if the * parameter is null. * * @param graph is a graph */ public JGraphXAdapter(Graph<V, E> graph) { super(); // Don't accept null as jgrapht graph if (graph == null) { throw new IllegalArgumentException(); } else { this.graphT = graph; } // generate the drawing insertJGraphT(graph); setAutoSizeCells(true); }