@Override public void undo() throws CannotUndoException { super.undo(); upperModel.remove(moved); moved.setParent(lowerModel.getOwner()); lowerModel.add(moved); }
@Override public void redo() throws CannotRedoException { super.redo(); lowerModel.remove(moved); GroupLayer gl = lowerModel.getOwner(); int i = upperModel.list().indexOf(gl); moved.setParent(upperModel.getOwner()); upperModel.add(i, moved); }