private void initModel(DateSelectionModel model, Locale locale) {
if (locale == null) {
locale = JComponent.getDefaultLocale();
}
if (model == null) {
model = new DaySelectionModel(locale);
}
this.model = model;
// PENDING JW: do better to synchronize Calendar related
// properties of flaggedDates to those of the selection model.
// plus: should use the same normalization?
this.flaggedDates = new DaySelectionModel(locale);
flaggedDates.setSelectionMode(SelectionMode.MULTIPLE_INTERVAL_SELECTION);
installCalendar();
model.addDateSelectionListener(getDateSelectionListener());
}