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