Commit 587cb51a authored by Lulu Luong's avatar Lulu Luong

#45

parent a134b5fe
Pipeline #31342 failed with stages
......@@ -47,7 +47,7 @@ public class ScriptTreeGraph {
/**
* Contains color of nodes
*/
private MapProperty<Node, String> colorOfNodes = new SimpleMapProperty<Node, String>(FXCollections.observableHashMap());
public MapProperty<Node, String> colorOfNodes = new SimpleMapProperty<Node, String>(FXCollections.observableHashMap());
public void createGraph(PTreeNode<KeyData> rootPTreeNode, Node root) {
......@@ -554,6 +554,9 @@ public class ScriptTreeGraph {
}
colorOfNodes.putIfAbsent(branchlabels.get(i).getNode(), "gray");
}
}
......
......@@ -41,6 +41,7 @@ public class ScriptTreeView extends BorderPane {
}
private TreeCell<TreeNode> cellFactory(TreeView<TreeNode> nodeTreeView) {
TextFieldTreeCell<TreeNode> tftc = new TextFieldTreeCell<>();
StringConverter<TreeNode> stringConverter = new StringConverter<TreeNode>() {
@Override
......@@ -60,6 +61,7 @@ public class ScriptTreeView extends BorderPane {
repaint(tftc);
});
//colorOfNodes.addListener((InvalidationListener) o -> repaint(tftc));
return tftc;
}
......@@ -128,18 +130,14 @@ public class ScriptTreeView extends BorderPane {
if (n != null) {
if (n.leaf() && !item.label.contains("BRANCH")) {
if (n.isClosed()) {
colorOfNodes.putIfAbsent(n, "lightseagreen");
stg.colorOfNodes.putIfAbsent(n, "lightseagreen");
//tftc.setStyle("-fx-background-color: greenyellow");
} else {
colorOfNodes.putIfAbsent(n, "indianred");
}
if(stg.getMapping().get(n) instanceof BranchLabelNode){
colorOfNodes.putIfAbsent(n, "gray");
stg.colorOfNodes.putIfAbsent(n, "indianred");
}
if (colorOfNodes.containsKey(n)) {
tftc.setStyle("-fx-background-color: " + colorOfNodes.get(n) + ";");
if (stg.colorOfNodes.containsKey(n)) {
tftc.setStyle("-fx-background-color: " + stg.colorOfNodes.get(n) + ";");
}
}
......
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