/** * Constructs a GraphModelEdit. This modifies the order of the cells in * the model. */ public GraphModelLayerEdit(Object[] cells, int layer) { // A copy is made to avoid changes in the original array affect this listener this.cells = new Object[cells.length]; System.arraycopy(cells, 0, this.cells, 0, cells.length); this.layer = layer; next = new int[cells.length]; prev = new int[cells.length]; updateNext(); // Compute array of changed cells (roots or parents of cells) Set par = new HashSet(); for (int i = 0; i < cells.length; i++) { Object cell = DefaultGraphModel.this.getParent(cells[i]); if (cell == null) cell = cells[i]; par.add(cell); } changed = par.toArray(); }
/** * Redoes a change. * * @exception CannotRedoException * if the change cannot be redone */ public void redo() throws CannotRedoException { super.redo(); updateNext(); execute(); }