@SuppressWarnings("unchecked") public void mouseReleased(MouseEvent e){
  VisualizationViewer<V,E> vv=(VisualizationViewer<V,E>)e.getSource();
  if (e.getModifiers() == modifiers) {
    if (down != null) {
      Point2D out=e.getPoint();
      if (vertex == null && heyThatsTooClose(down,out,5) == false) {
        pickContainedVertices(vv,down,out,true);
      }
    }
  }
 else   if (e.getModifiers() == this.addToSelectionModifiers) {
    if (down != null) {
      Point2D out=e.getPoint();
      if (vertex == null && heyThatsTooClose(down,out,5) == false) {
        pickContainedVertices(vv,down,out,false);
      }
    }
  }
  down=null;
  vertex=null;
  edge=null;
  rect.setFrame(0,0,0,0);
  vv.removePostRenderPaintable(lensPaintable);
  vv.repaint();
}

@ SuppressWarnings ( "unchecked" ) public void mouseReleased ( MouseEvent e ) { VisualizationViewer < V , E > vv = ( VisualizationViewer < V , E > ) e . getSource ( ) ; if ( e . getModifiers ( ) == modifiers ) { if ( down != null ) { Point2D out = e . getPoint ( ) ; if ( vertex == null && heyThatsTooClose ( down , out , 5 ) == false ) { pickContainedVertices ( vv , down , out , true ) ; } } } else if ( e . getModifiers ( ) == this . addToSelectionModifiers ) { if ( down != null ) { Point2D out = e . getPoint ( ) ; if ( vertex == null && heyThatsTooClose ( down , out , 5 ) == false ) { pickContainedVertices ( vv , down , out , false ) ; } } } down = null ; vertex = null ; edge = null ; rect . setFrame ( 0 , 0 , 0 , 0 ) ; vv . removePostRenderPaintable ( lensPaintable ) ; vv . repaint ( ) ; }
if the mouse is dragging a rectangle , pick the vertices contained in that rectangle clean up settings from mousepressed
