Commit d963c3eb authored by Sarah Grebing's avatar Sarah Grebing

Now also colorings are handled

parent d0826e9e
Pipeline #23686 passed with stages
in 2 minutes and 45 seconds
...@@ -7,7 +7,6 @@ import de.uka.ilkd.key.proof.Node; ...@@ -7,7 +7,6 @@ import de.uka.ilkd.key.proof.Node;
import de.uka.ilkd.key.proof.Proof; import de.uka.ilkd.key.proof.Proof;
import de.uka.ilkd.key.proof.ProofTreeEvent; import de.uka.ilkd.key.proof.ProofTreeEvent;
import de.uka.ilkd.key.proof.ProofTreeListener; import de.uka.ilkd.key.proof.ProofTreeListener;
import de.uka.ilkd.key.taclettranslation.assumptions.SupportedTaclets;
import edu.kit.iti.formal.psdbg.ShortCommandPrinter; import edu.kit.iti.formal.psdbg.ShortCommandPrinter;
import edu.kit.iti.formal.psdbg.gui.controller.DebuggerMain; import edu.kit.iti.formal.psdbg.gui.controller.DebuggerMain;
import edu.kit.iti.formal.psdbg.gui.controller.Events; import edu.kit.iti.formal.psdbg.gui.controller.Events;
...@@ -31,7 +30,6 @@ import javafx.scene.control.cell.TextFieldTreeCell; ...@@ -31,7 +30,6 @@ import javafx.scene.control.cell.TextFieldTreeCell;
import javafx.scene.layout.BorderPane; import javafx.scene.layout.BorderPane;
import javafx.util.StringConverter; import javafx.util.StringConverter;
import lombok.*; import lombok.*;
import sun.reflect.generics.tree.Tree;
import java.util.*; import java.util.*;
import java.util.function.Consumer; import java.util.function.Consumer;
...@@ -216,6 +214,7 @@ public class ProofTree extends BorderPane { ...@@ -216,6 +214,7 @@ public class ProofTree extends BorderPane {
} }
}; };
tftc.setConverter(stringConverter); tftc.setConverter(stringConverter);
tftc.itemProperty().addListener((p, o, n) -> { tftc.itemProperty().addListener((p, o, n) -> {
if (n != null ) if (n != null )
repaint(tftc); repaint(tftc);
...@@ -229,17 +228,9 @@ public class ProofTree extends BorderPane { ...@@ -229,17 +228,9 @@ public class ProofTree extends BorderPane {
Node n = item.node; Node n = item.node;
tftc.setStyle(""); tftc.setStyle("");
if (n != null) { if (n != null) {
if(!tftc.getTreeItem().getParent().isExpanded() && n.leaf()){
tftc.setStyle("");
if(colorOfNodes.containsKey(n)){
colorOfNodes.put(n, "white");
}
} else {
if (n.leaf() && !item.label.contains("CASE") ) { if (n.leaf() && !item.label.contains("CASE") ) {
System.out.println("n.serialNr() = " + n.serialNr() + " " + tftc.getTreeItem().getParent().isExpanded());
if (n.isClosed()) { if (n.isClosed()) {
colorOfNodes.putIfAbsent(n, "lightseagreen"); colorOfNodes.putIfAbsent(n, "lightseagreen");
//tftc.setStyle("-fx-background-color: greenyellow");
} else { } else {
colorOfNodes.putIfAbsent(n, "indianred"); colorOfNodes.putIfAbsent(n, "indianred");
} }
...@@ -253,7 +244,10 @@ public class ProofTree extends BorderPane { ...@@ -253,7 +244,10 @@ public class ProofTree extends BorderPane {
/* if (colorOfNodes.containsKey(n)) { /* if (colorOfNodes.containsKey(n)) {
tftc.setStyle("-fx-border-color: "+colorOfNodes.get(n)+";"); tftc.setStyle("-fx-border-color: "+colorOfNodes.get(n)+";");
}*/ }*/
}
//System.out.println("colorOfNodes = " + colorOfNodes);
} }
...@@ -338,6 +332,7 @@ public class ProofTree extends BorderPane { ...@@ -338,6 +332,7 @@ public class ProofTree extends BorderPane {
@Override @Override
public void handle(TreeItem.TreeModificationEvent<TreeNode> event) { public void handle(TreeItem.TreeModificationEvent<TreeNode> event) {
collapseTreeView(event.getTreeItem()); collapseTreeView(event.getTreeItem());
treeProof.setCellFactory(ProofTree.this::cellFactory);
} }
}); });
...@@ -364,6 +359,7 @@ public class ProofTree extends BorderPane { ...@@ -364,6 +359,7 @@ public class ProofTree extends BorderPane {
collapseTreeView(child); collapseTreeView(child);
} }
} }
} }
...@@ -379,18 +375,7 @@ public class ProofTree extends BorderPane { ...@@ -379,18 +375,7 @@ public class ProofTree extends BorderPane {
public TreeItem<TreeNode> create(Proof proof) { public TreeItem<TreeNode> create(Proof proof) {
TreeItem<TreeNode> self1 = new TreeItem<>(new TreeNode("Proof", null)); TreeItem<TreeNode> self1 = new TreeItem<>(new TreeNode("Proof", null));
self1.getChildren().add(populate("", proof.root())); self1.getChildren().add(populate("", proof.root()));
self1.addEventHandler(TreeItem.branchExpandedEvent(), new EventHandler<TreeItem.TreeModificationEvent<TreeNode>>() {
@Override
public void handle(TreeItem.TreeModificationEvent<TreeNode> event) {
expandTreeView(event.getTreeItem());
}
});
self1.addEventHandler(TreeItem.branchCollapsedEvent(), new EventHandler<TreeItem.TreeModificationEvent<TreeNode>>() {
@Override
public void handle(TreeItem.TreeModificationEvent<TreeNode> event) {
collapseTreeView(event.getTreeItem());
}
});
return self1; return self1;
} }
......
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