public void updateDuration(){
  if (!Double.isNaN(getXmin()) && !Double.isNaN(getXmax())) {
    setDuration(getXmax() - getXmin());
  }
}

public void updateDuration ( ) { if ( ! Double . isNaN ( getXmin ( ) ) && ! Double . isNaN ( getXmax ( ) ) ) { setDuration ( getXmax ( ) - getXmin ( ) ) ; } }
recalculate and set duration based on current start and end times
