private void drawLine(int e,Graphics g){
  int p=m_edges[e].m_parent;
  int c=m_edges[e].m_child;
  calcScreenCoords(c);
  calcScreenCoords(p);
  if (m_LineColor == null) {
    g.setColor(Color.black);
  }
 else {
    g.setColor(m_LineColor);
  }
  g.setPaintMode();
  if (m_currentFont.getSize() < 2) {
    g.drawLine(m_nodes[p].m_center,m_nodes[p].m_top + m_nodes[p].m_height,m_nodes[c].m_center,m_nodes[c].m_top);
  }
 else {
    int e_width=m_nodes[c].m_center - m_nodes[p].m_center;
    int e_height=m_nodes[c].m_top - (m_nodes[p].m_top + m_nodes[p].m_height);
    int e_width2=e_width / 2;
    int e_height2=e_height / 2;
    int e_centerx=m_nodes[p].m_center + e_width2;
    int e_centery=m_nodes[p].m_top + m_nodes[p].m_height + e_height2;
    int e_offset=m_edges[e].m_tb;
    int tmp=(int)(((double)e_width / e_height) * (e_height2 - e_offset)) + m_nodes[p].m_center;
    drawText(e_centerx - m_edges[e].m_side,e_centery - e_offset,e,true,g);
    if (tmp > (e_centerx - m_edges[e].m_side) && tmp < (e_centerx + m_edges[e].m_side)) {
      g.drawLine(m_nodes[p].m_center,m_nodes[p].m_top + m_nodes[p].m_height,tmp,e_centery - e_offset);
      g.drawLine(e_centerx * 2 - tmp,e_centery + e_offset,m_nodes[c].m_center,m_nodes[c].m_top);
    }
 else {
      e_offset=m_edges[e].m_side;
      if (e_width < 0) {
        e_offset*=-1;
      }
      tmp=(int)(((double)e_height / e_width) * (e_width2 - e_offset)) + m_nodes[p].m_top + m_nodes[p].m_height;
      g.drawLine(m_nodes[p].m_center,m_nodes[p].m_top + m_nodes[p].m_height,e_centerx - e_offset,tmp);
      g.drawLine(e_centerx + e_offset,e_centery * 2 - tmp,m_nodes[c].m_center,m_nodes[c].m_top);
    }
  }
}

private void drawLine ( int e , Graphics g ) { int p = m_edges [ e ] . m_parent ; int c = m_edges [ e ] . m_child ; calcScreenCoords ( c ) ; calcScreenCoords ( p ) ; if ( m_LineColor == null ) { g . setColor ( Color . black ) ; } else { g . setColor ( m_LineColor ) ; } g . setPaintMode ( ) ; if ( m_currentFont . getSize ( ) < 2 ) { g . drawLine ( m_nodes [ p ] . m_center , m_nodes [ p ] . m_top + m_nodes [ p ] . m_height , m_nodes [ c ] . m_center , m_nodes [ c ] . m_top ) ; } else { int e_width = m_nodes [ c ] . m_center - m_nodes [ p ] . m_center ; int e_height = m_nodes [ c ] . m_top - ( m_nodes [ p ] . m_top + m_nodes [ p ] . m_height ) ; int e_width2 = e_width / 2 ; int e_height2 = e_height / 2 ; int e_centerx = m_nodes [ p ] . m_center + e_width2 ; int e_centery = m_nodes [ p ] . m_top + m_nodes [ p ] . m_height + e_height2 ; int e_offset = m_edges [ e ] . m_tb ; int tmp = ( int ) ( ( ( double ) e_width / e_height ) * ( e_height2 - e_offset ) ) + m_nodes [ p ] . m_center ; drawText ( e_centerx - m_edges [ e ] . m_side , e_centery - e_offset , e , true , g ) ; if ( tmp > ( e_centerx - m_edges [ e ] . m_side ) && tmp < ( e_centerx + m_edges [ e ] . m_side ) ) { g . drawLine ( m_nodes [ p ] . m_center , m_nodes [ p ] . m_top + m_nodes [ p ] . m_height , tmp , e_centery - e_offset ) ; g . drawLine ( e_centerx * 2 - tmp , e_centery + e_offset , m_nodes [ c ] . m_center , m_nodes [ c ] . m_top ) ; } else { e_offset = m_edges [ e ] . m_side ; if ( e_width < 0 ) { e_offset *= - 1 ; } tmp = ( int ) ( ( ( double ) e_height / e_width ) * ( e_width2 - e_offset ) ) + m_nodes [ p ] . m_top + m_nodes [ p ] . m_height ; g . drawLine ( m_nodes [ p ] . m_center , m_nodes [ p ] . m_top + m_nodes [ p ] . m_height , e_centerx - e_offset , tmp ) ; g . drawLine ( e_centerx + e_offset , e_centery * 2 - tmp , m_nodes [ c ] . m_center , m_nodes [ c ] . m_top ) ; } } }
determines the attributes of the edge and draws it .
