private int calculatedWeightedValue(mxGraphAbstractHierarchyCell currentCell,Collection<mxGraphAbstractHierarchyCell> collection){
  int totalWeight=0;
  Iterator<mxGraphAbstractHierarchyCell> iter=collection.iterator();
  while (iter.hasNext()) {
    mxGraphAbstractHierarchyCell cell=iter.next();
    if (currentCell.isVertex() && cell.isVertex()) {
      totalWeight++;
    }
 else     if (currentCell.isEdge() && cell.isEdge()) {
      totalWeight+=8;
    }
 else {
      totalWeight+=2;
    }
  }
  return totalWeight;
}

private int calculatedWeightedValue ( mxGraphAbstractHierarchyCell currentCell , Collection < mxGraphAbstractHierarchyCell > collection ) { int totalWeight = 0 ; Iterator < mxGraphAbstractHierarchyCell > iter = collection . iterator ( ) ; while ( iter . hasNext ( ) ) { mxGraphAbstractHierarchyCell cell = iter . next ( ) ; if ( currentCell . isVertex ( ) && cell . isVertex ( ) ) { totalWeight ++ ; } else if ( currentCell . isEdge ( ) && cell . isEdge ( ) ) { totalWeight += 8 ; } else { totalWeight += 2 ; } } return totalWeight ; }
calculates the priority the specified cell has based on the type of its cell and the cells it is connected to on the next layer
