/** * Updates the size of the given cell in the model using * getPreferredSizeForCell to get the new size. This function * fires beforeUpdateSize and afterUpdateSize events. * * @param cell <mxCell> for which the size should be changed. */ public Object updateCellSize(Object cell) { return updateCellSize(cell, false); }
/** * Updates the size of the given cell in the model using * getPreferredSizeForCell to get the new size. This function * fires beforeUpdateSize and afterUpdateSize events. * * @param cell <mxCell> for which the size should be changed. */ public Object updateCellSize(Object cell) { return updateCellSize(cell, false); }
private void updateGraph(mxGraph graph, Object parent, Map<String, Object> insertedVertex, String containerId, CubeContainer cubeContainer) { if (insertedVertex.containsKey(containerId)) { // container is already added, probably because a direct link from another container // now we need to add direct links of this one that before were transitive Object currentContainer = insertedVertex.get(containerId); createDirectLinks(graph, parent, insertedVertex, cubeContainer, currentContainer); } else { // create new cube and possible direct link (not transitive ones) Object currentContainer = graph.insertVertex(parent, null, containerId, 0, 0, 80, 30); graph.updateCellSize(currentContainer); insertedVertex.put(containerId, currentContainer); createDirectLinks(graph, parent, insertedVertex, cubeContainer, currentContainer); } }
private void createDirectLinks(mxGraph graph, Object parent, Map<String, Object> insertedVertex, CubeContainer cubeContainer, Object currentContainer) { // create relation to all direct links if (cubeContainer.getLinks() != null) { for (Link link : cubeContainer.getLinks()) { final String linkId = link.getName(); Object linkContainer = null; if (insertedVertex.containsKey(linkId)) { linkContainer = insertedVertex.get(linkId); } else { linkContainer = graph.insertVertex(parent, null, linkId, 0, 0, 80, 30); } graph.updateCellSize(currentContainer); graph.insertEdge(parent, null, link.getAlias(), currentContainer, linkContainer); insertedVertex.put(linkId, linkContainer); } } }
graph.setCellStyles(mxConstants.STYLE_FILLCOLOR, "#00FF00", new Object[]{nwName}); graph.updateCellSize(nwName); graph.insertEdge(parent, null, nw, containerName, nwName); insertedVertex.put(nw, nwName);
private static Object insertVertex(mxGraph graph, MTask<?> task) { final Object v = graph.insertVertex(graph.getDefaultParent(), task.getAbbreviation(), formatarNome(task.getName()), 20, 20, 20, 20); graph.updateCellSize(v); if (task.isWait()) { setStyle(v, "TIMER"); } else if (task.isEnd()) { setStyle(v, "END"); } else if (task.isJava()) { if (task.getName().startsWith("Notificar")) { setStyle(v, "MESSAGE"); } else { setStyle(v, "JAVA"); } } return v; }
private static Object insertVertex(mxGraph graph, STask<?> task) { final Object v = graph.insertVertex(graph.getDefaultParent(), task.getAbbreviation(), formatName(task.getName()), 20, 20, 20, 20); graph.updateCellSize(v); if (task.isWait()) { setStyle(v, "TIMER"); } else if (task.isEnd()) { setStyle(v, "END"); } else if (task.isPeople()) { setStyle(v, "HUMAN"); } else if (task.isJava()) { if (task.getName().startsWith("Notificar")) { setStyle(v, "MESSAGE"); } else { setStyle(v, "JAVA"); } } return v; }
private static Object insertVertex(mxGraph graph, STask<?> task) { final Object v = graph.insertVertex(graph.getDefaultParent(), task.getAbbreviation(), formatName(task.getName()), 20, 20, 20, 20); graph.updateCellSize(v); if (task.isWait()) { setStyle(v, "TIMER"); } else if (task.isEnd()) { setStyle(v, "END"); } else if (task.isPeople()) { setStyle(v, "HUMAN"); } else if (task.isJava()) { if (task.getName().startsWith("Notificar")) { setStyle(v, "MESSAGE"); } else { setStyle(v, "JAVA"); } } return v; }
private static Object insertVertex(mxGraph graph, STask<?> task) { final Object v = graph.insertVertex(graph.getDefaultParent(), task.getAbbreviation(), formatName(task.getName()), 20, 20, 20, 20); graph.updateCellSize(v); if (task.isWait()) { setStyle(v, "TIMER"); } else if (task.isEnd()) { setStyle(v, "END"); } else if (task.isPeople()) { setStyle(v, "HUMAN"); } else if (task.isJava()) { if (task.getName().startsWith("Notificar")) { setStyle(v, "MESSAGE"); } else { setStyle(v, "JAVA"); } } return v; }