/** * Sets and returns the current root and fires an undo event. * * @param root * mxCell that specifies the root of the displayed cell * hierarchy. * @return Returns the object that represents the current root. */ public Object setCurrentRoot(Object root) { if (currentRoot != root) { mxCurrentRootChange change = new mxCurrentRootChange(this, root); change.execute(); mxUndoableEdit edit = new mxUndoableEdit(this, false); edit.add(change); fireEvent(new mxEventObject(mxEvent.UNDO, "edit", edit)); } return root; }
/** * Sets and returns the current root and fires an undo event. * * @param root * mxCell that specifies the root of the displayed cell * hierarchy. * @return Returns the object that represents the current root. */ public Object setCurrentRoot(Object root) { if (currentRoot != root) { mxCurrentRootChange change = new mxCurrentRootChange(this, root); change.execute(); mxUndoableEdit edit = new mxUndoableEdit(this, false); edit.add(change); fireEvent(new mxEventObject(mxEvent.UNDO, "edit", edit)); } return root; }