*
* @param filter the new filter to use
*/
protected void updateCapabilitiesFilter(Capabilities filter) {
Instances tempInst;
Capabilities filterClass;
if (filter == null) {
m_ClustererEditor.setCapabilitiesFilter(new Capabilities(null));
return;
}
if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
tempInst = new Instances(m_Instances, 0);
else
tempInst = new Instances(m_Instances);
tempInst.setClassIndex(-1);
if (!m_ignoreKeyList.isSelectionEmpty()) {
tempInst = removeIgnoreCols(tempInst);
}
try {
filterClass = Capabilities.forInstances(tempInst);
}
catch (Exception e) {
filterClass = new Capabilities(null);
}
m_ClustererEditor.setCapabilitiesFilter(filterClass);
// check capabilities
m_StartBut.setEnabled(true);
Capabilities currentFilter = m_ClustererEditor.getCapabilitiesFilter();
Clusterer clusterer = (Clusterer) m_ClustererEditor.getValue();
Capabilities currentSchemeCapabilities = null;
if (clusterer != null && currentFilter != null &&
(clusterer instanceof CapabilitiesHandler)) {
currentSchemeCapabilities = ((CapabilitiesHandler)clusterer).getCapabilities();
if (!currentSchemeCapabilities.supportsMaybe(currentFilter) &&
!currentSchemeCapabilities.supports(currentFilter)) {
m_StartBut.setEnabled(false);
}
}
}