protected void mergeChildrenImpl(mxICell from,mxICell to,boolean cloneAllEdges,Hashtable<Object,Object> mapping) throws CloneNotSupportedException {
  beginUpdate();
  try {
    int childCount=from.getChildCount();
    for (int i=0; i < childCount; i++) {
      Object child=from.getChildAt(i);
      if (child instanceof mxICell) {
        mxICell cell=(mxICell)child;
        String id=cell.getId();
        mxICell target=(mxICell)((id != null && (!isEdge(cell) || !cloneAllEdges)) ? getCell(id) : null);
        if (target == null) {
          mxCell clone=(mxCell)cell.clone();
          clone.setId(id);
          target=(mxICell)to.insert(clone);
          cellAdded(target);
        }
        mapping.put(cell,target);
        mergeChildrenImpl(cell,target,cloneAllEdges,mapping);
      }
    }
  }
  finally {
    endUpdate();
  }
}

protected void mergeChildrenImpl ( mxICell from , mxICell to , boolean cloneAllEdges , Hashtable < Object , Object > mapping ) throws CloneNotSupportedException { beginUpdate ( ) ; try { int childCount = from . getChildCount ( ) ; for ( int i = 0 ; i < childCount ; i ++ ) { Object child = from . getChildAt ( i ) ; if ( child instanceof mxICell ) { mxICell cell = ( mxICell ) child ; String id = cell . getId ( ) ; mxICell target = ( mxICell ) ( ( id != null && ( ! isEdge ( cell ) || ! cloneAllEdges ) ) ? getCell ( id ) : null ) ; if ( target == null ) { mxCell clone = ( mxCell ) cell . clone ( ) ; clone . setId ( id ) ; target = ( mxICell ) to . insert ( clone ) ; cellAdded ( target ) ; } mapping . put ( cell , target ) ; mergeChildrenImpl ( cell , target , cloneAllEdges , mapping ) ; } } } finally { endUpdate ( ) ; } }
clones the children of the source cell into the given target cell in this model and adds an entry to the mapping that maps from the source cell to the target cell with the same id or the clone of the source cell that was inserted into this model .
