Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
sarah.grebing
ProofScriptParser
Commits
0de0b416
Commit
0de0b416
authored
Jan 16, 2018
by
Sarah Grebing
Browse files
Fix for coloring of nodes
parent
a20c0eba
Pipeline
#16881
failed with stages
in 105 minutes and 57 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java
View file @
0de0b416
...
...
@@ -1119,6 +1119,7 @@ public class DebuggerMain implements Initializable {
ptree
.
setProof
(
proof
);
ptree
.
setRoot
(
pnode
);
ptree
.
addNodeColor
(
pnode
,
"blueviolet"
);
ptree
.
setDeactivateRefresh
(
true
);
...
...
@@ -1133,20 +1134,23 @@ public class DebuggerMain implements Initializable {
.
map
(
Goal:
:
node
)
.
collect
(
Collectors
.
toSet
());
ptree
.
getSentinels
().
addAll
(
sentinels
);
sentinels
.
forEach
(
node
->
ptree
.
addNodeColor
(
node
,
"blueviolet"
));
}
else
{
Set
<
Node
>
sentinels
=
new
HashSet
<>();
Iterator
<
Node
>
nodeIterator
=
beforeNode
.
getData
().
getNode
().
leavesIterator
();
while
(
nodeIterator
.
hasNext
())
{
Node
next
=
nodeIterator
.
next
();
sentinels
.
add
(
next
.
parent
()
);
sentinels
.
add
(
next
);
}
ptree
.
getSentinels
().
addAll
(
sentinels
);
sentinels
.
forEach
(
node
->
ptree
.
addNodeColor
(
node
,
"blueviolet"
));
//traverseProofTreeAndAddSentinelsToLeaves();
}
ptree
.
expandRootToLeaves
();
ptree
.
expandRootToSentinels
();
//TODO set coloring of starting and end node
DockNode
node
=
new
DockNode
(
ptree
,
"Proof Tree for Step Into: "
+
original
.
getStatement
().
accept
(
new
ShortCommandPrinter
())
...
...
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/ProofTree.java
View file @
0de0b416
...
...
@@ -14,6 +14,7 @@ import javafx.application.Platform;
import
javafx.beans.property.*
;
import
javafx.collections.FXCollections
;
import
javafx.collections.ObservableList
;
import
javafx.collections.ObservableMap
;
import
javafx.collections.ObservableSet
;
import
javafx.fxml.FXML
;
import
javafx.scene.control.*
;
...
...
@@ -42,7 +43,7 @@ public class ProofTree extends BorderPane {
private
SetProperty
<
Node
>
sentinels
=
new
SimpleSetProperty
<>(
FXCollections
.
observableSet
());
private
MapProperty
colorOfNodes
=
new
SimpleMapProperty
<>(
FXCollections
.
observableHashMap
());
private
MapProperty
<
Node
,
String
>
colorOfNodes
=
new
SimpleMapProperty
<
Node
,
String
>(
FXCollections
.
observableHashMap
());
@FXML
private
TreeView
<
TreeNode
>
treeProof
;
...
...
@@ -128,6 +129,7 @@ public class ProofTree extends BorderPane {
*
* @param candidate
*/
private
static
void
expandRootToItem
(
TreeItem
candidate
)
{
if
(
candidate
!=
null
)
{
expandRootToItem
(
candidate
.
getParent
());
...
...
@@ -156,14 +158,17 @@ public class ProofTree extends BorderPane {
}
}
public
void
addNodeColor
()
{
public
void
addNodeColor
(
Node
n
,
String
color
)
{
this
.
colorOfNodes
.
put
(
n
,
color
);
}
public
void
expandRootTo
Leave
s
()
{
public
void
expandRootTo
Sentinel
s
()
{
if
(
getTreeProof
().
getRoot
()
==
null
)
{
if
(
root
.
get
()
!=
null
)
{
TreeItem
<
TreeNode
>
item
=
populate
(
root
.
get
().
serialNr
()
+
": "
+
toString
(
root
.
get
()),
root
.
get
());
//new TreeItem<>(new TreeNode(root.get().serialNr() + ": " + toString(root.get()), root.get()));
TreeItem
<
TreeNode
>
item
=
populate
(
"Proof"
,
root
.
get
());
//populate(root.get().serialNr() + ": " + toString(root.get()), root.get());
//val treeNode = new TreeNode("Proof", root.get());
treeProof
.
setRoot
(
item
);
}
...
...
@@ -171,6 +176,7 @@ public class ProofTree extends BorderPane {
//expandRootToLeaves(getTreeProof().getRoot());
}
public
TreeView
<
TreeNode
>
getTreeProof
()
{
return
treeProof
;
}
...
...
@@ -416,38 +422,47 @@ public class ProofTree extends BorderPane {
TreeNode
item
=
tftc
.
getItem
();
Node
n
=
item
.
node
;
tftc
.
setStyle
(
""
);
if
(
n
!=
null
&&
n
.
leaf
()
&&
!
item
.
label
.
contains
(
"BRANCH"
))
{
if
(
n
.
isClosed
())
{
colorOfNodes
.
putIfAbsent
(
n
,
"seagreen"
);
//tftc.setStyle("-fx-background-color: greenyellow");
}
else
{
colorOfNodes
.
putIfAbsent
(
n
,
"darkred"
);
}
if
(
colorOfNodes
.
containsKey
(
n
))
{
tftc
.
setStyle
(
"-fx-background-color: "
+
colorOfNodes
.
get
(
n
)
+
";"
);
if
(
n
!=
null
)
{
if
(
n
.
leaf
()
&&
!
item
.
label
.
contains
(
"BRANCH"
))
{
if
(
n
.
isClosed
())
{
colorOfNodes
.
putIfAbsent
(
n
,
"lightseagreen"
);
//tftc.setStyle("-fx-background-color: greenyellow");
}
else
{
colorOfNodes
.
putIfAbsent
(
n
,
"indianred"
);
}
if
(
colorOfNodes
.
containsKey
(
n
))
{
tftc
.
setStyle
(
"-fx-background-color: "
+
colorOfNodes
.
get
(
n
)
+
";"
);
}
}
/* if (colorOfNodes.containsKey(n)) {
tftc.setStyle("-fx-border-color: "+colorOfNodes.get(n)+";");
}*/
}
expandRootToItem
(
tftc
.
getTreeItem
());
}
public
Object
getColorOfNodes
()
{
return
colorOfNodes
.
get
();
public
MapProperty
<
Node
,
String
>
colorOfNodesProperty
()
{
return
colorOfNodes
;
}
public
void
setColorOfNodes
(
Object
c
olorOfNodes
)
{
this
.
colorOfNodes
.
s
et
(
colorOfNodes
);
public
ObservableMap
<
Node
,
String
>
getC
olorOfNodes
(
)
{
return
colorOfNodes
.
g
et
();
}
public
MapProperty
colorOfNodes
Property
(
)
{
return
colorOfNodes
;
public
void
setColorOfNodes
(
ObservableMap
<
Node
,
String
>
colorOfNodes
)
{
this
.
colorOfNodes
.
set
(
colorOfNodes
)
;
}
public
Node
getRoot
()
{
return
root
.
get
();
}
public
void
setRoot
(
Node
root
)
{
this
.
root
.
set
(
root
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment