return;
}
boolean oldCmbRefreshing = cmbRefreshing;
cmbRefreshing = true;
try {
XForm xForm = getCurrXForm();
if (xForm != null) {
saveUndoPoint();
String fName = (String) data.TinaNonlinearControlsRows[pIdx].getNonlinearVarCmb().getSelectedItem();
Variation var;
if (pIdx < xForm.getVariationCount()) {
var = xForm.getVariation(pIdx);
if (fName == null || fName.length() == 0) {
xForm.removeVariation(var);
}
else {
if (var.getFunc() == null || !var.getFunc().getName().equals(fName)) {
var.setFunc(VariationFuncList.getVariationFuncInstance(fName));
}
}
}
else {
var = new Variation();
String varStr = data.TinaNonlinearControlsRows[pIdx].getNonlinearVarREd().getText();
if (varStr == null || varStr.length() == 0) {
varStr = "0";
}
var.setFunc(VariationFuncList.getVariationFuncInstance(fName));
var.setAmount(Tools.stringToDouble(varStr));
xForm.addVariation(var);
}
refreshParamCmb(data.TinaNonlinearControlsRows[pIdx], xForm, var);
refreshXFormUI(xForm);
// String selected = (String) TinaNonlinearControlsRows[pIdx].getNonlinearParamsCmb().getSelectedItem();
// boolean enabled = selected != null && selected.length() > 0;