use of gov.sandia.n2a.ui.eq.undo.DeleteEquation in project n2a by frothga.
the class NodeEquation method delete.
@Override
public void delete(JTree tree, boolean canceled) {
if (source.isFromTopDocument()) {
PanelModel.instance.undoManager.add(new DeleteEquation(this, canceled));
} else {
NodeVariable parent = (NodeVariable) getParent();
String combiner = parent.source.get();
// strip @ from name, as required by ChangeEquation
String name = source.key().substring(1);
String value = source.get();
// revoke the equation
PanelModel.instance.undoManager.add(new ChangeEquation(parent, name, combiner, value, name, combiner, ""));
}
}
use of gov.sandia.n2a.ui.eq.undo.DeleteEquation in project n2a by frothga.
the class NodeEquation method makeDelete.
@Override
public Undoable makeDelete(boolean canceled) {
if (source.isFromTopDocument())
return new DeleteEquation(this, canceled);
NodeVariable parent = (NodeVariable) getParent();
String combiner = parent.source.get();
// strip @ from name, as required by ChangeEquation
String name = source.key().substring(1);
String value = source.get();
// revoke the equation
return new ChangeEquation(parent, name, combiner, value, name, combiner, "$kill");
}
Aggregations