/** * */ protected void executeLayout(mxIGraphLayout layout, Object parent) { if (layout != null && parent != null) { layout.execute(parent); } }
/** * */ protected void cellsMoved(Object[] cells, Point location) { if (cells != null && location != null) { mxIGraphModel model = getGraph().getModel(); // Checks if a layout exists to take care of the moving for (int i = 0; i < cells.length; i++) { mxIGraphLayout layout = getLayout(model.getParent(cells[i])); if (layout != null) { layout.moveCell(cells[i], location.x, location.y); } } } }
/** * */ protected void cellsMoved(Object[] cells, Point location) { if (cells != null && location != null) { mxIGraphModel model = getGraph().getModel(); // Checks if a layout exists to take care of the moving for (int i = 0; i < cells.length; i++) { mxIGraphLayout layout = getLayout(model.getParent(cells[i])); if (layout != null) { layout.moveCell(cells[i], location.x, location.y); } } } }
/** * */ protected void executeLayout(mxIGraphLayout layout, Object parent) { if (layout != null && parent != null) { layout.execute(parent); } }
// define layout mxIGraphLayout layout = new mxFastOrganicLayout(graph); // layout graph layout.execute(graph.getDefaultParent());
// define layout mxIGraphLayout layout = new mxFastOrganicLayout(graph); // layout using morphing graph.getModel().beginUpdate(); try { layout.execute(graph.getDefaultParent()); } finally { mxMorphing morph = new mxMorphing(graphComponent, 20, 1.2, 20); morph.addListener(mxEvent.DONE, new mxIEventListener() { @Override public void invoke(Object arg0, mxEventObject arg1) { graph.getModel().endUpdate(); // fitViewport(); } }); morph.startAnimation(); }
layout.execute(graphAdapter.getDefaultParent());
private FileEntry createDockerCompositionSchema(CubeDockerConfiguration cubeDockerConfiguration, ReporterConfiguration reporterConfiguration) { final mxGraph graph = new mxGraph(); final Object parent = graph.getDefaultParent(); graph.setAutoSizeCells(true); graph.getModel().beginUpdate(); try { final DockerCompositions dockerContainersContent = cubeDockerConfiguration.getDockerContainersContent(); final Map<String, CubeContainer> containers = dockerContainersContent.getContainers(); final Map<String, Object> insertedVertex = new HashMap<>(); for (Map.Entry<String, CubeContainer> containerEntry : containers.entrySet()) { String containerId = containerEntry.getKey(); CubeContainer cubeContainer = containerEntry.getValue(); updateGraph(graph, parent, insertedVertex, containerId, cubeContainer); } } finally { graph.getModel().endUpdate(); } mxIGraphLayout layout = new mxHierarchicalLayout(graph, SwingConstants.WEST); layout.execute(graph.getDefaultParent()); return generateCompositionSchemaImage(graph, reporterConfiguration); }
new JGraphXAdapter<>(graph0); mxIGraphLayout layout = new mxCircleLayout(graphAdapter); layout.execute(graphAdapter.getDefaultParent()); dialog.add(new mxGraphComponent(graphAdapter)); dialog.pack();
layout.execute(graph.getDefaultParent());
/** * Refreshes the view for a cell. * * @param cell The cell. */ public void refreshCellView(mxICell cell) { if (layoutmanager != null) { mxIGraphLayout layout = layoutmanager.getLayout(cell); if (layout != null) { layout.execute(cell); } getView().clear(cell, true, false); getView().invalidate(cell); getView().validate(); refresh(); } }