Search in sources :

Example 61 with DataColumnSpecFilterConfiguration

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

the class CategoryToNumberNodeSettings method loadSettingsForModel.

/**
 * Called from model when settings are to be loaded.
 * @param settings To load from
 * @throws InvalidSettingsException If settings are invalid.
 */
void loadSettingsForModel(final NodeSettingsRO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration config = CategoryToNumberNodeModel.createDCSFilterConfiguration();
    config.loadConfigurationInModel(settings);
    m_filterConfiguration = config;
    /**
     * Define names of new columns.
     */
    m_appendColumns = settings.getBoolean(APPEND_COLUMN);
    m_columnSuffix = settings.getString(COLUMN_SUFFIX);
    /**
     * controls content of output columns.
     */
    m_startIndex = settings.getInt(START_INDEX);
    m_increment = settings.getInt(INCREMENT);
    /**
     * maximum number of allowed categories.
     */
    m_maxCategories = settings.getInt(MAX_CATEGORIES);
    /**
     * corner cases for the applier.
     */
    m_defaultValue = settings.getDataCell(DEFAULT_VALUE);
    m_mapMissingTo = settings.getDataCell(MAP_MISSING_TO);
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 62 with DataColumnSpecFilterConfiguration

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

the class CategoryToNumberNodeSettings method loadSettingsForDialog.

/**
 * Called from dialog when settings are to be loaded.
 * @param settings To load from
 */
void loadSettingsForDialog(final NodeSettingsRO settings, final DataTableSpec spec) {
    DataColumnSpecFilterConfiguration config = CategoryToNumberNodeModel.createDCSFilterConfiguration();
    config.loadConfigurationInDialog(settings, spec);
    m_filterConfiguration = config;
    /**
     * Define names of new columns.
     */
    m_appendColumns = settings.getBoolean(APPEND_COLUMN, true);
    m_columnSuffix = settings.getString(COLUMN_SUFFIX, " (to number)");
    /**
     * controls content of output columns.
     */
    m_startIndex = settings.getInt(START_INDEX, 0);
    m_increment = settings.getInt(INCREMENT, 1);
    /**
     * maximum number of allowed categories.
     */
    m_maxCategories = settings.getInt(MAX_CATEGORIES, DEFAULT_MAX_CATEGORIES);
    /**
     * corner cases for the applier.
     */
    m_defaultValue = settings.getDataCell(DEFAULT_VALUE, DataType.getMissingCell());
    m_mapMissingTo = settings.getDataCell(MAP_MISSING_TO, DataType.getMissingCell());
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 63 with DataColumnSpecFilterConfiguration

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

the class ColumnToGrid2Configuration method loadSettings.

/**
 * Loads settings in model.
 * @param settings To load from.
 * @throws InvalidSettingsException If invalid.
 */
void loadSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration conf = ColumnToGrid2NodeModel.createDCSFilterConfiguration();
    conf.loadConfigurationInModel(settings);
    m_filterConfig = conf;
    m_colCount = settings.getInt("grid_col_count");
    if (m_colCount <= 0) {
        throw new InvalidSettingsException("Invalid grid col count: " + m_colCount);
    }
    m_groupColumn = settings.getString("groupColumn");
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration) InvalidSettingsException(org.knime.core.node.InvalidSettingsException)

Example 64 with DataColumnSpecFilterConfiguration

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

the class ColumnToGrid2Configuration method loadSettings.

/**
 * Loads settings in dialog, inits default if invalid.
 * @param settings To load from.
 * @param spec The input spec.
 */
void loadSettings(final NodeSettingsRO settings, final DataTableSpec spec) {
    DataColumnSpecFilterConfiguration conf = ColumnToGrid2NodeModel.createDCSFilterConfiguration();
    conf.loadConfigurationInDialog(settings, spec);
    m_filterConfig = conf;
    m_colCount = settings.getInt("grid_col_count", DEF_COL_COUNT);
    if (m_colCount <= 0) {
        m_colCount = DEF_COL_COUNT;
    }
    m_groupColumn = settings.getString("groupColumn", null);
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 65 with DataColumnSpecFilterConfiguration

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

the class DataColumnSpecFilterNodeDialogPane method saveSettingsTo.

/**
 * Sets the list of columns to exclude inside the corresponding
 * <code>NodeModel</code> which are retrieved from the filter panel.
 * @param settings the node settings to write into
 * @throws InvalidSettingsException if one of the settings is not valid
 */
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration config = DataColumnSpecFilterNodeModel.createDCSFilterConfiguration();
    m_filterPanel.saveConfiguration(config);
    config.saveConfiguration(settings);
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

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