Java 类weka.core.CapabilitiesHandler 实例源码

项目:repo.kmeanspp.silhouette_score    文件:GenericObjectEditor.java   
/**
 * generates if necessary a Capabilities object for the given leaf.
 */
protected void initCapabilities() {
  String classname;
  Class<?> cls;
  Object obj;

  if (m_Capabilities != null) {
    return;
  }
  if (!isLeaf()) {
    return;
  }

  classname = getClassnameFromPath(new TreePath(getPath()));
  try {
    cls = Class.forName(classname);
    if (!ClassDiscovery.hasInterface(CapabilitiesHandler.class, cls)) {
      return;
    }

    obj = cls.newInstance();
    m_Capabilities = ((CapabilitiesHandler) obj).getCapabilities();
  } catch (Exception e) {
    // ignore it
  }
}
项目:autoweka    文件:GenericObjectEditor.java   
/**
    * generates if necessary a Capabilities object for the given leaf.
    */
   protected void initCapabilities() {
     String     classname;
     Class  cls;
     Object obj;

     if (m_Capabilities != null)
return;
     if (!isLeaf())
return;

     classname = getClassnameFromPath(new TreePath(getPath()));
     try {
cls = Class.forName(classname);
if (!ClassDiscovery.hasInterface(CapabilitiesHandler.class, cls))
  return;

obj = cls.newInstance();
m_Capabilities = ((CapabilitiesHandler) obj).getCapabilities();
     }
     catch (Exception e) {
// ignore it
     }
   }
项目:autoweka    文件:PropertySheetPanel.java   
/**
 * updates the content of the capabilities help dialog.
 */
protected void updateText() {
  StringBuffer helpText = new StringBuffer();

  if (m_Target instanceof CapabilitiesHandler)
    helpText.append(
 addCapabilities(
     "CAPABILITIES", 
     ((CapabilitiesHandler) m_Target).getCapabilities()));

  if (m_Target instanceof MultiInstanceCapabilitiesHandler)
    helpText.append(
 addCapabilities(
     "MI CAPABILITIES", 
     ((MultiInstanceCapabilitiesHandler) m_Target).getMultiInstanceCapabilities()));

  m_CapabilitiesText.setText(helpText.toString());
  m_CapabilitiesText.setCaretPosition(0);
}
项目:umple    文件:GenericObjectEditor.java   
/**
 * generates if necessary a Capabilities object for the given leaf.
 */
protected void initCapabilities() {
  String classname;
  Class<?> cls;
  Object obj;

  if (m_Capabilities != null) {
    return;
  }
  if (!isLeaf()) {
    return;
  }

  classname = getClassnameFromPath(new TreePath(getPath()));
  try {
    cls = Class.forName(classname);
    if (!ClassDiscovery.hasInterface(CapabilitiesHandler.class, cls)) {
      return;
    }

    obj = cls.newInstance();
    m_Capabilities = ((CapabilitiesHandler) obj).getCapabilities();
  } catch (Exception e) {
    // ignore it
  }
}
项目:umple    文件:PropertySheetPanel.java   
/**
 * updates the content of the capabilities help dialog.
 */
protected void updateText() {
  StringBuffer helpText = new StringBuffer();

  if (m_Target instanceof CapabilitiesHandler) {
    helpText.append(addCapabilities("CAPABILITIES",
      ((CapabilitiesHandler) m_Target).getCapabilities()));
  }

  if (m_Target instanceof MultiInstanceCapabilitiesHandler) {
    helpText.append(addCapabilities("MI CAPABILITIES",
      ((MultiInstanceCapabilitiesHandler) m_Target)
        .getMultiInstanceCapabilities()));
  }

  m_CapabilitiesText.setText(helpText.toString());
  m_CapabilitiesText.setCaretPosition(0);
}
项目:jbossBA    文件:GenericObjectEditor.java   
/**
 * generates if necessary a Capabilities object for the given leaf.
 */
protected void initCapabilities() {
  String classname;
  Class cls;
  Object obj;

  if (m_Capabilities != null) {
    return;
  }
  if (!isLeaf()) {
    return;
  }

  classname = getClassnameFromPath(new TreePath(getPath()));
  try {
    cls = Class.forName(classname);
    if (!ClassDiscovery.hasInterface(CapabilitiesHandler.class, cls)) {
      return;
    }

    obj = cls.newInstance();
    m_Capabilities = ((CapabilitiesHandler) obj).getCapabilities();
  } catch (Exception e) {
    // ignore it
  }
}
项目:jbossBA    文件:PropertySheetPanel.java   
/**
 * updates the content of the capabilities help dialog.
 */
