private void calcAngularBounds(NodeItem r){
  if (m_prevRoot == null || !m_prevRoot.isValid() || r == m_prevRoot) {
    m_prevRoot=r;
    return;
  }
  NodeItem p=m_prevRoot;
  while (true) {
    NodeItem pp=(NodeItem)p.getParent();
    if (pp == r) {
      break;
    }
 else     if (pp == null) {
      m_prevRoot=r;
      return;
    }
    p=pp;
  }
  double dt=0;
  Iterator iter=sortedChildren(r);
  while (iter.hasNext()) {
    Node n=(Node)iter.next();
    if (n == p)     break;
    dt+=((Params)n.get(PARAMS)).width;
  }
  double rw=((Params)r.get(PARAMS)).width;
  double pw=((Params)p.get(PARAMS)).width;
  dt=-MathLib.TWO_PI * (dt + pw / 2) / rw;
  m_theta1=dt + Math.atan2(p.getY() - r.getY(),p.getX() - r.getX());
  m_theta2=m_theta1 + MathLib.TWO_PI;
  m_prevRoot=r;
}

private void calcAngularBounds ( NodeItem r ) { if ( m_prevRoot == null || ! m_prevRoot . isValid ( ) || r == m_prevRoot ) { m_prevRoot = r ; return ; } NodeItem p = m_prevRoot ; while ( true ) { NodeItem pp = ( NodeItem ) p . getParent ( ) ; if ( pp == r ) { break ; } else if ( pp == null ) { m_prevRoot = r ; return ; } p = pp ; } double dt = 0 ; Iterator iter = sortedChildren ( r ) ; while ( iter . hasNext ( ) ) { Node n = ( Node ) iter . next ( ) ; if ( n == p ) break ; dt += ( ( Params ) n . get ( PARAMS ) ) . width ; } double rw = ( ( Params ) r . get ( PARAMS ) ) . width ; double pw = ( ( Params ) p . get ( PARAMS ) ) . width ; dt = - MathLib . TWO_PI * ( dt + pw / 2 ) / rw ; m_theta1 = dt + Math . atan2 ( p . getY ( ) - r . getY ( ) , p . getX ( ) - r . getX ( ) ) ; m_theta2 = m_theta1 + MathLib . TWO_PI ; m_prevRoot = r ; }
calculates the angular bounds of the layout , attempting to preserve the angular orientation of the display across transitions .
