public boolean selectNode(D nodeData,SignalEvent event){
  if (selectedNodes.isEmpty()) {
    insertAndSelectNode(nodeData,0,true);
    return true;
  }
  if (!hasSameParent(selectedNodes.get(0),nodeData)) {
    if (!this.multilevelSelection || event.getShiftKey()) {
      return selectSingleNode(nodeData);
    }
  }
  if (event == null || event.getCommandKey()) {
    ctrlSelect(nodeData);
    return true;
  }
 else {
    if (event.getShiftKey()) {
      return shiftSelect(nodeData);
    }
  }
  return selectSingleNode(nodeData);
}

public boolean selectNode ( D nodeData , SignalEvent event ) { if ( selectedNodes . isEmpty ( ) ) { insertAndSelectNode ( nodeData , 0 , true ) ; return true ; } if ( ! hasSameParent ( selectedNodes . get ( 0 ) , nodeData ) ) { if ( ! this . multilevelSelection || event . getShiftKey ( ) ) { return selectSingleNode ( nodeData ) ; } } if ( event == null || event . getCommandKey ( ) ) { ctrlSelect ( nodeData ) ; return true ; } else { if ( event . getShiftKey ( ) ) { return shiftSelect ( nodeData ) ; } } return selectSingleNode ( nodeData ) ; }
adds the specified node to the list of selected nodes . the list of selected nodes is guaranteed to be sorted in the same direction that the nodes appear in the tree . we only allow nodes to be in the selected list that are peers in the tree ( we do not allow selects to span multiple depths in the tree . < p / > behavior : if no modifier key is depressed , the list of selected nodes will be set to contain just the node passed to this method . < p / > shift select : if shift is depressed , then we attempt to do a continuous range select . if there exists one or more nodes in the selected nodes list , we test if the node falls within the list . if it does not fall within , we connect the contiguous range of nodes from the specified node to the nearest selected node . if the node falls within the list , we do a continuous range selection to the last node that was selected , not the closest . < p / > ctrl select : if ctrl is depressed then we simply search for the insertion point of the specified node in the already sorted select list . if the node is already present , then we remove it and unselect the node . if it was not present , then we insert the node at the appropriate spot in the array and select it .
