question: public void select ( Segment segment , boolean addToSelection ) { if ( segment . isNone ( ) ) { return ; } if ( ! addToSelection ) { deselectAllSegments ( ) ; } if ( segment . isUnpaired ( ) ) { if ( addToSelection ) { boolean allSegmentsSelected = true ; for ( Segment other : segments . getPairedSegments ( segment ) ) { if ( ! isSelected ( other ) ) { allSegmentsSelected = false ; break ; } } if ( allSegmentsSelected ) { deselectSegment ( segment ) ; return ; } } if ( isSelected ( segment ) ) { deselectSegment ( segment ) ; } else { selectSegment ( segment ) ; } } else { if ( isSelected ( segment ) ) { deselectSegment ( segment ) ; } else { selectSegment ( segment ) ; } } }
target:  Adds or removes the given segment to the selection. Depending on the clustering and cluster selected and the addToSelection option given, the current selection will be modified. This method is called by clicking on a segment and ring and the CTRL-button status. Adding selections does only work on the same clustering and cluster, else a new selection will be added.