protected void paintComponent(Graphics g){
  super.paintComponent(g);
  for (int i=0; i < m_lines.size(); i++) {
    WFLine line=(WFLine)m_lines.get(i);
    line.paint(g);
  }
  if (m_dragged && m_draggedNode != null) {
    Point loc=m_draggedNode.getLocation();
    String text="(" + loc.x + ","+ loc.y+ ")";
    Graphics2D g2D=(Graphics2D)g;
    Font font=new Font("Dialog",Font.PLAIN,10);
    g2D.setColor(Color.magenta);
    TextLayout layout=new TextLayout(text,font,g2D.getFontRenderContext());
    loc.x+=m_draggedNode.getWidth();
    loc.y+=layout.getAscent();
    layout.draw(g2D,loc.x,loc.y);
  }
}

protected void paintComponent ( Graphics g ) { super . paintComponent ( g ) ; for ( int i = 0 ; i < m_lines . size ( ) ; i ++ ) { WFLine line = ( WFLine ) m_lines . get ( i ) ; line . paint ( g ) ; } if ( m_dragged && m_draggedNode != null ) { Point loc = m_draggedNode . getLocation ( ) ; String text = "(" + loc . x + "," + loc . y + ")" ; Graphics2D g2D = ( Graphics2D ) g ; Font font = new Font ( "Dialog" , Font . PLAIN , 10 ) ; g2D . setColor ( Color . magenta ) ; TextLayout layout = new TextLayout ( text , font , g2D . getFontRenderContext ( ) ) ; loc . x += m_draggedNode . getWidth ( ) ; loc . y += layout . getAscent ( ) ; layout . draw ( g2D , loc . x , loc . y ) ; } }
paint component . paint lines directly as not added .
