public void cellsAdded(Object[] cells,Object parent,Integer index,Object source,Object target,boolean absolute){
  if (cells != null && parent != null && index != null) {
    model.beginUpdate();
    try {
      mxCellState parentState=(absolute) ? view.getState(parent) : null;
      mxPoint o1=(parentState != null) ? parentState.getOrigin() : null;
      mxPoint zero=new mxPoint(0,0);
      for (int i=0; i < cells.length; i++) {
        Object previous=model.getParent(cells[i]);
        if (o1 != null && cells[i] != parent && parent != previous) {
          mxCellState oldState=view.getState(previous);
          mxPoint o2=(oldState != null) ? oldState.getOrigin() : zero;
          mxGeometry geo=model.getGeometry(cells[i]);
          if (geo != null) {
            double dx=o2.getX() - o1.getX();
            double dy=o2.getY() - o1.getY();
            geo=(mxGeometry)geo.clone();
            geo.translate(dx,dy);
            if (!geo.isRelative() && model.isVertex(cells[i]) && !isAllowNegativeCoordinates()) {
              geo.setX(Math.max(0,geo.getX()));
              geo.setY(Math.max(0,geo.getY()));
            }
            model.setGeometry(cells[i],geo);
          }
        }
        if (parent == previous) {
          index--;
        }
        model.add(parent,cells[i],index + i);
        if (isExtendParentsOnAdd() && isExtendParent(cells[i])) {
          extendParent(cells[i]);
        }
        constrainChild(cells[i]);
        if (source != null) {
          cellConnected(cells[i],source,true);
        }
        if (target != null) {
          cellConnected(cells[i],target,false);
        }
      }
      fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",cells,"parent",parent,"index",index,"source",source,"target",target,"absolute",absolute));
    }
  finally {
      model.endUpdate();
    }
  }
}

public void cellsAdded ( Object [ ] cells , Object parent , Integer index , Object source , Object target , boolean absolute ) { if ( cells != null && parent != null && index != null ) { model . beginUpdate ( ) ; try { mxCellState parentState = ( absolute ) ? view . getState ( parent ) : null ; mxPoint o1 = ( parentState != null ) ? parentState . getOrigin ( ) : null ; mxPoint zero = new mxPoint ( 0 , 0 ) ; for ( int i = 0 ; i < cells . length ; i ++ ) { Object previous = model . getParent ( cells [ i ] ) ; if ( o1 != null && cells [ i ] != parent && parent != previous ) { mxCellState oldState = view . getState ( previous ) ; mxPoint o2 = ( oldState != null ) ? oldState . getOrigin ( ) : zero ; mxGeometry geo = model . getGeometry ( cells [ i ] ) ; if ( geo != null ) { double dx = o2 . getX ( ) - o1 . getX ( ) ; double dy = o2 . getY ( ) - o1 . getY ( ) ; geo = ( mxGeometry ) geo . clone ( ) ; geo . translate ( dx , dy ) ; if ( ! geo . isRelative ( ) && model . isVertex ( cells [ i ] ) && ! isAllowNegativeCoordinates ( ) ) { geo . setX ( Math . max ( 0 , geo . getX ( ) ) ) ; geo . setY ( Math . max ( 0 , geo . getY ( ) ) ) ; } model . setGeometry ( cells [ i ] , geo ) ; } } if ( parent == previous ) { index -- ; } model . add ( parent , cells [ i ] , index + i ) ; if ( isExtendParentsOnAdd ( ) && isExtendParent ( cells [ i ] ) ) { extendParent ( cells [ i ] ) ; } constrainChild ( cells [ i ] ) ; if ( source != null ) { cellConnected ( cells [ i ] , source , true ) ; } if ( target != null ) { cellConnected ( cells [ i ] , target , false ) ; } } fireEvent ( new mxEventObject ( mxEvent . CELLS_ADDED , "cells" , cells , "parent" , parent , "index" , index , "source" , source , "target" , target , "absolute" , absolute ) ) ; } finally { model . endUpdate ( ) ; } } }
adds the specified cells to the given parent . this method fires mxevent . cells_added while the transaction is in progress .
