Commit 5c4735b3 authored by Sarah Grebing's avatar Sarah Grebing

possible bugfix for subtree view stepinto

parent 49085499
Pipeline #23720 passed with stages
in 2 minutes and 40 seconds
......@@ -1462,10 +1462,17 @@ public class DebuggerMain implements Initializable {
ptree.setDeactivateRefresh(false);
if (stateAfterStmt.size() > 0) {
Set<Node> sentinels = proof.getSubtreeGoals(pnode)
proof.getSubtreeGoals(pnode).forEach(goal -> System.out.println("goal.node().serialNr() = " + goal.node().serialNr()));
Set<Node> sentinels;
sentinels = proof.getSubtreeGoals(pnode)
.stream()
.map(Goal::node)
.collect(Collectors.toSet());
if(sentinels.size() == 0){
sentinels = new LinkedHashSet();
sentinels.add(pnode);
//sentinels.add(stateAfterStmt.get(0).getData().getNode());
}
ptree.getSentinels().addAll(sentinels);
sentinels.forEach(node -> ptree.setNodeColor(node, "blueviolet"));
} else {
......@@ -1481,7 +1488,6 @@ public class DebuggerMain implements Initializable {
//traverseProofTreeAndAddSentinelsToLeaves();
}
ptree.expandRootToSentinels();
System.out.println("ptree = " + ptree.getRoot());
DockNode node = new DockNode(ptree, "Proof Tree for Step Into: " +
......
......@@ -159,13 +159,16 @@ public class ProofTree extends BorderPane {
this.colorOfNodes.put(n, color);
}
public void expandRootToSentinels() {
if (getTreeProof().getRoot() == null) {
if (root.get() != null) {
TreeItem<TreeNode> item = treeCreation.populate("Proof", root.get());
// populate(root.get().serialNr() + ": " + root.get().serialNr(), root.get());
//val treeNode = new TreeNode("Proof", root.get());
TreeItem<TreeNode> item;
if(sentinels.contains(root.get())){
item = treeCreation.itemFactory(root.get());
} else {
item = treeCreation.populate("Proof", root.get());
}
treeProof.setRoot(item);
}
......@@ -438,6 +441,8 @@ public class ProofTree extends BorderPane {
node = node.child(0);
currentItem.getChildren().add(new TreeItem<>(new TreeNode(node.serialNr() + ": " + toString(node), node)));
}
/*do {
currentItem.getChildren().add(itemFactory(node));
node = node.child(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment