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
e5c867a9
Commit
e5c867a9
authored
May 30, 2017
by
Sarah Grebing
Browse files
Reworked some bindings and corrected formatting
parent
539f3116
Pipeline
#10848
failed with stage
in 1 minute and 44 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
e5c867a9
...
...
@@ -17,13 +17,13 @@
<developer>
<name>
Sarah Grebing
</name>
<email>
sarah.grebing@kit.edu
</email>
<organization>
Karlruhe Institute of Technology
</organization>
<organization>
Karl
s
ruhe Institute of Technology
</organization>
</developer>
<developer>
<name>
Alexander Weigl
</name>
<email>
weigl@kit.edu
</email>
<organization>
Karlruhe Institute of Technology
</organization>
<organization>
Karl
s
ruhe Institute of Technology
</organization>
</developer>
</developers>
...
...
src/main/java/edu/kit/formal/gui/ProofScriptDebugger.java
View file @
e5c867a9
package
edu.kit.formal.gui
;
/**
* Created by sarah on 5/26/17.
package
edu.kit.formal.gui
;
/**
* Main Entry for Debugger GUI
* @author S. Grebing
*/
import
edu.kit.formal.gui.controller.DebuggerMainWindowController
;
...
...
src/main/java/edu/kit/formal/gui/controller/DebuggerMainWindowController.java
View file @
e5c867a9
...
...
@@ -2,7 +2,6 @@ package edu.kit.formal.gui.controller;
import
edu.kit.formal.gui.FileUtils
;
import
edu.kit.formal.gui.model.RootModel
;
import
edu.kit.formal.interpreter.Interpreter
;
import
edu.kit.formal.interpreter.KeYProofFacade
;
import
edu.kit.formal.interpreter.data.GoalNode
;
import
edu.kit.formal.interpreter.data.KeyData
;
...
...
@@ -32,12 +31,12 @@ public class DebuggerMainWindowController implements Initializable {
Pane
rootPane
;
@FXML
SplitPane
splitPane
;
@FXML
ScrollPane
scrollPaneCode
;
/***********************************************************************************************************
* Code Area
* **********************************************************************************************************/
@FXML
ScrollPane
scrollPaneCode
;
@FXML
ScriptArea
scriptArea
;
/***********************************************************************************************************
...
...
@@ -65,11 +64,15 @@ public class DebuggerMainWindowController implements Initializable {
ListGoalView
goalView
;
ExecutorService
executorService
=
null
;
KeYProofFacade
facade
;
/**
* Model for the DebuggerController containing the neccessary references to objects needed for controlling backend through UI
*/
private
RootModel
model
;
@Setter
private
Interpreter
<
KeyData
>
interpreter
;
@Setter
private
Debugger
debugger
;
private
Stage
stage
;
@FXML
...
...
@@ -104,7 +107,9 @@ public class DebuggerMainWindowController implements Initializable {
protected
void
loadKeYFile
()
{
File
keyFile
=
openFileChooserDialog
(
"Select KeY File"
,
"KeY Files"
,
"key"
,
"java"
,
"script"
);
this
.
model
.
setKeYFile
(
keyFile
);
buildKeYProofFacade
();
if
(
keyFile
!=
null
)
{
buildKeYProofFacade
();
}
}
...
...
@@ -113,26 +118,18 @@ public class DebuggerMainWindowController implements Initializable {
this
.
stage
=
stage
;
}
/**
* @param title
* @param description
* @param fileEndings
* @return
* Needs to be set from calling method
* @param model
*/
private
File
openFileChooserDialog
(
String
title
,
String
description
,
String
...
fileEndings
)
{
FileChooser
fileChooser
=
new
FileChooser
();
fileChooser
.
setTitle
(
title
);
fileChooser
.
setSelectedExtensionFilter
(
new
FileChooser
.
ExtensionFilter
(
description
,
fileEndings
));
fileChooser
.
setInitialDirectory
(
new
File
(
"/home/sarah/Documents/KIT_Mitarbeiter/ProofScriptingLanguage/src/test/resources/edu/kit/formal/interpreter/contraposition/"
));
File
file
=
fileChooser
.
showOpenDialog
(
this
.
stage
);
return
file
;
}
public
void
setModel
(
RootModel
model
)
{
this
.
model
=
model
;
}
/**
*
*/
public
void
init
()
{
facade
=
new
KeYProofFacade
(
this
.
model
);
scriptArea
.
setRootModel
(
this
.
model
);
...
...
@@ -148,6 +145,9 @@ public class DebuggerMainWindowController implements Initializable {
}
/**
* Spawns a thread that builds the proof environment as facade with interpreter
*/
private
void
buildKeYProofFacade
()
{
executorService
=
Executors
.
newFixedThreadPool
(
2
);
executorService
.
execute
(()
->
{
...
...
@@ -159,4 +159,23 @@ public class DebuggerMainWindowController implements Initializable {
}
/**
* Creates a filechooser dialog
*
* @param title of the dialog
* @param description of the files
* @param fileEndings file that should be shown
* @return
*/
private
File
openFileChooserDialog
(
String
title
,
String
description
,
String
...
fileEndings
)
{
FileChooser
fileChooser
=
new
FileChooser
();
fileChooser
.
setTitle
(
title
);
fileChooser
.
setSelectedExtensionFilter
(
new
FileChooser
.
ExtensionFilter
(
description
,
fileEndings
));
fileChooser
.
setInitialDirectory
(
new
File
(
"/home/sarah/Documents/KIT_Mitarbeiter/ProofScriptingLanguage/src/test/resources/edu/kit/formal/interpreter/contraposition/"
));
File
file
=
fileChooser
.
showOpenDialog
(
this
.
stage
);
return
file
;
}
}
src/main/java/edu/kit/formal/gui/controller/ListGoalView.java
View file @
e5c867a9
...
...
@@ -3,6 +3,9 @@ package edu.kit.formal.gui.controller;
import
edu.kit.formal.gui.model.RootModel
;
import
edu.kit.formal.interpreter.data.GoalNode
;
import
edu.kit.formal.interpreter.data.KeyData
;
import
javafx.beans.property.SimpleListProperty
;
import
javafx.beans.value.ChangeListener
;
import
javafx.beans.value.ObservableValue
;
import
javafx.fxml.FXML
;
import
javafx.fxml.FXMLLoader
;
import
javafx.scene.control.ListCell
;
...
...
@@ -16,9 +19,9 @@ import java.io.IOException;
* Created by sarah on 5/27/17.
*/
public
class
ListGoalView
extends
VBox
{
protected
SimpleListProperty
<
GoalNode
<
KeyData
>>
localGoalListProperty
=
new
SimpleListProperty
<>();
@FXML
private
ListView
<
GoalNode
<
KeyData
>>
listOfGoals
;
private
ListView
<
GoalNode
<
KeyData
>>
listOfGoalsView
;
@FXML
private
TextArea
goalNodeView
;
...
...
@@ -37,7 +40,7 @@ public class ListGoalView extends VBox {
throw
new
RuntimeException
(
exception
);
}
listOfGoals
.
setCellFactory
(
list
->
new
GoalNodeCell
());
listOfGoals
View
.
setCellFactory
(
list
->
new
GoalNodeCell
());
}
...
...
@@ -46,12 +49,22 @@ public class ListGoalView extends VBox {
this
.
rootModel
=
rootModel
;
}
/**
* Set Bindings and listener
*/
public
void
init
()
{
this
.
listOfGoals
.
itemsProperty
().
bind
(
this
.
rootModel
.
currentGoalNodesProperty
());
// this.listOfGoals.itemsProperty().bind(this.rootModel.currentGoalNodesProperty());
goalNodeView
.
textProperty
().
bind
(
listOfGoals
.
getSelectionModel
().
selectedItemProperty
().
asString
());
listOfGoalsView
.
itemsProperty
().
bind
(
this
.
rootModel
.
currentGoalNodesProperty
());
listOfGoalsView
.
getSelectionModel
().
selectedItemProperty
().
addListener
(
new
ChangeListener
<
GoalNode
<
KeyData
>>()
{
@Override
public
void
changed
(
ObservableValue
<?
extends
GoalNode
<
KeyData
>>
observable
,
GoalNode
<
KeyData
>
oldValue
,
GoalNode
<
KeyData
>
newValue
)
{
goalNodeView
.
setText
(
newValue
.
toCellTextForKeYData
());
}
});
}
private
static
class
GoalNodeCell
extends
ListCell
<
GoalNode
<
KeyData
>>
{
@Override
...
...
src/main/java/edu/kit/formal/gui/model/RootModel.java
View file @
e5c867a9
...
...
@@ -10,32 +10,32 @@ import javafx.beans.property.SimpleObjectProperty;
import
javafx.collections.FXCollections
;
import
javafx.collections.ObservableList
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.io.File
;
/**
* Model for the root window
*
Created by sarah on 5/26/17.
*
@author S. Grebing
*/
public
class
RootModel
{
/**
*
C
urrent l
a
oded ScriptFile
*
Property: c
urrent lo
a
ded ScriptFile
*/
private
final
SimpleObjectProperty
<
File
>
scriptFile
;
/**
*
C
urrent loaded KeY File
*
Property: c
urrent loaded KeY File
*/
private
final
SimpleObjectProperty
<
File
>
keYFile
;
/**
*
C
urrent loaded script string
*
Property: c
urrent loaded script string
*/
private
final
SimpleObjectProperty
<
String
>
currentScript
;
/**
*
The
list of goal nodes in the current state (depending on interpreter state)
*
ListProperty:
list of goal nodes in the current state (depending on interpreter state)
*/
private
ListProperty
<
GoalNode
<
KeyData
>>
currentGoalNodes
;
...
...
@@ -45,6 +45,7 @@ public class RootModel {
private
SimpleObjectProperty
<
GoalNode
<
KeyData
>>
currentSelectedGoalNode
;
@Getter
@Setter
private
State
<
KeyData
>
currentState
;
...
...
@@ -57,18 +58,10 @@ public class RootModel {
}
public
GoalNode
<
KeyData
>
getCurrentSelectedGoalNode
()
{
return
currentSelectedGoalNode
.
get
();
}
public
void
setCurrentSelectedGoalNode
(
GoalNode
currentSelectedGoalNode
)
{
this
.
currentSelectedGoalNode
.
set
(
currentSelectedGoalNode
);
}
public
SimpleObjectProperty
<
GoalNode
<
KeyData
>>
currentSelectedGoalNodeProperty
()
{
return
currentSelectedGoalNode
;
}
/*****************************************************************************************************************
* Property Getter and Setter
***************************************************************************************************************/
public
File
getScriptFile
()
{
return
scriptFile
.
get
();
}
...
...
@@ -117,8 +110,19 @@ public class RootModel {
return
currentGoalNodes
;
}
public
GoalNode
<
KeyData
>
getCurrentSelectedGoalNode
()
{
return
currentSelectedGoalNode
.
get
();
}
public
void
setCurrentS
tate
(
Stat
e
<
KeyData
>
currentS
tat
e
)
{
this
.
currentS
tate
=
currentState
;
public
void
setCurrentS
electedGoalNode
(
GoalNod
e
<
KeyData
>
currentS
electedGoalNod
e
)
{
this
.
currentS
electedGoalNode
.
set
(
currentSelectedGoalNode
)
;
}
public
SimpleObjectProperty
<
GoalNode
<
KeyData
>>
currentSelectedGoalNodeProperty
()
{
return
currentSelectedGoalNode
;
}
}
src/main/resources/DebuggerMain.fxml
View file @
e5c867a9
...
...
@@ -46,7 +46,7 @@
AnchorPane.topAnchor=
"0.0"
SplitPane.resizableWithParent=
"true"
>
<!--<children>
<ListView fx:id="listOfGoals" prefHeight="200.0" prefWidth="200.0"/>
<ListView fx:id="listOfGoals
View
" prefHeight="200.0" prefWidth="200.0"/>
<TextArea fx:id="goalNodeView" prefHeight="200.0" prefWidth="200.0"/>
</children>-->
</ListGoalView>
...
...
src/main/resources/GoalView.fxml
View file @
e5c867a9
...
...
@@ -4,7 +4,7 @@
<fx:root xmlns:fx="http://javafx.com/fxml" type="javafx.scene.layout.VBox"
prefHeight="369.0" prefWidth="295.0">
<children>
<ListView fx:id="listOfGoals" prefHeight="200.0" prefWidth="200.0"/>
<ListView fx:id="listOfGoals
View
" prefHeight="200.0" prefWidth="200.0"/>
<TextArea fx:id="goalNodeView" prefHeight="200.0" prefWidth="200.0"/>
</children>
</fx:root>
\ No newline at end of file
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