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
d8ebcb2c
Commit
d8ebcb2c
authored
Jan 10, 2018
by
Sarah Grebing
Browse files
Fixed the bug with missing proof tree nodes and fixed the coloring issue of branching nodes
parent
2b49f8aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/ProofTree.java
View file @
d8ebcb2c
...
...
@@ -302,6 +302,7 @@ public class ProofTree extends BorderPane {
return
;
if
(
root
.
get
()
!=
null
)
{
TreeItem
<
TreeNode
>
item
=
populate
(
"Proof"
,
root
.
get
());
treeProof
.
setRoot
(
item
);
}
...
...
@@ -317,12 +318,23 @@ public class ProofTree extends BorderPane {
if
(
sentinels
.
contains
(
n
))
{
return
ti
;
}
if
(
label
.
equals
(
"Proof"
))
{
//we are at the root
TreeItem
<
TreeNode
>
self1
=
new
TreeItem
<>(
new
TreeNode
(
n
.
serialNr
()
+
": "
+
toString
(
n
),
n
));
ti
.
getChildren
().
add
(
self1
);
}
//if we are at a leaf we need to check goal state
if
(
n
.
childrenCount
()
==
0
)
{
TreeItem
<
TreeNode
>
e
=
new
TreeItem
<>(
new
TreeNode
(
n
.
isClosed
()
?
"CLOSED GOAL"
:
"OPEN GOAL"
,
null
));
// TreeItem<TreeNode> e = new TreeItem<>(new TreeNode(
// n.isClosed() ? "CLOSED GOAL" : "OPEN GOAL", null));
/* if(!label.equals("Proof")) {
TreeItem<TreeNode> self = new TreeItem<>(new TreeNode(n.serialNr() + ": " + toString(n), n));
ti.getChildren().add(self);
}*/
// ti.getChildren().add(e);
ti
.
getChildren
().
add
(
e
);
return
ti
;
}
...
...
@@ -339,16 +351,22 @@ public class ProofTree extends BorderPane {
}
else
{
// children count > 1
Iterator
<
Node
>
nodeIterator
=
node
.
childrenIterator
();
Node
childNode
;
int
branchCounter
=
1
;
while
(
nodeIterator
.
hasNext
())
{
childNode
=
nodeIterator
.
next
();
if
(
childNode
.
getNodeInfo
().
getBranchLabel
()
!=
null
)
{
ti
.
getChildren
().
add
(
populate
(
childNode
.
getNodeInfo
().
getBranchLabel
(),
childNode
));
TreeItem
<
TreeNode
>
populate
=
populate
(
childNode
.
getNodeInfo
().
getBranchLabel
(),
childNode
);
// TreeItem<TreeNode> self = new TreeItem<>(new TreeNode(childNode.serialNr() + ": " + toString(childNode), childNode));
// populate.getChildren().add(0, self);
ti
.
getChildren
().
add
(
populate
);
}
else
{
//ti.getChildren().add(populate(childNode.getAppliedRuleApp().rule().name().toString(), childNode));
ti
.
getChildren
().
add
(
populate
(
"BRANCH "
+
branchCounter
,
childNode
));
TreeItem
<
TreeNode
>
populate
=
populate
(
"BRANCH "
+
branchCounter
,
childNode
);
TreeItem
<
TreeNode
>
self
=
new
TreeItem
<>(
new
TreeNode
(
childNode
.
serialNr
()
+
": "
+
toString
(
childNode
),
childNode
));
populate
.
getChildren
().
add
(
0
,
self
);
ti
.
getChildren
().
add
(
populate
);
branchCounter
++;
}
}
...
...
@@ -387,9 +405,10 @@ public class ProofTree extends BorderPane {
}
private
void
repaint
(
TextFieldTreeCell
<
TreeNode
>
tftc
)
{
Node
n
=
tftc
.
getItem
().
node
;
TreeNode
item
=
tftc
.
getItem
();
Node
n
=
item
.
node
;
tftc
.
setStyle
(
""
);
if
(
n
!=
null
&&
n
.
leaf
())
{
if
(
n
!=
null
&&
n
.
leaf
()
&&
!
item
.
label
.
contains
(
"BRANCH"
)
)
{
if
(
n
.
isClosed
())
{
colorOfNodes
.
putIfAbsent
(
n
,
"seagreen"
);
//tftc.setStyle("-fx-background-color: greenyellow");
...
...
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