public void selectNodes(mxCell[] cells) { Set<String> lids = new HashSet<String>(); if (cells != null) { for (mxCell cell : cells) { lids.add(cell.getId()); } } if (hasChanges(lids)) { graph.setSelectionCells(cells); graph.refresh(); } }
protected boolean hasChanges(Set<String> cells) { // graphSelections is always not null Object[] graphSelections = graph.getSelectionCells(); if (cells == null) { return graphSelections.length != 0; } if (graphSelections.length != cells.size()) { return true; } for (int i = 0; i < graphSelections.length; i++) { mxCell graphCell = (mxCell) graphSelections[i]; if (!cells.contains(graphCell.getId())) { return true; } } return false; }
public void clearEdges() { graph.clearMarkedEdges(); }
public void clearSelection() { graph.clearSelection(); }
public void selectEdges(Collection<mxCell> cells, boolean select) { graph.markEdges(cells, select); }
public void selectConnections( Collection<mxCell> cells, boolean select, ICancelIndicator indicator) { graph.markConnections(cells, select, indicator); }