protected void updateText() {
  StringBuffer helpText = new StringBuffer();

  if (m_Target instanceof CapabilitiesHandler) {
    helpText.append(addCapabilities("CAPABILITIES",
      ((CapabilitiesHandler) m_Target).getCapabilities()));
  }

  if (m_Target instanceof MultiInstanceCapabilitiesHandler) {
    helpText.append(addCapabilities("MI CAPABILITIES",
      ((MultiInstanceCapabilitiesHandler) m_Target)
        .getMultiInstanceCapabilities()));
  }

  m_CapabilitiesText.setText(helpText.toString());
  m_CapabilitiesText.setCaretPosition(0);
}
项目:autoweka    文件:AssociationsPanel.java   
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances tempInst;
  Capabilities filterClass;

  if (filter == null) {
    m_AssociatorEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
    tempInst = new Instances(m_Instances, 0);
  else
    tempInst = new Instances(m_Instances);
  tempInst.setClassIndex(-1);

  try {
    filterClass = Capabilities.forInstances(tempInst);
  } catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  m_AssociatorEditor.setCapabilitiesFilter(filterClass);

  m_StartBut.setEnabled(true);
  // Check capabilities
  Capabilities currentFilter = m_AssociatorEditor.getCapabilitiesFilter();
  Associator associator = (Associator) m_AssociatorEditor.getValue();
  Capabilities currentSchemeCapabilities = null;
  if (associator != null && currentFilter != null
      && (associator instanceof CapabilitiesHandler)) {
    currentSchemeCapabilities = ((CapabilitiesHandler) associator)
        .getCapabilities();

    if (!currentSchemeCapabilities.supportsMaybe(currentFilter)
        && !currentSchemeCapabilities.supports(currentFilter)) {
      m_StartBut.setEnabled(false);
    }
  }
}
项目:jbossBA    文件:AssociationsPanel.java   
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter    the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances           tempInst;
  Capabilities        filterClass;

  if (filter == null) {
    m_AssociatorEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
    tempInst = new Instances(m_Instances, 0);
  else
    tempInst = new Instances(m_Instances);
  tempInst.setClassIndex(-1);

  try {
    filterClass = Capabilities.forInstances(tempInst);
  }
  catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  m_AssociatorEditor.setCapabilitiesFilter(filterClass);

  m_StartBut.setEnabled(true);
  // Check capabilities
  Capabilities currentFilter = m_AssociatorEditor.getCapabilitiesFilter();
  Associator associator = (Associator) m_AssociatorEditor.getValue();
  Capabilities currentSchemeCapabilities =  null;
  if (associator != null && currentFilter != null && 
      (associator instanceof CapabilitiesHandler)) {
    currentSchemeCapabilities = ((CapabilitiesHandler)associator).getCapabilities();

    if (!currentSchemeCapabilities.supportsMaybe(currentFilter) &&
        !currentSchemeCapabilities.supports(currentFilter)) {
      m_StartBut.setEnabled(false);
    }
  }
}
项目:autoweka    文件:ClustererPanel.java   
/**
 * updates the capabilities filter of the GOE
 * 
 * @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);
    }
  }
}
项目:autoweka    文件:ClassifierPanel.java   
/**
 * updates the capabilities filter of the GOE.
 * 
 * @param filter the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances tempInst;
  Capabilities filterClass;

  if (filter == null) {
    m_ClassifierEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
    tempInst = new Instances(m_Instances, 0);
  else
    tempInst = new Instances(m_Instances);
  tempInst.setClassIndex(m_ClassCombo.getSelectedIndex());

  try {
    filterClass = Capabilities.forInstances(tempInst);
  } catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  // set new filter
  m_ClassifierEditor.setCapabilitiesFilter(filterClass);

  // Check capabilities
  m_StartBut.setEnabled(true);
  Capabilities currentFilter = m_ClassifierEditor.getCapabilitiesFilter();
  Classifier classifier = (Classifier) m_ClassifierEditor.getValue();
  Capabilities currentSchemeCapabilities = null;
  if (classifier != null && currentFilter != null
      && (classifier instanceof CapabilitiesHandler)) {
    currentSchemeCapabilities = ((CapabilitiesHandler) classifier)
        .getCapabilities();

    if (!currentSchemeCapabilities.supportsMaybe(currentFilter)
        && !currentSchemeCapabilities.supports(currentFilter)) {
      m_StartBut.setEnabled(false);
    }
  }
}
项目:autoweka    文件:AttributeSelectionPanel.java   
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances tempInst;
  Capabilities filterClass;

  if (filter == null) {
    m_AttributeEvaluatorEditor.setCapabilitiesFilter(new Capabilities(null));
    m_AttributeSearchEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
    tempInst = new Instances(m_Instances, 0);
  else
    tempInst = new Instances(m_Instances);
  int clIndex = m_ClassCombo.getSelectedIndex() - 1;

  if (clIndex >= 0) {
    tempInst.setClassIndex(clIndex);
  }

  try {
    filterClass = Capabilities.forInstances(tempInst);
  } catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  // set new filter
  m_AttributeEvaluatorEditor.setCapabilitiesFilter(filterClass);
  m_AttributeSearchEditor.setCapabilitiesFilter(filterClass);

  m_StartBut.setEnabled(true);
  // check capabilities...
  Capabilities currentFilter = m_AttributeEvaluatorEditor
      .getCapabilitiesFilter();
  ASEvaluation evaluator = (ASEvaluation) m_AttributeEvaluatorEditor
      .getValue();
  Capabilities currentSchemeCapabilities = null;
  if (evaluator != null && currentFilter != null
      && (evaluator instanceof CapabilitiesHandler)) {
    currentSchemeCapabilities = ((CapabilitiesHandler) evaluator)
        .getCapabilities();

    if (!currentSchemeCapabilities.supportsMaybe(currentFilter)
        && !currentSchemeCapabilities.supports(currentFilter)) {
      m_StartBut.setEnabled(false);
    }
  }
}
项目:autoweka    文件:PreprocessPanel.java   
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter    the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances         tempInst;
  Capabilities  filterClass;

  if (filter == null) {
    m_FilterEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
    tempInst = new Instances(m_Instances, 0);
  else
    tempInst = new Instances(m_Instances);
  tempInst.setClassIndex(m_AttVisualizePanel.getColorBox().getSelectedIndex() - 1);

  try {
    filterClass = Capabilities.forInstances(tempInst);
  }
  catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  // set new filter
  m_FilterEditor.setCapabilitiesFilter(filterClass);

  // check capabilities
  m_ApplyFilterBut.setEnabled(true);
  Capabilities currentCapabilitiesFilter = m_FilterEditor.getCapabilitiesFilter();
  Filter currentFilter = (Filter) m_FilterEditor.getValue();
  Capabilities currentFilterCapabilities = null;
  if (currentFilter != null && currentCapabilitiesFilter != null &&
      (currentFilter instanceof CapabilitiesHandler)) {
    currentFilterCapabilities = ((CapabilitiesHandler)currentFilter).getCapabilities();

    if (!currentFilterCapabilities.supportsMaybe(currentCapabilitiesFilter) &&
        !currentFilterCapabilities.supports(currentCapabilitiesFilter)) {
      try {
        currentFilter.setInputFormat(getInstances());
      } catch (Exception ex) {
        m_ApplyFilterBut.setEnabled(false);
      }
    }
  }
}
项目:umple    文件:ClassifierPanel.java   
/**
 * updates the capabilities filter of the GOE.
 * 
 * @param filter the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances tempInst;
  Capabilities filterClass;

  if (filter == null) {
    m_ClassifierEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter()) {
    tempInst = new Instances(m_Instances, 0);
  } else {
    tempInst = new Instances(m_Instances);
  }
  tempInst.setClassIndex(m_ClassCombo.getSelectedIndex());

  try {
    filterClass = Capabilities.forInstances(tempInst);
  } catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  // set new filter
  m_ClassifierEditor.setCapabilitiesFilter(filterClass);

  // Check capabilities
  m_StartBut.setEnabled(true);
  Capabilities currentFilter = m_ClassifierEditor.getCapabilitiesFilter();
  Classifier classifier = (Classifier) m_ClassifierEditor.getValue();
  Capabilities currentSchemeCapabilities = null;
  if (classifier != null && currentFilter != null
    && (classifier instanceof CapabilitiesHandler)) {
    currentSchemeCapabilities = ((CapabilitiesHandler) classifier)
      .getCapabilities();

    if (!currentSchemeCapabilities.supportsMaybe(currentFilter)
      && !currentSchemeCapabilities.supports(currentFilter)) {
      m_StartBut.setEnabled(false);
    }
  }
}
项目:umple    文件:AttributeSelectionPanel.java   
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances tempInst;
  Capabilities filterClass;

  if (filter == null) {
    m_AttributeEvaluatorEditor.setCapabilitiesFilter(new Capabilities(null));
    m_AttributeSearchEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter()) {
    tempInst = new Instances(m_Instances, 0);
  } else {
    tempInst = new Instances(m_Instances);
  }
  int clIndex = m_ClassCombo.getSelectedIndex() - 1;

  if (clIndex >= 0) {
    tempInst.setClassIndex(clIndex);
  }

  try {
    filterClass = Capabilities.forInstances(tempInst);
  } catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  // set new filter
  m_AttributeEvaluatorEditor.setCapabilitiesFilter(filterClass);
  m_AttributeSearchEditor.setCapabilitiesFilter(filterClass);

  m_StartBut.setEnabled(true);
  // check capabilities...
  Capabilities currentFilter = m_AttributeEvaluatorEditor
    .getCapabilitiesFilter();
  ASEvaluation evaluator = (ASEvaluation) m_AttributeEvaluatorEditor
    .getValue();
  Capabilities currentSchemeCapabilities = null;
  if (evaluator != null && currentFilter != null
    && (evaluator instanceof CapabilitiesHandler)) {
    currentSchemeCapabilities = ((CapabilitiesHandler) evaluator)
      .getCapabilities();

    if (!currentSchemeCapabilities.supportsMaybe(currentFilter)
      && !currentSchemeCapabilities.supports(currentFilter)) {
      m_StartBut.setEnabled(false);
    }
  }
}
项目:umple    文件:PreprocessPanel.java   
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter    the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances         tempInst;
  Capabilities  filterClass;

  if (filter == null) {
    m_FilterEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
    tempInst = new Instances(m_Instances, 0);
  else
    tempInst = new Instances(m_Instances);
  tempInst.setClassIndex(m_AttVisualizePanel.getColorBox().getSelectedIndex() - 1);

  try {
    filterClass = Capabilities.forInstances(tempInst);
  }
  catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  // set new filter
  m_FilterEditor.setCapabilitiesFilter(filterClass);

  // check capabilities
  m_ApplyFilterBut.setEnabled(true);
  Capabilities currentCapabilitiesFilter = m_FilterEditor.getCapabilitiesFilter();
  Filter currentFilter = (Filter) m_FilterEditor.getValue();
  Capabilities currentFilterCapabilities = null;
  if (currentFilter != null && currentCapabilitiesFilter != null &&
      (currentFilter instanceof CapabilitiesHandler)) {
    currentFilterCapabilities = ((CapabilitiesHandler)currentFilter).getCapabilities();

    if (!currentFilterCapabilities.supportsMaybe(currentCapabilitiesFilter) &&
        !currentFilterCapabilities.supports(currentCapabilitiesFilter)) {
      try {
        currentFilter.setInputFormat(getInstances());
      } catch (Exception ex) {
        m_ApplyFilterBut.setEnabled(false);
      }
    }
  }
}
项目:umple    文件:AssociationsPanel.java   
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances tempInst;
  Capabilities filterClass;

  if (filter == null) {
    m_AssociatorEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter()) {
    tempInst = new Instances(m_Instances, 0);
  } else {
    tempInst = new Instances(m_Instances);
  }
  tempInst.setClassIndex(-1);

  try {
    filterClass = Capabilities.forInstances(tempInst);
  } catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  m_AssociatorEditor.setCapabilitiesFilter(filterClass);

  m_StartBut.setEnabled(true);
  // Check capabilities
  Capabilities currentFilter = m_AssociatorEditor.getCapabilitiesFilter();
  Associator associator = (Associator) m_AssociatorEditor.getValue();
  Capabilities currentSchemeCapabilities = null;
  if (associator != null && currentFilter != null
    && (associator instanceof CapabilitiesHandler)) {
    currentSchemeCapabilities = ((CapabilitiesHandler) associator)
      .getCapabilities();

    if (!currentSchemeCapabilities.supportsMaybe(currentFilter)
      && !currentSchemeCapabilities.supports(currentFilter)) {
      m_StartBut.setEnabled(false);
    }
  }
}
项目:jbossBA    文件:ClassifierPanel.java   
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances tempInst;
  Capabilities filterClass;

  if (filter == null) {
    m_ClassifierEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter()) {
    tempInst = new Instances(m_Instances, 0);
  } else {
    tempInst = new Instances(m_Instances);
  }
  tempInst.setClassIndex(m_ClassCombo.getSelectedIndex());

  try {
    filterClass = Capabilities.forInstances(tempInst);
  } catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  // set new filter
  m_ClassifierEditor.setCapabilitiesFilter(filterClass);

  m_StartBut.setEnabled(true);
  // Check capabilities
  Capabilities currentFilter = m_ClassifierEditor.getCapabilitiesFilter();
  Classifier classifier = (Classifier) m_ClassifierEditor.getValue();
  Capabilities currentSchemeCapabilities = null;
  if (classifier != null && currentFilter != null
    && (classifier instanceof CapabilitiesHandler)) {
    currentSchemeCapabilities = ((CapabilitiesHandler) classifier)
      .getCapabilities();

    if (!currentSchemeCapabilities.supportsMaybe(currentFilter)
      && !currentSchemeCapabilities.supports(currentFilter)) {
      m_StartBut.setEnabled(false);
    }
  }
}
项目:jbossBA    文件:AttributeSelectionPanel.java   
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter    the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances         tempInst;
  Capabilities  filterClass;

  if (filter == null) {
    m_AttributeEvaluatorEditor.setCapabilitiesFilter(new Capabilities(null));
    m_AttributeSearchEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
    tempInst = new Instances(m_Instances, 0);
  else
    tempInst = new Instances(m_Instances);
  int clIndex = m_ClassCombo.getSelectedIndex() - 1;

  if (clIndex >= 0) {
    tempInst.setClassIndex(clIndex);
  }        

  try {
    filterClass = Capabilities.forInstances(tempInst);
  }
  catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  // set new filter
  m_AttributeEvaluatorEditor.setCapabilitiesFilter(filterClass);
  m_AttributeSearchEditor.setCapabilitiesFilter(filterClass);

  m_StartBut.setEnabled(true);
  // check capabilities...
  Capabilities currentFilter = m_AttributeEvaluatorEditor.getCapabilitiesFilter();
  ASEvaluation evaluator = (ASEvaluation) m_AttributeEvaluatorEditor.getValue();
  Capabilities currentSchemeCapabilities =  null;
  if (evaluator != null && currentFilter != null && 
      (evaluator instanceof CapabilitiesHandler)) {
    currentSchemeCapabilities = ((CapabilitiesHandler)evaluator).getCapabilities();

    if (!currentSchemeCapabilities.supportsMaybe(currentFilter) &&
        !currentSchemeCapabilities.supports(currentFilter)) {
      m_StartBut.setEnabled(false);
    }
  }
}
项目:jbossBA    文件:PreprocessPanel.java   
/**
 * updates the capabilities filter of the GOE
 * 
 * @param filter    the new filter to use
 */
