Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
sarah.grebing
ProofScriptParser
Commits
a19583e8
Commit
a19583e8
authored
Jun 08, 2018
by
Lulu Luong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whole underline
+ Proof tree
parent
2adcc946
Pipeline
#22437
passed with stages
in 3 minutes and 21 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
9 deletions
+59
-9
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java
...edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java
+10
-3
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/ProofTree.java
...java/edu/kit/iti/formal/psdbg/gui/controls/ProofTree.java
+44
-4
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/ScriptArea.java
...ava/edu/kit/iti/formal/psdbg/gui/controls/ScriptArea.java
+5
-2
No files found.
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java
View file @
a19583e8
...
@@ -74,6 +74,7 @@ import org.reactfx.util.Timer;
...
@@ -74,6 +74,7 @@ import org.reactfx.util.Timer;
import
javax.annotation.Nullable
;
import
javax.annotation.Nullable
;
import
javax.swing.*
;
import
javax.swing.*
;
import
javax.xml.bind.JAXBException
;
import
java.awt.event.WindowAdapter
;
import
java.awt.event.WindowAdapter
;
import
java.awt.event.WindowEvent
;
import
java.awt.event.WindowEvent
;
import
java.awt.event.WindowListener
;
import
java.awt.event.WindowListener
;
...
@@ -1266,10 +1267,16 @@ public class DebuggerMain implements Initializable {
...
@@ -1266,10 +1267,16 @@ public class DebuggerMain implements Initializable {
//Update Gui
//Update Gui
MainScriptIdentifier
msi
=
scriptController
.
getMainScript
();
MainScriptIdentifier
msi
=
scriptController
.
getMainScript
();
msi
.
getScriptArea
().
setSavepointMarker
(
selected
.
getLineNumber
());
msi
.
getScriptArea
().
setSavepointMarker
(
selected
.
getLineNumber
());
msi
.
getScriptArea
().
getCodeArea
().
setStyleClass
(
selected
.
getStartOffset
(),
selected
.
getEndOffset
()
+
1
,
"underlinesave"
);
scriptExecutionController
.
executeScriptFromSavePoint
(
interpreterBuilder
,
selected
);
scriptController
.
getMainScript
().
getScriptArea
().
underlineSavepoint
(
selected
);
try
{
KeyPersistentFacade
.
read
(
FACADE
.
getEnvironment
(),
FACADE
.
getProof
(),
new
StringReader
(
selected
.
getPersistedStateFile
(
FACADE
.
getFilepath
()).
toString
()));
}
catch
(
JAXBException
e
)
{
e
.
printStackTrace
();
}
scriptExecutionController
.
executeScriptFromSavePoint
(
interpreterBuilder
,
selected
);
//TODO: KeyPersistentFacade.read(FACADE.getEnvironment(), FACADE.getProof(), new StringReader(selected.getPersistedStateFile(FACADE.getFilepath()).toString()));
//TODO (NullpointerEx: interpreterbuilder == null): scriptExecutionController.executeScriptFromSavePoint(interpreterBuilder, selected);
}
}
...
...
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/ProofTree.java
View file @
a19583e8
...
@@ -29,11 +29,9 @@ import javafx.scene.control.cell.TextFieldTreeCell;
...
@@ -29,11 +29,9 @@ 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.HashMap
;
import
java.util.*
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.function.Consumer
;
import
java.util.function.Consumer
;
...
@@ -327,12 +325,14 @@ public class ProofTree extends BorderPane {
...
@@ -327,12 +325,14 @@ public class ProofTree extends BorderPane {
}
}
@AllArgsConstructor
@AllArgsConstructor
private
static
class
TreeNode
{
private
static
class
TreeNode
{
String
label
;
String
label
;
Node
node
;
Node
node
;
}
}
class
TreeTransformationKey
{
class
TreeTransformationKey
{
public
TreeItem
<
TreeNode
>
create
(
Proof
proof
)
{
public
TreeItem
<
TreeNode
>
create
(
Proof
proof
)
{
...
@@ -414,6 +414,7 @@ public class ProofTree extends BorderPane {
...
@@ -414,6 +414,7 @@ public class ProofTree extends BorderPane {
}
}
@RequiredArgsConstructor
@RequiredArgsConstructor
class
TreeTransformationScript
extends
TreeTransformationKey
{
class
TreeTransformationScript
extends
TreeTransformationKey
{
final
ProofTreeManager
<
KeyData
>
manager
;
final
ProofTreeManager
<
KeyData
>
manager
;
...
@@ -472,5 +473,44 @@ public class ProofTree extends BorderPane {
...
@@ -472,5 +473,44 @@ public class ProofTree extends BorderPane {
TreeItem
<
TreeNode
>
ti
=
new
TreeItem
<>(
new
TreeNode
(
lbl
,
n
));
TreeItem
<
TreeNode
>
ti
=
new
TreeItem
<>(
new
TreeNode
(
lbl
,
n
));
return
ti
;
return
ti
;
}
}
//TODO: Reverse ArrayList in the end or nah?
@Deprecated
public
ArrayList
<
String
>
getBranchLabels
(
TreeNode
node
)
{
TreeItem
<
TreeNode
>
proofTree
=
create
(
proof
.
get
());
ArrayList
<
String
>
branchlabels
=
new
ArrayList
<>();
int
i
=
0
;
branchlabels
.
set
(
0
,
node
.
label
);
while
(
node
!=
null
)
{
if
(!
branchlabels
.
get
(
i
).
equals
(
node
.
label
))
{
i
++;
branchlabels
.
set
(
i
,
node
.
label
);
}
//TODO: node = node.parent
}
return
branchlabels
;
}
public
ArrayList
<
String
>
getBranchLabels
(
Node
node
)
{
ArrayList
<
String
>
branchlabels
=
new
ArrayList
<>();
int
i
=
0
;
//TODO: branchlabel = all branchlabels or only next one
branchlabels
.
set
(
0
,
node
.
getNodeInfo
().
getBranchLabel
());
Node
n
=
node
.
parent
();
while
(
n
!=
null
)
{
if
(!
branchlabels
.
get
(
i
).
equals
(
n
.
getNodeInfo
().
getBranchLabel
()))
{
i
++;
branchlabels
.
set
(
i
,
n
.
getNodeInfo
().
getBranchLabel
());
}
n
=
n
.
parent
();
}
return
branchlabels
;
}
}
}
}
}
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/ScriptArea.java
View file @
a19583e8
...
@@ -9,7 +9,10 @@ import edu.kit.iti.formal.psdbg.gui.actions.acomplete.Suggestion;
...
@@ -9,7 +9,10 @@ import edu.kit.iti.formal.psdbg.gui.actions.acomplete.Suggestion;
import
edu.kit.iti.formal.psdbg.gui.actions.inline.InlineActionSupplier
;
import
edu.kit.iti.formal.psdbg.gui.actions.inline.InlineActionSupplier
;
import
edu.kit.iti.formal.psdbg.gui.controller.Events
;
import
edu.kit.iti.formal.psdbg.gui.controller.Events
;
import
edu.kit.iti.formal.psdbg.gui.model.MainScriptIdentifier
;
import
edu.kit.iti.formal.psdbg.gui.model.MainScriptIdentifier
;
import
edu.kit.iti.formal.psdbg.interpreter.data.KeyData
;
import
edu.kit.iti.formal.psdbg.interpreter.data.SavePoint
;
import
edu.kit.iti.formal.psdbg.interpreter.dbg.Breakpoint
;
import
edu.kit.iti.formal.psdbg.interpreter.dbg.Breakpoint
;
import
edu.kit.iti.formal.psdbg.interpreter.dbg.PTreeNode
;
import
edu.kit.iti.formal.psdbg.lint.LintProblem
;
import
edu.kit.iti.formal.psdbg.lint.LintProblem
;
import
edu.kit.iti.formal.psdbg.lint.LinterStrategy
;
import
edu.kit.iti.formal.psdbg.lint.LinterStrategy
;
import
edu.kit.iti.formal.psdbg.parser.Facade
;
import
edu.kit.iti.formal.psdbg.parser.Facade
;
...
@@ -388,8 +391,8 @@ public class ScriptArea extends BorderPane {
...
@@ -388,8 +391,8 @@ public class ScriptArea extends BorderPane {
}
}
}
}
public
void
underlineSavepoint
(){
public
void
underlineSavepoint
(
SavePoint
sp
){
codeArea
.
setStyle
(
sp
.
getLineNumber
()
-
1
,
Collections
.
singleton
(
"underlinesave"
));
}
}
private
void
highlightNonExecutionArea
()
{
private
void
highlightNonExecutionArea
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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