use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class RenameConfiguration method save.
/**
* @param settings the NodeSettingsWO to write to
*/
public void save(final NodeSettingsWO settings) {
for (Entry<String, RenameColumnSetting> entry : m_settings.entrySet()) {
NodeSettingsWO subSub = settings.addNodeSettings(entry.getKey());
entry.getValue().saveSettingsTo(subSub);
}
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class BinnerNodeDialogPane method saveSettingsTo.
/**
* @param settings write intervals to
* @throws InvalidSettingsException if a bin name is empty
* @see NodeDialogPane#saveSettingsTo(NodeSettingsWO)
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
LinkedHashSet<String> colList = new LinkedHashSet<String>();
for (String cell : m_intervals.keySet()) {
IntervalPanel p = m_intervals.get(cell);
// only if at least 1 bin is defined
if (p.getNumIntervals() > 0) {
colList.add(cell);
NodeSettingsWO set = settings.addNodeSettings(cell.toString());
if (p.isAppendedColumn()) {
String appendedName = p.getColumnName();
Enumeration<?> e = m_numMdl.elements();
while (e.hasMoreElements()) {
DataColumnSpec cspec = (DataColumnSpec) e.nextElement();
if (cspec.getName().equals(appendedName)) {
throw new InvalidSettingsException("New appended column " + appendedName + " matches other column.");
}
}
settings.addString(cell.toString() + BinnerNodeModel.IS_APPENDED, appendedName);
} else {
settings.addString(cell.toString() + BinnerNodeModel.IS_APPENDED, null);
}
for (int j = 0; j < p.getNumIntervals(); j++) {
IntervalItemPanel item = p.getInterval(j);
String binName = item.getBin();
if (binName == null || binName.length() == 0) {
throw new InvalidSettingsException("Name for bin " + j + " not set: " + item);
}
NodeSettingsWO bin = set.addNodeSettings(binName + "_" + j);
NumericBin theBin = new NumericBin(binName, item.isLeftOpen(), item.getLeftValue(false), item.isRightOpen(), item.getRightValue(false));
theBin.saveToSettings(bin);
}
}
}
// add binned columns
String[] columns = colList.toArray(new String[0]);
settings.addStringArray(BinnerNodeModel.NUMERIC_COLUMNS, columns);
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class MVColumnSettings method saveSettings.
/**
* Saves the settings to a NodeSettings object.
* @param settings the settings to save to
*/
protected void saveSettings(final NodeSettingsWO settings) {
settings.addStringArray(COLUMN_NAMES_KEY, m_columns.toArray(new String[0]));
NodeSettingsWO s = settings.addNodeSettings(SETTINGS_KEY);
m_settings.saveSettings(s);
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class MVSettings method saveToSettings.
/**
* Saves the settings.
* @param settings the settings to save to
*/
public void saveToSettings(final NodeSettingsWO settings) {
NodeSettingsWO colSettings = settings.addNodeSettings(COL_SETTINGS_CFG);
int i = 0;
for (MVColumnSettings cols : m_columnSettings) {
NodeSettingsWO colSetting = colSettings.addNodeSettings((Integer.toString(i++)));
cols.saveSettings(colSetting);
}
NodeSettingsWO dtSettings = settings.addNodeSettings(DT_SETTINGS_CFG);
for (Entry<String, MVIndividualSettings> entry : m_generalSettings.entrySet()) {
NodeSettingsWO dtSetting = dtSettings.addNodeSettings(entry.getKey());
entry.getValue().saveSettings(dtSetting);
}
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class MVIndividualSettings method saveSettings.
/**
* Saves settings for a column.
* @param settings the settings to write to
*/
protected void saveSettings(final NodeSettingsWO settings) {
settings.addString(FACTORY_ID_CFG, m_factory.getID());
NodeSettingsWO s = settings.addNodeSettings(SETTINGS_CFG);
m_settings.copyTo(s);
}
Aggregations