@ SuppressWarnings ( "unchecked" ) public void mouseDragged ( MouseEvent e ) { if ( checkModifiers ( e ) ) { if ( startVertex != null ) { transformEdgeShape ( down , e . getPoint ( ) ) ; transformArrowShape ( down , e . getPoint ( ) ) ; } VisualizationViewer < String , String > vv = ( VisualizationViewer < String , String > ) e . getSource ( ) ; vv . repaint ( ) ; } }
If startVertex is non - null stretch an edge shape between startVertex and the mouse pointer to simulate edge creation