mxIGraphModel model = graph.getModel();
Object[] cells = model.cloneCells(aGraph.getChildCells(graph.getDefaultParent(), true, true), true);
mxGraphModel modelCopy = new mxGraphModel();
mxGraph graphCopy = new mxGraph(modelCopy);
Object parentCopy = graphCopy.getDefaultParent();
graphCopy.addCells(cells);
// mxAnalysisGraph aGraphCopy = new mxAnalysisGraph(graphCopy, aGraph.getGenerator(), aGraph.getProperties());
mxAnalysisGraph aGraphCopy = new mxAnalysisGraph();
aGraphCopy.setGraph(graphCopy);
aGraphCopy.setGenerator(aGraph.getGenerator());
aGraphCopy.setProperties(aGraph.getProperties());