Ejemplo n.º 1
0
 /**
  * Saves current parameters to settings object.
  *
  * @param settings To save to.
  */
 public void saveSettings(final NodeSettingsWO settings) {
   for (Entry<Section, int[]> section : this.scriptParts.entrySet())
     settings.addIntArray(section.getKey().name(), section.getValue());
   settings.addString(SCRIPT, this.script);
   settings.addStringArray(JAR_FILES, this.jarFiles);
   this.saveParameters(settings, PARAMETERS, this.parameters);
   settings.addString(VERSION, this.version);
   settings.addString(JAVA_HOME, this.javaHome);
 }
Ejemplo n.º 2
0
  public void saveSettings(NodeSettingsWO settings) {
    if (configs.size() == 0) return;

    StringBuilder names = new StringBuilder();
    Iterator<StatisticConfig> i = configs.values().iterator();
    while (i.hasNext()) {
      StatisticConfig sel = i.next();
      if (names.length() > 0) names.append(",");
      names.append(sel.table);
      ConfigWO config = settings.addConfig(PREFIX + sel.table);
      config.addString("table", sel.table);
      config.addString("description", sel.description);
      config.addString("query", sel.query);
    }
    settings.addString(QUERY_NAMES, names.toString());
  }
Ejemplo n.º 3
0
 /** {@inheritDoc} */
 @Override
 public void saveAdditionalSettingsTo(final NodeSettingsWO settings)
     throws InvalidSettingsException {
   if (m_intervalPanel.getNumIntervals() == 0) {
     throw new InvalidSettingsException("No pixel bins have been specified.");
   }
   createPixelBins()
       .saveToSettings(settings.addNodeSettings(IntensityBinnerNodeModel.KEY_BIN_SETTINGS));
 }
Ejemplo n.º 4
0
 private void saveParameters(final NodeSettingsWO settings, String key, List<Parameter> vars) {
   int count = vars.size();
   ConfigBaseWO config = settings.addConfigBase(key);
   config.addInt("count", count);
   for (int index = 0; index < count; index++) {
     config.addString(String.format("name%d", index), vars.get(index).getName());
     config.addString(String.format("type%d", index), vars.get(index).getType().name());
     config.addBoolean(String.format("optional%d", index), vars.get(index).isOptional());
   }
 }