Search in sources :

Example 16 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class AutoBinnerLearnNodeDialogPane method loadSettingsFrom.

/**
 * @param settings to read intervals from
 * @param specs The input table spec
 * @see NodeDialogPane#loadSettingsFrom(NodeSettingsRO, PortObjectSpec[])
 * @throws NotConfigurableException if the spec contains no columns
 */
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final PortObjectSpec[] specs) throws NotConfigurableException {
    m_settings.loadSettingsForDialog(settings, (DataTableSpec) specs[0]);
    DataColumnSpecFilterConfiguration config = m_settings.getFilterConfiguration();
    m_filterPanel.loadConfiguration(config, (DataTableSpec) specs[0]);
    m_methodFixedNumber.setSelected(m_settings.getMethod().equals(Method.fixedNumber));
    m_methodSampleQuantiles.setSelected(m_settings.getMethod().equals(Method.sampleQuantiles));
    m_numBins.setEnabled(!m_methodSampleQuantiles.isSelected());
    m_equalityMethod.setEnabled(!m_methodSampleQuantiles.isSelected());
    m_sampleQuantiles.setEnabled(m_methodSampleQuantiles.isSelected());
    m_numBins.setValue(m_settings.getBinCount());
    m_equalityMethod.setSelectedItem(m_settings.getEqualityMethod());
    m_sampleQuantiles.setText(implode(m_settings.getSampleQuantiles()));
    m_binNamingNumbered.setSelected(m_settings.getBinNaming().equals(BinNaming.numbered));
    m_binNamingEdges.setSelected(m_settings.getBinNaming().equals(BinNaming.edges));
    m_binNamingMidpoints.setSelected(m_settings.getBinNaming().equals(BinNaming.midpoints));
    m_replaceColumn.setSelected(m_settings.getReplaceColumn());
    m_integerBounds.setSelected(m_settings.getIntegerBounds());
    m_defaultFormatting.setSelected(!m_settings.getAdvancedFormatting());
    m_advancedFormatting.setSelected(m_settings.getAdvancedFormatting());
    m_outputFormat.setEnabled(m_settings.getAdvancedFormatting());
    m_precision.setEnabled(m_settings.getAdvancedFormatting());
    m_precisionMode.setEnabled(m_settings.getAdvancedFormatting());
    m_roundingMode.setEnabled(m_settings.getAdvancedFormatting());
    m_outputFormat.setSelectedItem(m_settings.getOutputFormat());
    m_precision.setValue(m_settings.getPrecision());
    m_precisionMode.setSelectedItem(m_settings.getPrecisionMode());
    m_roundingMode.setSelectedItem(m_settings.getRoundingMode());
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 17 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class ColCombine2NodeDialog method loadSettingsFrom.

/**
 * {@inheritDoc}
 */
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
    m_spec = specs[0];
    if (m_spec.getNumColumns() == 0) {
        throw new NotConfigurableException("No input data available");
    }
    DataColumnSpecFilterConfiguration conf = ColCombine2NodeModel.createDCSFilterConfiguration();
    conf.loadConfigurationInDialog(settings, m_spec);
    m_filterPanel.loadConfiguration(conf, m_spec);
    String delimiter = settings.getString(ColCombine2NodeModel.CFG_DELIMITER_STRING, ",");
    boolean isQuoting = settings.getBoolean(ColCombine2NodeModel.CFG_IS_QUOTING, true);
    char quote = settings.getChar(ColCombine2NodeModel.CFG_QUOTE_CHAR, '"');
    String replaceDelim = "";
    if (!isQuoting) {
        replaceDelim = settings.getString(ColCombine2NodeModel.CFG_REPLACE_DELIMITER_STRING, replaceDelim);
    }
    String newColBase = "combined string";
    String newColName = newColBase;
    newColName = DataTableSpec.getUniqueColumnName(m_spec, newColName);
    newColName = settings.getString(ColCombine2NodeModel.CFG_NEW_COLUMN_NAME, newColName);
    m_delimTextField.setText(delimiter);
    m_appendColNameField.setText(newColName);
    if (isQuoting) {
        m_quoteCharRadioButton.doClick();
        m_quoteCharField.setValue(Character.valueOf(quote));
        boolean isQuotingAlways = settings.getBoolean(ColCombine2NodeModel.CFG_IS_QUOTING_ALWAYS, true);
        m_quoteAlwaysChecker.setSelected(isQuotingAlways);
    } else {
        m_replaceDelimRadioButton.doClick();
        m_replaceDelimStringField.setText(replaceDelim);
    }
}
Also used : NotConfigurableException(org.knime.core.node.NotConfigurableException) DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 18 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class ColCombine2NodeModel method loadValidatedSettingsFrom.

