Search in sources :

Example 6 with SettingsModelBoolean

use of org.knime.core.node.defaultnodesettings.SettingsModelBoolean in project knime-core by knime.

the class AbstractFieldExtractorNodeDialog method createUIComponentFor.

/**
 * Creates the necessary {@link SettingsModel}s, adds the listener to the
 * checkbox and creates the UI component with a horizontally oriented group
 * containing the checkbox and text field. Then closes the group.
 * @param timeField name of the time field for which the ui component
 * should be created
 */
protected void createUIComponentFor(final String timeField) {
    // create the settings models and add listener
    SettingsModelBoolean checkBoxModel = createUseTimeFieldModel(timeField);
    SettingsModelString colNameModel = createTimeFieldColumnNameModel(timeField);
    addListener(checkBoxModel, colNameModel);
    createNewGroup("");
    setHorizontalPlacement(true);
    addDialogComponent(new DialogComponentBoolean(checkBoxModel, timeField));
    addDialogComponent(new DialogComponentString(colNameModel, "Column name:", true, 20));
    closeCurrentGroup();
    setHorizontalPlacement(false);
}
Also used : SettingsModelBoolean(org.knime.core.node.defaultnodesettings.SettingsModelBoolean) DialogComponentString(org.knime.core.node.defaultnodesettings.DialogComponentString) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 7 with SettingsModelBoolean

use of org.knime.core.node.defaultnodesettings.SettingsModelBoolean in project knime-core by knime.

the class DecTreePredictorNodeFactory method createNodeDialogPane.

/**
 * {@inheritDoc}
 */
@Override
public NodeDialogPane createNodeDialogPane() {
    return new DefaultNodeSettingsPane() {

        {
            addDialogComponent(new DialogComponentNumber(DecTreePredictorNodeModel.createMaxNumPatternSettings(), /* label: */
            "Maximum number of stored patterns " + "for HiLite-ing: ", 100));
            addDialogComponent(new DialogComponentBoolean(new SettingsModelBoolean(DecTreePredictorNodeModel.SHOW_DISTRIBUTION, false), "Append columns with normalized class distribution"));
        }
    };
}
Also used : SettingsModelBoolean(org.knime.core.node.defaultnodesettings.SettingsModelBoolean) DialogComponentNumber(org.knime.core.node.defaultnodesettings.DialogComponentNumber) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) DefaultNodeSettingsPane(org.knime.core.node.defaultnodesettings.DefaultNodeSettingsPane)

Example 8 with SettingsModelBoolean

use of org.knime.core.node.defaultnodesettings.SettingsModelBoolean in project knime-core by knime.

the class ColumnListLoopStartNodeDialog method saveSettingsTo.

/**
 * {@inheritDoc}
 */
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration conf = ColumnListLoopStartNodeModel.createDCSFilterConfiguration();
    m_filterPanel.saveConfiguration(conf);
    conf.saveConfiguration(settings);
    SettingsModelBoolean noColumnsSettings = ColumnListLoopStartNodeModel.createNoColumnsPolicySetings();
    noColumnsSettings.setBooleanValue(m_noColumnsPolicyOneInterationButton.isSelected());
    noColumnsSettings.saveSettingsTo(settings);
}
Also used : SettingsModelBoolean(org.knime.core.node.defaultnodesettings.SettingsModelBoolean) DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 9 with SettingsModelBoolean

use of org.knime.core.node.defaultnodesettings.SettingsModelBoolean in project knime-core by knime.

the class DecisionTreeLearnerNodeDialog2 method createSettingsFilterNominalValuesFromParent.

/**
 * @param skipNominalColumnsWithoutDomainModel model to listen to for
 * enablement (only enable if binary nominal splits)
 * @return model representing {@link
 * DecisionTreeLearnerNodeModel2#KEY_FILTER_NOMINAL_VALUES_FROM_PARENT}
 */
static SettingsModelBoolean createSettingsFilterNominalValuesFromParent(final SettingsModelBoolean skipNominalColumnsWithoutDomainModel) {
    final SettingsModelBoolean model = new SettingsModelBoolean(DecisionTreeLearnerNodeModel2.KEY_FILTER_NOMINAL_VALUES_FROM_PARENT, false);
    skipNominalColumnsWithoutDomainModel.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(final ChangeEvent e) {
            model.setEnabled(skipNominalColumnsWithoutDomainModel.getBooleanValue());
        }
    });
    model.setEnabled(skipNominalColumnsWithoutDomainModel.getBooleanValue());
    return model;
}
Also used : SettingsModelBoolean(org.knime.core.node.defaultnodesettings.SettingsModelBoolean) ChangeEvent(javax.swing.event.ChangeEvent) ChangeListener(javax.swing.event.ChangeListener)

Example 10 with SettingsModelBoolean

use of org.knime.core.node.defaultnodesettings.SettingsModelBoolean in project knime-core by knime.

the class CreateBitVectorNodeModel method createUseMeanModel.

/**
 * @return the use mean model
 */
static SettingsModelBoolean createUseMeanModel() {
    final SettingsModelBoolean model = new SettingsModelBoolean("singleNumericUseMean", DEFAULT_USE_MEAN);
    model.setEnabled(ColumnType.getDefault().equals(ColumnType.MULTI_NUMERICAL));
    return model;
}
Also used : SettingsModelBoolean(org.knime.core.node.defaultnodesettings.SettingsModelBoolean)

Aggregations

SettingsModelBoolean (org.knime.core.node.defaultnodesettings.SettingsModelBoolean)36 SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)15 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)13 ChangeEvent (javax.swing.event.ChangeEvent)5 ChangeListener (javax.swing.event.ChangeListener)5 IOException (java.io.IOException)4 CanceledExecutionException (org.knime.core.node.CanceledExecutionException)4 DialogComponentBoolean (org.knime.core.node.defaultnodesettings.DialogComponentBoolean)4 DialogComponentString (org.knime.core.node.defaultnodesettings.DialogComponentString)4 File (java.io.File)3 DataTableSpec (org.knime.core.data.DataTableSpec)3 RowKey (org.knime.core.data.RowKey)3 BufferedDataTable (org.knime.core.node.BufferedDataTable)3 ExecutionContext (org.knime.core.node.ExecutionContext)3 ExecutionMonitor (org.knime.core.node.ExecutionMonitor)3 NodeModel (org.knime.core.node.NodeModel)3 NodeSettingsRO (org.knime.core.node.NodeSettingsRO)3 NodeSettingsWO (org.knime.core.node.NodeSettingsWO)3 DateTimeException (java.time.DateTimeException)2 Duration (java.time.Duration)2