if (model.getSelectedClusterer() != null) {
model.setSelectedClusterer(null);
}
} else {
ClustererBuilder selectedBuilder = (ClustererBuilder) algorithmComboBox.getSelectedItem();
Clusterer savedData = getSavedClusterer(selectedBuilder);
if (savedData != null) {
model.setSelectedClusterer(savedData);
} else {
Clusterer newClusterer = selectedBuilder.getClusterer();
model.addClusterer(newClusterer);
model.setSelectedClusterer(newClusterer);
}
}
}