public void execute(Object parent) { Map<String, List<Object>> lookup = findParallels(parent); graph.getModel().beginUpdate(); try { Iterator<List<Object>> it = lookup.values().iterator(); while (it.hasNext()) { List<Object> parallels = it.next(); if (parallels.size() > 1) { layout(parallels); } } } finally { graph.getModel().endUpdate(); } }
/** * */ protected Map<String, List<Object>> findParallels(Object parent) { Map<String, List<Object>> lookup = new Hashtable<String, List<Object>>(); mxIGraphModel model = graph.getModel(); int childCount = model.getChildCount(parent); for (int i = 0; i < childCount; i++) { Object child = model.getChildAt(parent, i); if (!isEdgeIgnored(child)) { String id = getEdgeId(child); if (id != null) { if (!lookup.containsKey(id)) { lookup.put(id, new ArrayList<Object>()); } lookup.get(id).add(child); } } } return lookup; }
/** * */ protected void route(Object edge, double x, double y) { if (graph.isCellMovable(edge)) { setEdgePoints(edge, Arrays.asList(new mxPoint[] { new mxPoint(x, y) })); } }
layout.setDisableEdgeStyle(false); layout.execute(parent); final mxParallelEdgeLayout layoutParalelo = new mxParallelEdgeLayout(graph); layoutParalelo.execute(parent); final mxOrthogonalLayout mxOrthogonalLayout = new mxOrthogonalLayout(graph); mxOrthogonalLayout.execute(parent);
layout.setDisableEdgeStyle(false); layout.execute(parent); final mxParallelEdgeLayout layoutParalelo = new mxParallelEdgeLayout(graph); layoutParalelo.execute(parent); final mxOrthogonalLayout mxOrthogonalLayout = new mxOrthogonalLayout(graph); mxOrthogonalLayout.execute(parent);
layout.setDisableEdgeStyle(false); layout.execute(parent); final mxParallelEdgeLayout layoutParalelo = new mxParallelEdgeLayout(graph); layoutParalelo.execute(parent); final mxOrthogonalLayout mxOrthogonalLayout = new mxOrthogonalLayout(graph); mxOrthogonalLayout.execute(parent);
public void execute(Object parent) { Map<String, List<Object>> lookup = findParallels(parent); graph.getModel().beginUpdate(); try { Iterator<List<Object>> it = lookup.values().iterator(); while (it.hasNext()) { List<Object> parallels = it.next(); if (parallels.size() > 1) { layout(parallels); } } } finally { graph.getModel().endUpdate(); } }
/** * */ protected Map<String, List<Object>> findParallels(Object parent) { Map<String, List<Object>> lookup = new Hashtable<String, List<Object>>(); mxIGraphModel model = graph.getModel(); int childCount = model.getChildCount(parent); for (int i = 0; i < childCount; i++) { Object child = model.getChildAt(parent, i); if (!isEdgeIgnored(child)) { String id = getEdgeId(child); if (id != null) { if (!lookup.containsKey(id)) { lookup.put(id, new ArrayList<Object>()); } lookup.get(id).add(child); } } } return lookup; }
/** * */ protected void route(Object edge, double x, double y) { if (graph.isCellMovable(edge)) { setEdgePoints(edge, Arrays.asList(new mxPoint[] { new mxPoint(x, y) })); } }