コード例 #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);
 }