예제 #1
0
 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();
   }
 }
예제 #2
0
  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;
  }
예제 #3
0
 public void clearEdges() {
   graph.clearMarkedEdges();
 }
예제 #4
0
 public void clearSelection() {
   graph.clearSelection();
 }
예제 #5
0
 public void selectEdges(Collection<mxCell> cells, boolean select) {
   graph.markEdges(cells, select);
 }
예제 #6
0
 public void selectConnections(
     Collection<mxCell> cells, boolean select, ICancelIndicator indicator) {
   graph.markConnections(cells, select, indicator);
 }