use of gov.sandia.n2a.ui.eq.tree.NodeBase in project n2a by frothga.
the class ChangeAnnotation method redo.
public void redo() {
super.redo();
apply(path, nameBefore, nameAfter, valueAfter, "$metadata", new NodeFactory() {
public NodeBase create(MPart part) {
return new NodeAnnotation(part);
}
});
}
use of gov.sandia.n2a.ui.eq.tree.NodeBase in project n2a by frothga.
the class ChangeInherit method apply.
public void apply(String value) {
NodeBase node = NodeBase.locateNode(path);
if (node == null)
throw new CannotRedoException();
PanelModel mep = PanelModel.instance;
JTree tree = mep.panelEquations.tree;
FilteredTreeModel model = (FilteredTreeModel) tree.getModel();
// Complex restructuring happens here.
node.source.set(value);
NodePart parent = (NodePart) node.getParent();
parent.build();
parent.findConnections();
parent.filter(model.filterLevel);
if (parent.visible(model.filterLevel))
model.nodeStructureChanged(parent);
TreeNode[] nodePath = parent.child("$inherit").getPath();
mep.panelEquations.updateOrder(nodePath);
mep.panelEquations.updateVisibility(nodePath);
}
use of gov.sandia.n2a.ui.eq.tree.NodeBase in project n2a by frothga.
the class ChangeLock method apply.
public static void apply(List<String> path, boolean value) {
NodeBase parent = NodeBase.locateNode(path);
if (parent == null)
throw new CannotRedoException();
NodeBase node = parent.child("lock");
if (node == null)
throw new CannotRedoException();
PanelEquationTree pet = PanelModel.instance.panelEquations;
// Since this function implements both do and undo, we need to toggle the current lock state.
if (// Force entry to be local rather than inherited. Only a local entry causes the lock to take effect.
value)
// Force entry to be local rather than inherited. Only a local entry causes the lock to take effect.
node.source.override();
else
node.source.clearPath();
TreeNode[] nodePath = node.getPath();
pet.updateVisibility(nodePath);
pet.updateLock();
}
use of gov.sandia.n2a.ui.eq.tree.NodeBase in project n2a by frothga.
the class ChangeReference method undo.
public void undo() {
super.undo();
ChangeAnnotation.apply(path, nameAfter, nameBefore, valueBefore, "$reference", new NodeFactory() {
public NodeBase create(MPart part) {
return new NodeReference(part);
}
});
}
use of gov.sandia.n2a.ui.eq.tree.NodeBase in project n2a by frothga.
the class ChangeReference method redo.
public void redo() {
super.redo();
ChangeAnnotation.apply(path, nameBefore, nameAfter, valueAfter, "$reference", new NodeFactory() {
public NodeBase create(MPart part) {
return new NodeReference(part);
}
});
}
Aggregations