/** * Execute this edit such that the next invocation to this method will * invert the last execution. */ public void execute() { for (int i = 0; i < cells.length; i++) { List list = getParentList(cells[i]); if (list != null) { prev[i] = list.indexOf(cells[i]); if (prev[i] >= 0) { list.remove(prev[i]); int n = next[i]; if (n == FRONT) n = list.size(); else if (n == BACK) n = 0; list.add(n, cells[i]); next[i] = prev[i]; } } } updateListeners(); }