protected void updateCapabilitiesFilter(Capabilities filter) {
  Instances         tempInst;
  Capabilities  filterClass;

  if (filter == null) {
    m_FilterEditor.setCapabilitiesFilter(new Capabilities(null));
    return;
  }

  if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
    tempInst = new Instances(m_Instances, 0);
  else
    tempInst = new Instances(m_Instances);
  tempInst.setClassIndex(m_AttVisualizePanel.getColorBox().getSelectedIndex() - 1);

  try {
    filterClass = Capabilities.forInstances(tempInst);
  }
  catch (Exception e) {
    filterClass = new Capabilities(null);
  }

  // set new filter
  m_FilterEditor.setCapabilitiesFilter(filterClass);

  // check capabilities
  m_ApplyFilterBut.setEnabled(true);
  Capabilities currentCapabilitiesFilter = m_FilterEditor.getCapabilitiesFilter();
  Filter currentFilter = (Filter) m_FilterEditor.getValue();
  Capabilities currentFilterCapabilities = null;
  if (currentFilter != null && currentCapabilitiesFilter != null &&
      (currentFilter instanceof CapabilitiesHandler)) {
    currentFilterCapabilities = ((CapabilitiesHandler)currentFilter).getCapabilities();

    if (!currentFilterCapabilities.supportsMaybe(currentCapabilitiesFilter) &&
        !currentFilterCapabilities.supports(currentCapabilitiesFilter)) {
      try {
        currentFilter.setInputFormat(getInstances());
      } catch (Exception ex) {
        m_ApplyFilterBut.setEnabled(false);
      }
    }
  }
}