public mxRectangle validatePoints(mxCellState parentState,Object cell){
  mxCellState state=getState(cell);
  double minX=0;
  double minY=0;
  double maxX=0;
  double maxY=0;
  mxIGraphModel model=graph.getModel();
  boolean isEdge=model.isEdge(cell);
  if (state != null) {
    if (state.isInvalid()) {
      mxGeometry geo=graph.getCellGeometry(cell);
      if (isEdge) {
        Object source=getVisibleTerminal(cell,true);
        if (source != null && !model.isAncestor(source,cell)) {
          Object p=model.getParent(source);
          mxCellState pstate=getState(p);
          validatePoints(pstate,source);
        }
        Object target=getVisibleTerminal(cell,false);
        if (target != null && !model.isAncestor(target,cell)) {
          Object p=model.getParent(target);
          mxCellState pstate=getState(p);
          validatePoints(pstate,target);
        }
        setTerminalPoints(state);
        updatePoints(state,geo.getPoints(),source,target);
        updateTerminalPoints(state,source,target);
        updateEdgeBounds(state);
        state.setAbsoluteOffset(getPoint(state,geo));
      }
 else       if (geo != null && geo.isRelative() && parentState != null && model.isEdge(parentState.getCell())) {
        mxPoint origin=getPoint(parentState,geo);
        if (origin != null) {
          state.setX(origin.getX());
          state.setY(origin.getY());
          origin.setX((origin.getX() / scale) - translate.getX());
          origin.setY((origin.getY() / scale) - translate.getY());
          state.setOrigin(origin);
          childMoved(parentState,state);
        }
      }
      state.setInvalid(false);
    }
    if (isEdge || model.isVertex(cell)) {
      updateLabelBounds(state);
      mxRectangle bb=updateBoundingBox(state);
      minX=bb.getX();
      minY=bb.getY();
      maxX=bb.getX() + bb.getWidth();
      maxY=bb.getY() + bb.getHeight();
    }
  }
  if (state != null && (!graph.isCellCollapsed(cell) || cell == currentRoot)) {
    int childCount=model.getChildCount(cell);
    for (int i=0; i < childCount; i++) {
      Object child=model.getChildAt(cell,i);
      mxRectangle bounds=validatePoints(state,child);
      minX=Math.min(minX,bounds.getX());
      minY=Math.min(minY,bounds.getY());
      maxX=Math.max(maxX,bounds.getX() + bounds.getWidth());
      maxY=Math.max(maxY,bounds.getY() + bounds.getHeight());
    }
  }
  return new mxRectangle(minX,minY,maxX - minX,maxY - minY);
}

public mxRectangle validatePoints ( mxCellState parentState , Object cell ) { mxCellState state = getState ( cell ) ; double minX = 0 ; double minY = 0 ; double maxX = 0 ; double maxY = 0 ; mxIGraphModel model = graph . getModel ( ) ; boolean isEdge = model . isEdge ( cell ) ; if ( state != null ) { if ( state . isInvalid ( ) ) { mxGeometry geo = graph . getCellGeometry ( cell ) ; if ( isEdge ) { Object source = getVisibleTerminal ( cell , true ) ; if ( source != null && ! model . isAncestor ( source , cell ) ) { Object p = model . getParent ( source ) ; mxCellState pstate = getState ( p ) ; validatePoints ( pstate , source ) ; } Object target = getVisibleTerminal ( cell , false ) ; if ( target != null && ! model . isAncestor ( target , cell ) ) { Object p = model . getParent ( target ) ; mxCellState pstate = getState ( p ) ; validatePoints ( pstate , target ) ; } setTerminalPoints ( state ) ; updatePoints ( state , geo . getPoints ( ) , source , target ) ; updateTerminalPoints ( state , source , target ) ; updateEdgeBounds ( state ) ; state . setAbsoluteOffset ( getPoint ( state , geo ) ) ; } else if ( geo != null && geo . isRelative ( ) && parentState != null && model . isEdge ( parentState . getCell ( ) ) ) { mxPoint origin = getPoint ( parentState , geo ) ; if ( origin != null ) { state . setX ( origin . getX ( ) ) ; state . setY ( origin . getY ( ) ) ; origin . setX ( ( origin . getX ( ) / scale ) - translate . getX ( ) ) ; origin . setY ( ( origin . getY ( ) / scale ) - translate . getY ( ) ) ; state . setOrigin ( origin ) ; childMoved ( parentState , state ) ; } } state . setInvalid ( false ) ; } if ( isEdge || model . isVertex ( cell ) ) { updateLabelBounds ( state ) ; mxRectangle bb = updateBoundingBox ( state ) ; minX = bb . getX ( ) ; minY = bb . getY ( ) ; maxX = bb . getX ( ) + bb . getWidth ( ) ; maxY = bb . getY ( ) + bb . getHeight ( ) ; } } if ( state != null && ( ! graph . isCellCollapsed ( cell ) || cell == currentRoot ) ) { int childCount = model . getChildCount ( cell ) ; for ( int i = 0 ; i < childCount ; i ++ ) { Object child = model . getChildAt ( cell , i ) ; mxRectangle bounds = validatePoints ( state , child ) ; minX = Math . min ( minX , bounds . getX ( ) ) ; minY = Math . min ( minY , bounds . getY ( ) ) ; maxX = Math . max ( maxX , bounds . getX ( ) + bounds . getWidth ( ) ) ; maxY = Math . max ( maxY , bounds . getY ( ) + bounds . getHeight ( ) ) ; } } return new mxRectangle ( minX , minY , maxX - minX , maxY - minY ) ; }
validates the points for the state of the given cell recursively if the cell is not collapsed and returns the bounding box of all visited states as a rectangle .