/**
 * {@inheritDoc}
 */
@Override
protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration conf = createDCSFilterConfiguration();
    conf.loadConfigurationInModel(settings);
    m_filterConf = conf;
    m_newColName = settings.getString(CFG_NEW_COLUMN_NAME);
    m_delimString = settings.getString(CFG_DELIMITER_STRING);
    m_isQuoting = settings.getBoolean(CFG_IS_QUOTING);
    if (m_isQuoting) {
        m_quoteChar = settings.getChar(CFG_QUOTE_CHAR);
        m_isQuotingAlways = settings.getBoolean(CFG_IS_QUOTING_ALWAYS);
    } else {
        m_replaceDelimString = settings.getString(CFG_REPLACE_DELIMITER_STRING);
    }
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 19 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class DomainNodeModel method loadValidatedSettingsFrom.

/**
 * {@inheritDoc}
 */
@Override
protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration possConfig = createDCSFilterConfigurationPossVals();
    possConfig.loadConfigurationInModel(settings);
    m_possValConfig = possConfig;
    DataColumnSpecFilterConfiguration minMaxConfig = createDCSFilterConfigurationMinMax();
    minMaxConfig.loadConfigurationInModel(settings);
    m_minMaxConfig = minMaxConfig;
    m_maxPossValues = settings.getInt(CFG_MAX_POSS_VALUES);
    m_minMaxRetainUnselected = settings.getBoolean(CFG_MIN_MAX_RETAIN_UNSELECTED);
    m_possValRetainUnselected = settings.getBoolean(CFG_POSSVAL_RETAIN_UNSELECTED);
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 20 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class LowVarFilter2NodeDialogPane method loadSettingsFrom.

/**
 * {@inheritDoc}
 */
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
    final DataTableSpec spec = specs[0];
    if (spec == null || spec.getNumColumns() == 0) {
        throw new NotConfigurableException("No columns available for " + "selection.");
    }
    List<String> defIncludes = new ArrayList<String>();
    for (DataColumnSpec s : specs[0]) {
        if (s.getType().isCompatible(DoubleValue.class)) {
            defIncludes.add(s.getName());
        }
    }
    double threshold = settings.getDouble(LowVarFilter2NodeModel.CFG_KEY_MAX_VARIANCE, 0.0);
    m_varianceSpinner.setValue(threshold);
    DataColumnSpecFilterConfiguration config = createColFilterConf();
    config.loadConfigurationInDialog(settings, spec);
    m_colFilterPanel.loadConfiguration(config, spec);
}
Also used : NotConfigurableException(org.knime.core.node.NotConfigurableException) DataTableSpec(org.knime.core.data.DataTableSpec) DataColumnSpec(org.knime.core.data.DataColumnSpec) DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration) ArrayList(java.util.ArrayList)

Aggregations

DataColumnSpecFilterConfiguration (org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)75 DataTableSpec (org.knime.core.data.DataTableSpec)15 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)14 NotConfigurableException (org.knime.core.node.NotConfigurableException)9 ChangeEvent (javax.swing.event.ChangeEvent)4 ChangeListener (javax.swing.event.ChangeListener)4 DataColumnSpec (org.knime.core.data.DataColumnSpec)4 SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)4 DatabaseConnectionSettings (org.knime.core.node.port.database.DatabaseConnectionSettings)4 EnforceOption (org.knime.core.node.util.filter.NameFilterConfiguration.EnforceOption)4 DatabaseConnectionPortObjectSpec (org.knime.core.node.port.database.DatabaseConnectionPortObjectSpec)2 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 Solver (org.knime.base.node.mine.regression.logistic.learner4.LogRegLearnerSettings.Solver)1 BinNaming (org.knime.base.node.preproc.autobinner3.AutoBinnerLearnSettings.BinNaming)1 EqualityMethod (org.knime.base.node.preproc.autobinner3.AutoBinnerLearnSettings.EqualityMethod)1 Method (org.knime.base.node.preproc.autobinner3.AutoBinnerLearnSettings.Method)1 DoubleValue (org.knime.core.data.DoubleValue)1 IntValue (org.knime.core.data.IntValue)1