cells.add(((mxChildChange) change).getChild());
Object parent = model.getParent(cc.getChild()); if (cc.getChild() != null) result.add(cc.getChild()); if (cc.getPrevious() != null) result.add(cc.getPrevious());
if (cc.getParent() != cc.getPrevious()) if (model.isVertex(cc.getParent()) || model.isEdge(cc.getParent())) result = getBoundingBox(cc.getParent(), true, true); if (model.isVertex(cc.getPrevious()) || model.isEdge(cc.getPrevious())) result.add(getBoundingBox(cc.getPrevious(), true, true)); result = getBoundingBox(cc.getPrevious(), true, true); result = getBoundingBox(cc.getChild(), true, true); if (cc.getParent() != null) view.clear(cc.getChild(), false, true); removeStateForCell(cc.getChild());
if (cc.getParent() != cc.getPrevious()) if (model.isVertex(cc.getParent()) || model.isEdge(cc.getParent())) result = getBoundingBox(cc.getParent(), true, true); if (model.isVertex(cc.getPrevious()) || model.isEdge(cc.getPrevious())) result.add(getBoundingBox(cc.getPrevious(), true, true)); result = getBoundingBox(cc.getPrevious(), true, true); result = getBoundingBox(cc.getChild(), true, true); if (cc.getParent() != null) view.clear(cc.getChild(), false, true); removeStateForCell(cc.getChild());
cells.add(((mxChildChange) change).getChild());
Object source = getTerminal(cell, true); Object target = getTerminal(cell, false); setTerminal(cell, source, true); setTerminal(cell, target, false); connect(model.getChildAt(cell, i), isConnect);
Object parent = model.getParent(cc.getChild()); if (cc.getChild() != null) result.add(cc.getChild()); if (cc.getPrevious() != null) result.add(cc.getPrevious());
Object source = getTerminal(cell, true); Object target = getTerminal(cell, false); setTerminal(cell, source, true); setTerminal(cell, target, false); connect(model.getChildAt(cell, i), isConnect);
@Override public Node afterEncode(mxCodec enc, Object obj, Node node) { if (obj instanceof mxChildChange) { mxChildChange change = (mxChildChange) obj; Object child = change.getChild(); if (isReference(obj, "child", child, true)) { // Encodes as reference (id) mxCodec.setAttribute(node, "child", enc.getId(child)); } else { // At this point, the encoder is no longer able to know which cells // are new, so we have to encode the complete cell hierarchy and // ignore the ones that are already there at decoding time. Note: // This can only be resolved by moving the notify event into the // execute of the edit. enc.encodeCell((mxICell) child, node, true); } } return node; }
@Override public Node afterEncode(mxCodec enc, Object obj, Node node) { if (obj instanceof mxChildChange) { mxChildChange change = (mxChildChange) obj; Object child = change.getChild(); if (isReference(obj, "child", child, true)) { // Encodes as reference (id) mxCodec.setAttribute(node, "child", enc.getId(child)); } else { // At this point, the encoder is no longer able to know which cells // are new, so we have to encode the complete cell hierarchy and // ignore the ones that are already there at decoding time. Note: // This can only be resolved by moving the notify event into the // execute of the edit. enc.encodeCell((mxICell) child, node, true); } } return node; }
/** * Changes the root of the model. */ public void execute() { Object tmp = model.getParent(child); int tmp2 = getChildIndex(tmp, child); if (previous == null) { connect(child, false); } tmp = ((mxGraphModel) model).parentForCellChanged(child, previous, previousIndex); if (previous != null) { connect(child, true); } parent = previous; previous = tmp; index = previousIndex; previousIndex = tmp2; }
/** * Changes the root of the model. */ public void execute() { Object tmp = model.getParent(child); int tmp2 = getChildIndex(tmp, child); if (previous == null) { connect(child, false); } tmp = ((mxGraphModel) model).parentForCellChanged(child, previous, previousIndex); if (previous != null) { connect(child, true); } parent = previous; previous = tmp; index = previousIndex; previousIndex = tmp2; }
public Object add(Object parent, Object child, int index) { if (child != parent && parent != null && child != null) { boolean parentChanged = parent != getParent(child); execute(new mxChildChange(this, parent, child, index)); // Maintains the edges parents by moving the edges // into the nearest common ancestor of its // terminals if (maintainEdgeParent && parentChanged) { updateEdgeParents(child); } } return child; }
@Override public Object afterDecode(mxCodec dec, Node node, Object obj) { if (obj instanceof mxChildChange) { mxChildChange change = (mxChildChange) obj; // Cells are encoded here after a complete transaction so the previous // parent must be restored on the cell for the case where the cell was // added. This is needed for the local model to identify the cell as a // new cell and register the ID. ((mxICell) change.getChild()).setParent((mxICell) change .getPrevious()); change.setPrevious(change.getParent()); change.setPreviousIndex(change.getIndex()); } return obj; }
public Object add(Object parent, Object child, int index) { if (child != parent && parent != null && child != null) { boolean parentChanged = parent != getParent(child); execute(new mxChildChange(this, parent, child, index)); // Maintains the edges parents by moving the edges // into the nearest common ancestor of its // terminals if (maintainEdgeParent && parentChanged) { updateEdgeParents(child); } } return child; }
@Override public Object afterDecode(mxCodec dec, Node node, Object obj) { if (obj instanceof mxChildChange) { mxChildChange change = (mxChildChange) obj; // Cells are encoded here after a complete transaction so the previous // parent must be restored on the cell for the case where the cell was // added. This is needed for the local model to identify the cell as a // new cell and register the ID. ((mxICell) change.getChild()).setParent((mxICell) change .getPrevious()); change.setPrevious(change.getParent()); change.setPreviousIndex(change.getIndex()); } return obj; }