use of gov.sandia.n2a.ui.eq.PanelEquationTree in project n2a by frothga.
the class ChangeVariableToInherit method redo.
public void redo() {
super.redo();
NodePart parent = (NodePart) NodeBase.locateNode(path);
if (parent == null)
throw new CannotRedoException();
NodePart grandparent = (NodePart) parent.getTrueParent();
// Update database
MPart mparent = parent.source;
mparent.clear(treeBefore.key());
mparent.set(valueAfter, "$inherit");
// Update GUI
PanelEquations pe = PanelModel.instance.panelEquations;
PanelEquationTree pet = parent.getTree();
FilteredTreeModel model = (FilteredTreeModel) pet.tree.getModel();
PanelEquationGraph peg = pe.panelEquationGraph;
parent.build();
if (grandparent == null)
parent.findConnections();
else
grandparent.findConnections();
parent.rebuildPins();
parent.filter();
if (parent == pe.part) {
peg.reloadPart();
parent.filter();
}
model.nodeStructureChanged(parent);
TreeNode[] nodePath = parent.child("$inherit").getPath();
pet.updateOrder(nodePath);
pet.updateVisibility(nodePath);
pet.animate();
if (parent != pe.part) {
peg.updatePins();
peg.reconnect();
peg.repaint();
}
if (// root node, so update categories in search list
parent.getTrueParent() == null) {
PanelModel.instance.panelSearch.search();
}
}
Aggregations