use of artisynth.core.probes.NumericProbeVariable in project artisynth_core by artisynth.
the class OutputNumericProbeEditor method renameProperty.
/**
* renames the current property by: a.) changing the name in myVariables b.)
* updating this change in all drivers
*/
public void renameProperty(String oldname, String newname) {
// first, rename the property in the variables list.
try {
NumericProbeVariable var = myVariables.get(oldname);
// System.out.println(var.getDimension());
myVariables.remove(oldname);
myVariables.put(newname, var);
} catch (Exception e) {
System.out.println(e.getMessage());
}
// then, rename it for each driver.
for (NumericProbeDriver driver : myDrivers) {
if (driver.isValid()) {
driver.renameVariable(oldname, newname);
System.out.println(oldname + " changed to " + newname);
int id = myDrivers.indexOf(driver);
getEqPane(id).setEqText(driver.getExpression());
getEqPane(id).updateAppearance();
System.out.println("setting driver " + id + " expression to " + driver.getExpression());
}
}
// System.out.println("Done renaming of Property");
}
use of artisynth.core.probes.NumericProbeVariable in project artisynth_core by artisynth.
the class OutputNumericProbeEditor method addBlankOutputProperty.
private void addBlankOutputProperty() {
// GUI components:
String propname = getUniqueVariableName(OUTPUT_PREFIX);
AddPropertyPane newPropPane = new AddPropertyPane(this);
newPropPane.setPropNameField(propname);
newPropPane.setPropNameEnabled(true);
addPropertyGUI(newPropPane);
// Data components:
myProperties.add(myProperties.size(), null);
NumericProbeVariable variable = new NumericProbeVariable(1);
myVariables.put(propname, variable);
}
Aggregations