@Override public void drawNode(Graphics g,int w,int h){
  if ((m_type & PURE_INPUT) == PURE_INPUT) {
    g.setColor(Color.green);
  }
 else {
    g.setColor(Color.orange);
  }
  FontMetrics fm=g.getFontMetrics();
  int l=(int)(m_x * w) - fm.stringWidth(m_id) / 2;
  int t=(int)(m_y * h) - fm.getHeight() / 2;
  g.fill3DRect(l,t,fm.stringWidth(m_id) + 4,fm.getHeight() + fm.getDescent() + 4,true);
  g.setColor(Color.black);
  g.drawString(m_id,l + 2,t + fm.getHeight() + 2);
}

@ Override public void drawNode ( Graphics g , int w , int h ) { if ( ( m_type & PURE_INPUT ) == PURE_INPUT ) { g . setColor ( Color . green ) ; } else { g . setColor ( Color . orange ) ; } FontMetrics fm = g . getFontMetrics ( ) ; int l = ( int ) ( m_x * w ) - fm . stringWidth ( m_id ) / 2 ; int t = ( int ) ( m_y * h ) - fm . getHeight ( ) / 2 ; g . fill3DRect ( l , t , fm . stringWidth ( m_id ) + 4 , fm . getHeight ( ) + fm . getDescent ( ) + 4 , true ) ; g . setColor ( Color . black ) ; g . drawString ( m_id , l + 2 , t + fm . getHeight ( ) + 2 ) ; }
this will draw the node id to the graphics context .
