public int indexOfSegment(Segment segment){
  return selectedSegments.indexOf(segment);
}

public int indexOfSegment ( Segment segment ) { return selectedSegments . indexOf ( segment ) ; }
get the index of a selected segment .
