cells.add(((mxChildChange) change).getChild());
cells.add(((mxChildChange) change).getChild());
@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; }
@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; }
@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; }