private void selectAllInRubberband(Rubberband rubberband,boolean edgesOnly){
  if (!isAllowNodeEdgeSelection()) {
    return;
  }
  if (!edgesOnly) {
    deselectAll();
  }
  Shape rubberShape=rubberband.getShape();
  Point rubberLoc=rubberband.getLocation();
  Component[] components=getComponents();
  List<DisplayNode> selectedNodes=new ArrayList<>();
  for (  Component comp : components) {
    if (comp instanceof DisplayNode) {
      Rectangle bounds=comp.getBounds();
      bounds.translate(-rubberLoc.x,-rubberLoc.y);
      DisplayNode graphNode=(DisplayNode)comp;
      if (rubberShape.intersects(bounds)) {
        selectedNodes.add(graphNode);
      }
    }
  }
  if (edgesOnly) {
    selectConnectingEdges(selectedNodes);
  }
 else {
    for (    DisplayNode graphNode : selectedNodes) {
      graphNode.setSelected(true);
    }
    selectConnectingEdges();
  }
}

private void selectAllInRubberband ( Rubberband rubberband , boolean edgesOnly ) { if ( ! isAllowNodeEdgeSelection ( ) ) { return ; } if ( ! edgesOnly ) { deselectAll ( ) ; } Shape rubberShape = rubberband . getShape ( ) ; Point rubberLoc = rubberband . getLocation ( ) ; Component [ ] components = getComponents ( ) ; List < DisplayNode > selectedNodes = new ArrayList < > ( ) ; for ( Component comp : components ) { if ( comp instanceof DisplayNode ) { Rectangle bounds = comp . getBounds ( ) ; bounds . translate ( - rubberLoc . x , - rubberLoc . y ) ; DisplayNode graphNode = ( DisplayNode ) comp ; if ( rubberShape . intersects ( bounds ) ) { selectedNodes . add ( graphNode ) ; } } } if ( edgesOnly ) { selectConnectingEdges ( selectedNodes ) ; } else { for ( DisplayNode graphNode : selectedNodes ) { graphNode . setSelected ( true ) ; } selectConnectingEdges ( ) ; } }
selects all of the nodes inside the rubberband and all edges connecting selected nodes .
