Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
ProofScriptParser
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
24
Issues
24
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sarah.grebing
ProofScriptParser
Commits
ca4ce23b
Commit
ca4ce23b
authored
Jul 08, 2017
by
Alexander Weigl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docking framework seems good
parent
f581dea7
Pipeline
#11951
failed with stage
in 1 minute and 23 seconds
Changes
13
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
257 additions
and
264 deletions
+257
-264
lib/DockFX
lib/DockFX
+1
-1
pom.xml
pom.xml
+0
-2
src/main/java/edu/kit/formal/gui/controller/DebuggerMainWindowController.java
...t/formal/gui/controller/DebuggerMainWindowController.java
+64
-39
src/main/java/edu/kit/formal/gui/controls/InspectionViewTab.java
...n/java/edu/kit/formal/gui/controls/InspectionViewTab.java
+36
-82
src/main/java/edu/kit/formal/gui/controls/InspectionViewsController.java
...du/kit/formal/gui/controls/InspectionViewsController.java
+9
-27
src/main/java/edu/kit/formal/gui/controls/ScriptController.java
...in/java/edu/kit/formal/gui/controls/ScriptController.java
+0
-2
src/main/java/edu/kit/formal/gui/controls/WelcomePane.java
src/main/java/edu/kit/formal/gui/controls/WelcomePane.java
+18
-1
src/main/java/edu/kit/formal/gui/model/InspectionModel.java
src/main/java/edu/kit/formal/gui/model/InspectionModel.java
+65
-59
src/main/resources/DebuggerMain.fxml
src/main/resources/DebuggerMain.fxml
+8
-1
src/main/resources/edu/kit/formal/gui/controls/BreakpointDialog.fxml
...sources/edu/kit/formal/gui/controls/BreakpointDialog.fxml
+2
-1
src/main/resources/edu/kit/formal/gui/controls/InspectionViewTab.fxml
...ources/edu/kit/formal/gui/controls/InspectionViewTab.fxml
+12
-24
src/main/resources/edu/kit/formal/gui/controls/InspectionViewTabPane.fxml
...es/edu/kit/formal/gui/controls/InspectionViewTabPane.fxml
+2
-2
src/main/resources/edu/kit/formal/gui/controls/WelcomePane.fxml
...in/resources/edu/kit/formal/gui/controls/WelcomePane.fxml
+40
-23
No files found.
DockFX
@
bbbc5765
Compare
80c5e583
...
bbbc5765
Subproject commit
80c5e58344850b9ec92c84cb6fb9b56d6a1066f
3
Subproject commit
bbbc57653d6a0bc7463539de30fec075443c084
3
pom.xml
View file @
ca4ce23b
...
@@ -92,7 +92,6 @@
...
@@ -92,7 +92,6 @@
</goals>
</goals>
<configuration>
<configuration>
<sources>
<sources>
<source>
lib/AnchorFX/src/main/java
</source>
<source>
lib/DockFX/src/main/java
</source>
<source>
lib/DockFX/src/main/java
</source>
</sources>
</sources>
</configuration>
</configuration>
...
@@ -107,7 +106,6 @@
...
@@ -107,7 +106,6 @@
<configuration>
<configuration>
<resources>
<resources>
<resource>
<resource>
<directory>
lib/AnchorFX/src/main/resources
</directory>
<directory>
lib/DockFX/src/main/resources
</directory>
<directory>
lib/DockFX/src/main/resources
</directory>
</resource>
</resource>
</resources>
</resources>
...
...
src/main/java/edu/kit/formal/gui/controller/DebuggerMainWindowController.java
View file @
ca4ce23b
...
@@ -15,8 +15,6 @@ import edu.kit.formal.interpreter.graphs.ProofTreeController;
...
@@ -15,8 +15,6 @@ import edu.kit.formal.interpreter.graphs.ProofTreeController;
import
edu.kit.formal.proofscriptparser.ast.ProofScript
;
import
edu.kit.formal.proofscriptparser.ast.ProofScript
;
import
javafx.beans.property.SimpleBooleanProperty
;
import
javafx.beans.property.SimpleBooleanProperty
;
import
javafx.beans.value.ObservableBooleanValue
;
import
javafx.beans.value.ObservableBooleanValue
;
import
javafx.collections.FXCollections
;
import
javafx.collections.ObservableList
;
import
javafx.concurrent.Service
;
import
javafx.concurrent.Service
;
import
javafx.concurrent.Task
;
import
javafx.concurrent.Task
;
import
javafx.event.ActionEvent
;
import
javafx.event.ActionEvent
;
...
@@ -96,8 +94,17 @@ public class DebuggerMainWindowController implements Initializable {
...
@@ -96,8 +94,17 @@ public class DebuggerMainWindowController implements Initializable {
* GoalView
* GoalView
* **********************************************************************************************************/
* **********************************************************************************************************/
@FXML
private
final
InspectionViewsController
inspectionViewsController
=
new
InspectionViewsController
();
private
InspectionViewTabPane
inspectionViewTabPane
;
/**
*
*/
private
JavaArea
javaArea
=
new
JavaArea
();
private
DockNode
javaAreaDock
=
new
DockNode
(
javaArea
,
"Java Source"
,
new
MaterialDesignIconView
(
MaterialDesignIcon
.
CODEPEN
)
);
private
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
2
);
private
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
2
);
private
KeYProofFacade
facade
=
new
KeYProofFacade
();
private
KeYProofFacade
facade
=
new
KeYProofFacade
();
private
ContractLoaderService
contractLoaderService
=
new
ContractLoaderService
();
private
ContractLoaderService
contractLoaderService
=
new
ContractLoaderService
();
...
@@ -122,6 +129,10 @@ public class DebuggerMainWindowController implements Initializable {
...
@@ -122,6 +129,10 @@ public class DebuggerMainWindowController implements Initializable {
//TODO
//TODO
private
ObservableBooleanValue
executeNotPossible
=
pc
.
executeNotPossibleProperty
().
or
(
facade
.
readyToExecuteProperty
().
not
());
private
ObservableBooleanValue
executeNotPossible
=
pc
.
executeNotPossibleProperty
().
or
(
facade
.
readyToExecuteProperty
().
not
());
private
WelcomePane
welcomePane
=
new
WelcomePane
(
this
);
private
DockNode
welcomePaneDock
=
new
DockNode
(
welcomePane
,
"Welcome"
,
new
MaterialDesignIconView
(
MaterialDesignIcon
.
ACCOUNT
));
private
DockNode
activeInspectorDock
=
inspectionViewsController
.
getActiveInterpreterTabDock
();
public
static
void
showExceptionDialog
(
String
title
,
String
headerText
,
String
contentText
,
Throwable
ex
)
{
public
static
void
showExceptionDialog
(
String
title
,
String
headerText
,
String
contentText
,
Throwable
ex
)
{
Alert
alert
=
new
Alert
(
Alert
.
AlertType
.
ERROR
);
Alert
alert
=
new
Alert
(
Alert
.
AlertType
.
ERROR
);
...
@@ -153,12 +164,6 @@ public class DebuggerMainWindowController implements Initializable {
...
@@ -153,12 +164,6 @@ public class DebuggerMainWindowController implements Initializable {
alert
.
showAndWait
();
alert
.
showAndWait
();
}
}
private
ObservableList
<
ScriptArea
>
openScripts
=
FXCollections
.
observableArrayList
();
private
WelcomePane
welcomePane
=
new
WelcomePane
();
private
DockNode
welcomePaneDock
=
new
DockNode
(
welcomePane
,
"Welcome"
,
new
MaterialDesignIconView
(
MaterialDesignIcon
.
ACCOUNT
));
/**
/**
* @param location
* @param location
* @param resources
* @param resources
...
@@ -172,20 +177,10 @@ public class DebuggerMainWindowController implements Initializable {
...
@@ -172,20 +177,10 @@ public class DebuggerMainWindowController implements Initializable {
welcomePaneDock
.
dock
(
dockStation
,
DockPos
.
LEFT
);
welcomePaneDock
.
dock
(
dockStation
,
DockPos
.
LEFT
);
/*
/*
DockNode scripts = AnchorageSystem.createDock("Scripts", scriptController);
toolbar.getChildrenUnmodifiable().forEach(
DockNode a = AnchorageSystem.createDock("Abc", new ScriptArea());
DockNode b = AnchorageSystem.createDock("Def", new ScriptArea());
scripts.dock(dockStation, DockNode.DockPosition.CENTER);
a.dock(dockStation, DockNode.DockPosition.LEFT);
b.dock(dockStation, DockNode.DockPosition.LEFT);
*/
/* toolbar.getChildrenUnmodifiable().forEach(
n -> n.setOnMouseEntered(statusBar.getTooltipHandler()));
n -> n.setOnMouseEntered(statusBar.getTooltipHandler()));
buttonStartInterpreter.setOnMouseEntered(statusBar.getTooltipHandler());
buttonStartInterpreter.setOnMouseEntered(statusBar.getTooltipHandler());
*/
model
.
scriptFileProperty
().
addListener
((
observable
,
oldValue
,
newValue
)
->
{
model
.
scriptFileProperty
().
addListener
((
observable
,
oldValue
,
newValue
)
->
{
statusBar
.
publishMessage
(
"File: "
+
(
newValue
!=
null
?
newValue
.
getAbsolutePath
()
:
"n/a"
));
statusBar
.
publishMessage
(
"File: "
+
(
newValue
!=
null
?
newValue
.
getAbsolutePath
()
:
"n/a"
));
...
@@ -194,24 +189,15 @@ public class DebuggerMainWindowController implements Initializable {
...
@@ -194,24 +189,15 @@ public class DebuggerMainWindowController implements Initializable {
/**
/**
* create a new inspectionviewtab that is the main tab and not closable
* create a new inspectionviewtab that is the main tab and not closable
*/
*/
// inspectionViewTabPane.createNewInspectionViewTab(model, true);
inspectionViewsController
.
connectActiveView
(
model
);
//TODO this does not work any more
/*pc.goalsProperty().addListener((o, old, fresh) -> {
/*scriptController.getActiveScriptAreaTab().getScriptArea().getMarkedRegions().addListener((SetChangeListener<Integer>) change -> {
blocker.getBreakpoints().clear();
blocker.getBreakpoints().addAll(change.getSet());
});*/
/*pc.currentGoalsProperty().addListener((o, old, fresh) -> {
model.currentGoalNodesProperty().setAll(fresh);
model.currentGoalNodesProperty().setAll(fresh);
});
});
model.currentSelectedGoalNodeProperty().bind(pc.currentSelectedGoalProperty());*/
model.currentSelectedGoalNodeProperty().bind(pc.currentSelectedGoalProperty());*/
//model.currentGoalNodesProperty().bind(pc.currentGoalsProperty());
//model.currentGoalNodesProperty().bind(pc.goalsProperty());
//CustomTabPaneSkin skin = new CustomTabPaneSkin(scriptController);
//CustomTabPaneSkin skin = new CustomTabPaneSkin(scriptController);
}
}
//region Actions: Execution
//region Actions: Execution
...
@@ -330,7 +316,7 @@ public class DebuggerMainWindowController implements Initializable {
...
@@ -330,7 +316,7 @@ public class DebuggerMainWindowController implements Initializable {
}
}
}
}
p
rivate
void
openScript
(
String
code
,
ScriptArea
area
)
{
p
ublic
void
openScript
(
String
code
,
ScriptArea
area
)
{
model
.
setScriptFile
(
null
);
model
.
setScriptFile
(
null
);
if
(!
area
.
textProperty
().
getValue
().
isEmpty
())
{
if
(!
area
.
textProperty
().
getValue
().
isEmpty
())
{
area
.
deleteText
(
0
,
area
.
textProperty
().
getValue
().
length
());
area
.
deleteText
(
0
,
area
.
textProperty
().
getValue
().
length
());
...
@@ -342,8 +328,12 @@ public class DebuggerMainWindowController implements Initializable {
...
@@ -342,8 +328,12 @@ public class DebuggerMainWindowController implements Initializable {
@FXML
@FXML
protected
void
loadKeYFile
()
{
protected
void
loadKeYFile
()
{
File
keyFile
=
openFileChooserOpenDialog
(
"Select KeY File"
,
"KeY Files"
,
"key"
,
"script"
);
File
keyFile
=
openFileChooserOpenDialog
(
"Select KeY File"
,
"KeY Files"
,
"key"
,
"script"
);
this
.
model
.
setKeYFile
(
keyFile
);
openKeyFile
(
keyFile
);
}
public
void
openKeyFile
(
File
keyFile
)
{
if
(
keyFile
!=
null
)
{
if
(
keyFile
!=
null
)
{
this
.
model
.
setKeYFile
(
keyFile
);
Task
<
Void
>
task
=
facade
.
loadKeyFileTask
(
keyFile
);
Task
<
Void
>
task
=
facade
.
loadKeyFileTask
(
keyFile
);
task
.
setOnSucceeded
(
event
->
{
task
.
setOnSucceeded
(
event
->
{
statusBar
.
publishMessage
(
"Loaded key sourceName: %s"
,
keyFile
);
statusBar
.
publishMessage
(
"Loaded key sourceName: %s"
,
keyFile
);
...
@@ -373,6 +363,10 @@ public class DebuggerMainWindowController implements Initializable {
...
@@ -373,6 +363,10 @@ public class DebuggerMainWindowController implements Initializable {
@FXML
@FXML
protected
void
loadJavaFile
()
{
protected
void
loadJavaFile
()
{
File
javaFile
=
openFileChooserOpenDialog
(
"Select Java File"
,
"Java Files"
,
"java"
);
File
javaFile
=
openFileChooserOpenDialog
(
"Select Java File"
,
"Java Files"
,
"java"
);
openJavaFile
(
javaFile
);
}
public
void
openJavaFile
(
File
javaFile
)
{
if
(
javaFile
!=
null
)
{
if
(
javaFile
!=
null
)
{
model
.
setJavaFile
(
javaFile
);
model
.
setJavaFile
(
javaFile
);
contractLoaderService
.
start
();
contractLoaderService
.
start
();
...
@@ -389,7 +383,7 @@ public class DebuggerMainWindowController implements Initializable {
...
@@ -389,7 +383,7 @@ public class DebuggerMainWindowController implements Initializable {
*/
*/
private
File
openFileChooserSaveDialog
(
String
title
,
String
description
,
String
...
fileEndings
)
{
private
File
openFileChooserSaveDialog
(
String
title
,
String
description
,
String
...
fileEndings
)
{
FileChooser
fileChooser
=
getFileChooser
(
title
,
description
,
fileEndings
);
FileChooser
fileChooser
=
getFileChooser
(
title
,
description
,
fileEndings
);
// File sourceName = fileChooser.showSaveDialog(inspectionView
TabPane
.getInspectionViewTab().getGoalView().getScene().getWindow());
// File sourceName = fileChooser.showSaveDialog(inspectionView
sController
.getInspectionViewTab().getGoalView().getScene().getWindow());
File
file
=
fileChooser
.
showOpenDialog
(
statusBar
.
getScene
().
getWindow
());
File
file
=
fileChooser
.
showOpenDialog
(
statusBar
.
getScene
().
getWindow
());
if
(
file
!=
null
)
initialDirectory
=
file
.
getParentFile
();
if
(
file
!=
null
)
initialDirectory
=
file
.
getParentFile
();
return
file
;
return
file
;
...
@@ -397,7 +391,7 @@ public class DebuggerMainWindowController implements Initializable {
...
@@ -397,7 +391,7 @@ public class DebuggerMainWindowController implements Initializable {
private
File
openFileChooserOpenDialog
(
String
title
,
String
description
,
String
...
fileEndings
)
{
private
File
openFileChooserOpenDialog
(
String
title
,
String
description
,
String
...
fileEndings
)
{
FileChooser
fileChooser
=
getFileChooser
(
title
,
description
,
fileEndings
);
FileChooser
fileChooser
=
getFileChooser
(
title
,
description
,
fileEndings
);
//File sourceName = fileChooser.showOpenDialog(inspectionView
TabPane
.getInspectionViewTab().getGoalView().getScene().getWindow());
//File sourceName = fileChooser.showOpenDialog(inspectionView
sController
.getInspectionViewTab().getGoalView().getScene().getWindow());
File
file
=
fileChooser
.
showOpenDialog
(
statusBar
.
getScene
().
getWindow
());
File
file
=
fileChooser
.
showOpenDialog
(
statusBar
.
getScene
().
getWindow
());
if
(
file
!=
null
)
initialDirectory
=
file
.
getParentFile
();
if
(
file
!=
null
)
initialDirectory
=
file
.
getParentFile
();
return
file
;
return
file
;
...
@@ -458,13 +452,44 @@ public class DebuggerMainWindowController implements Initializable {
...
@@ -458,13 +452,44 @@ public class DebuggerMainWindowController implements Initializable {
//linenumberMainscript from model?
//linenumberMainscript from model?
//scriptController.getActiveScriptAreaTab().getScriptArea().removeHighlightStmt(lineNumberMainScript);
//scriptController.getActiveScriptAreaTab().getScriptArea().removeHighlightStmt(lineNumberMainScript);
//inspectionView
TabPane
.getInspectionViewTab.clear();
//inspectionView
sController
.getInspectionViewTab.clear();
}
}
public
void
newScript
(
ActionEvent
actionEvent
)
{
public
void
newScript
(
ActionEvent
actionEvent
)
{
scriptController
.
newScript
();
scriptController
.
newScript
();
}
}
public
void
showCodeDock
(
ActionEvent
actionEvent
)
{
if
(!
javaAreaDock
.
isDocked
())
{
javaAreaDock
.
dock
(
dockStation
,
DockPos
.
RIGHT
);
}
}
public
void
showWelcomeDock
(
ActionEvent
actionEvent
)
{
if
(!
welcomePaneDock
.
isDocked
())
{
welcomePaneDock
.
dock
(
dockStation
,
DockPos
.
CENTER
);
}
}
public
void
showActiveInspector
(
ActionEvent
actionEvent
)
{
if
(!
activeInspectorDock
.
isDocked
()
&&
!
activeInspectorDock
.
isFloating
())
{
activeInspectorDock
.
dock
(
dockStation
,
DockPos
.
CENTER
);
}
}
public
DockNode
getJavaAreaDock
()
{
return
javaAreaDock
;
}
public
DockNode
getWelcomePaneDock
()
{
return
welcomePaneDock
;
}
public
DockNode
getActiveInspectorDock
()
{
return
activeInspectorDock
;
}
public
class
ContractLoaderService
extends
Service
<
List
<
Contract
>>
{
public
class
ContractLoaderService
extends
Service
<
List
<
Contract
>>
{
@Override
@Override
protected
Task
<
List
<
Contract
>>
createTask
()
{
protected
Task
<
List
<
Contract
>>
createTask
()
{
...
...
src/main/java/edu/kit/formal/gui/controls/InspectionViewTab.java
View file @
ca4ce23b
package
edu.kit.formal.gui.controls
;
package
edu.kit.formal.gui.controls
;
import
de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon
;
import
de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView
;
import
de.uka.ilkd.key.logic.op.IProgramMethod
;
import
de.uka.ilkd.key.pp.ProgramPrinter
;
import
edu.kit.formal.gui.model.InspectionModel
;
import
edu.kit.formal.gui.model.InspectionModel
;
import
edu.kit.formal.gui.model.RootModel
;
import
edu.kit.formal.gui.model.RootModel
;
import
edu.kit.formal.interpreter.data.GoalNode
;
import
edu.kit.formal.interpreter.data.GoalNode
;
import
edu.kit.formal.interpreter.data.KeyData
;
import
edu.kit.formal.interpreter.data.KeyData
;
import
javafx.beans.Observable
;
import
javafx.beans.Observable
;
import
javafx.beans.property.BooleanProperty
;
import
javafx.beans.property.ObjectProperty
;
import
javafx.beans.property.ObjectProperty
;
import
javafx.beans.property.
SimpleBoolean
Property
;
import
javafx.beans.property.
ReadOnlyObject
Property
;
import
javafx.beans.property.SimpleObjectProperty
;
import
javafx.beans.property.SimpleObjectProperty
;
import
javafx.fxml.FXML
;
import
javafx.fxml.FXML
;
import
javafx.scene.Node
;
import
javafx.scene.Node
;
...
@@ -21,9 +16,6 @@ import javafx.scene.control.SplitPane;
...
@@ -21,9 +16,6 @@ import javafx.scene.control.SplitPane;
import
javafx.scene.input.MouseEvent
;
import
javafx.scene.input.MouseEvent
;
import
javafx.scene.layout.BorderPane
;
import
javafx.scene.layout.BorderPane
;
import
java.io.IOException
;
import
java.io.StringWriter
;
/**
/**
* Right part of the splitpane that displays the different parts of a state
* Right part of the splitpane that displays the different parts of a state
*
*
...
@@ -31,32 +23,43 @@ import java.io.StringWriter;
...
@@ -31,32 +23,43 @@ import java.io.StringWriter;
*/
*/
public
class
InspectionViewTab
extends
BorderPane
{
public
class
InspectionViewTab
extends
BorderPane
{
public
GoalOptionsMenu
goalOptionsMenu
=
new
GoalOptionsMenu
();
public
GoalOptionsMenu
goalOptionsMenu
=
new
GoalOptionsMenu
();
@FXML
private
SectionPane
sectionPaneJavaCode
;
@FXML
@FXML
private
SplitPane
lowerSplitPane
;
private
SplitPane
lowerSplitPane
;
@FXML
@FXML
private
SequentView
sequentView
;
private
SequentView
sequentView
;
@FXML
private
JavaArea
javaSourceCode
;
@FXML
private
ListView
goalView
;
private
ObjectProperty
<
Mode
>
mode
=
new
SimpleObjectProperty
<>();
@FXML
private
ListView
<
GoalNode
<
KeyData
>>
goalView
;
private
BooleanProperty
showCode
=
new
SimpleBooleanProperty
(
true
);
private
ObjectProperty
<
InspectionModel
>
model
=
new
SimpleObjectProperty
<>(
new
InspectionModel
()
);
public
InspectionViewTab
()
{
public
InspectionViewTab
()
{
super
();
super
();
Utils
.
createWithFXML
(
this
);
Utils
.
createWithFXML
(
this
);
getGoalView
().
getSelectionModel
().
selectedItemProperty
().
addListener
((
observable
,
oldValue
,
newValue
)
->
{
model
.
get
().
selectedGoalNodeToShowProperty
().
bind
(
if
(
newValue
!=
null
&&
newValue
.
getData
()
!=
null
)
{
goalView
.
getSelectionModel
().
selectedItemProperty
()
getSequentView
().
setNode
(
newValue
.
getData
().
getNode
());
);
}
});
model
.
get
().
selectedGoalNodeToShowProperty
().
addListener
(
(
observable
,
oldValue
,
newValue
)
->
{
goalView
.
getSelectionModel
().
select
(
newValue
);
if
(
newValue
!=
null
&&
newValue
.
getData
()
!=
null
)
{
getSequentView
().
setNode
(
newValue
.
getData
().
getNode
());
// TODO weigl: get marked lines of the program, and set it
model
.
get
().
highlightedJavaLinesProperty
().
get
()
.
clear
();
}
});
model
.
get
().
goalsProperty
().
bindBidirectional
(
goalView
.
itemsProperty
());
getGoalView
().
setCellFactory
(
GoalNodeListCell:
:
new
);
getGoalView
().
setCellFactory
(
GoalNodeListCell:
:
new
);
/*TODO redefine CSS bases on selected mode
mode.addListener(o -> {
mode.addListener(o -> {
getStyleClass().removeAll(
getStyleClass().removeAll(
Mode.DEAD.name(),
Mode.DEAD.name(),
...
@@ -64,34 +67,14 @@ public class InspectionViewTab extends BorderPane {
...
@@ -64,34 +67,14 @@ public class InspectionViewTab extends BorderPane {
Mode.POSTMORTEM.name()
Mode.POSTMORTEM.name()
);
);
getStyleClass().add(mode.get().name());
getStyleClass().add(mode.get().name());
if
(
mode
.
get
()
==
Mode
.
LIVING
)
{
MaterialDesignIconView
icon
=
new
MaterialDesignIconView
(
MaterialDesignIcon
.
RUN
);
setClosable
(
false
);
setGraphic
(
icon
);
}
else
{
setGraphic
(
null
);
setClosable
(
true
);
}
});
showCode
.
addListener
(
o
->
{
if
(
showCode
.
get
())
lowerSplitPane
.
getItems
().
add
(
sectionPaneJavaCode
);
else
lowerSplitPane
.
getItems
().
remove
(
sectionPaneJavaCode
);
});
});
showCode
.
set
(
false
);
*/
}
}
public
SequentView
getSequentView
()
{
public
SequentView
getSequentView
()
{
return
sequentView
;
return
sequentView
;
}
}
public
JavaArea
getJavaSourceCode
()
{
return
javaSourceCode
;
}
public
ListView
<
GoalNode
<
KeyData
>>
getGoalView
()
{
public
ListView
<
GoalNode
<
KeyData
>>
getGoalView
()
{
return
goalView
;
return
goalView
;
...
@@ -106,16 +89,8 @@ public class InspectionViewTab extends BorderPane {
...
@@ -106,16 +89,8 @@ public class InspectionViewTab extends BorderPane {
goalOptionsMenu
.
show
(
n
,
actionEvent
.
getScreenX
(),
actionEvent
.
getScreenY
());
goalOptionsMenu
.
show
(
n
,
actionEvent
.
getScreenX
(),
actionEvent
.
getScreenY
());
}
}
public
void
initialize
(
InspectionModel
model
)
{
System
.
out
.
println
(
"model"
);
}
public
void
refresh
(
RootModel
model
)
{
public
void
refresh
(
RootModel
model
)
{
IProgramMethod
method
=
(
IProgramMethod
)
model
.
getChosenContract
().
getTarget
();
/* IProgramMethod method = (IProgramMethod) model.getChosenContract().getTarget();
getJavaSourceCode
().
clear
();
getJavaSourceCode
().
getLineToClass
().
clear
();
//javaSourceCode.clear();
//javaSourceCode.getLineToClass().clear();
StringWriter writer = new StringWriter();
StringWriter writer = new StringWriter();
ProgramPrinter pp = new ProgramPrinter(writer);
ProgramPrinter pp = new ProgramPrinter(writer);
try {
try {
...
@@ -125,39 +100,10 @@ public class InspectionViewTab extends BorderPane {
...
@@ -125,39 +100,10 @@ public class InspectionViewTab extends BorderPane {
} catch (IOException e) {
} catch (IOException e) {
e.printStackTrace();
e.printStackTrace();
}
}
getJavaSourceCode
().
insertText
(
0
,
writer
.
toString
());
*/
// javaSourceCode.insertText(0, writer.toString());
}
}
public
Mode
getMode
()
{
return
mode
.
get
();
}
public
void
setMode
(
Mode
mode
)
{
this
.
mode
.
set
(
mode
);
}
public
ObjectProperty
<
Mode
>
modeProperty
()
{
return
mode
;
}
public
boolean
isShowCode
()
{
return
showCode
.
get
();
}
public
void
setShowCode
(
boolean
showCode
)
{
this
.
showCode
.
set
(
showCode
);
}
public
BooleanProperty
showCodeProperty
()
{
return
showCode
;
}
enum
Mode
{
LIVING
,
DEAD
,
POSTMORTEM
,
}
/**
/**
* Cells for GoalView
* Cells for GoalView
*/
*/
...
@@ -181,4 +127,12 @@ public class InspectionViewTab extends BorderPane {
...
@@ -181,4 +127,12 @@ public class InspectionViewTab extends BorderPane {
setText
(
text
);
setText
(
text
);
}
}
}
}
public
InspectionModel
getModel
()
{
return
model
.
get
();
}
public
ReadOnlyObjectProperty
<
InspectionModel
>
modelProperty
()
{
return
model
;
}
}
}
src/main/java/edu/kit/formal/gui/controls/InspectionView
TabPane
.java
→
src/main/java/edu/kit/formal/gui/controls/InspectionView
sController
.java
View file @
ca4ce23b
package
edu.kit.formal.gui.controls
;
package
edu.kit.formal.gui.controls
;
import
edu.kit.formal.gui.model.RootModel
;
import
edu.kit.formal.gui.model.RootModel
;
import
javafx.beans.property.SimpleMapProperty
;
import
javafx.collections.FXCollections
;
import
javafx.collections.ObservableMap
;
import
org.dockfx.DockNode
;
import
org.dockfx.DockNode
;
/**
/**
* TabPane on the right side of the GUI containing the inspection view as tabs
* TabPane on the right side of the GUI containing the inspection view as tabs
*/
*/
public
class
InspectionView
TabPane
{
public
class
InspectionView
sController
{
/**
/**
* active tab in which the interpreter resp. Debugger state is shown.
* active tab in which the interpreter resp. Debugger state is shown.
...
@@ -16,40 +19,19 @@ public class InspectionViewTabPane {
...
@@ -16,40 +19,19 @@ public class InspectionViewTabPane {
private
final
InspectionViewTab
activeInterpreterTab
=
new
InspectionViewTab
();
private
final
InspectionViewTab
activeInterpreterTab
=
new
InspectionViewTab
();
private
final
DockNode
activeInterpreterTabDock
=
new
DockNode
(
activeInterpreterTab
,
"Active"
);
private
final
DockNode
activeInterpreterTabDock
=
new
DockNode
(
activeInterpreterTab
,
"Active"
);
private
final
ObservableMap
<
InspectionViewTab
,
DockNode
>
inspectionViews
=
new
SimpleMapProperty
<>(
FXCollections
.
observableHashMap
());
public
InspectionViewTab
getActiveInspectionViewTab
()
{
public
InspectionViewTab
getActiveInspectionViewTab
()
{
return
this
.
activeInterpreterTab
;
return
this
.
activeInterpreterTab
;
}
}
public
DockNode
getActiveInterpreterTabDock
()
{
public
void
createNewInspectionViewTab
(
RootModel
model
,
boolean
activeTab
)
{
return
activeInterpreterTabDock
;
InspectionViewTab
tab
=
new
InspectionViewTab
();
if
(
activeTab
)
{
System
.
out
.
println
(
this
.
getActiveInspectionViewTab
()
==
null
);
this
.
setActiveInterpreterTab
(
tab
);
tab
.
setText
(
"Active Tab"
);
tab
.
setClosable
(
false
);
this
.
setActiveInterpreterTab
(
tab
);
}
model
.
chosenContractProperty
().
addListener
(
o
->
{
tab
.
refresh
(
model
);
});
bindGoalNodesWithCurrentTab
(
model
);
this
.
getTabs
().
add
(
tab
);
}
}
public
void
connectActiveView
(
RootModel
model
)
{
//TODO schauen wie Goallist ins model kommt
public
void
bindGoalNodesWithCurrentTab
(
RootModel
model
)
{
getActiveInspectionViewTab
().
getGoalView
().
itemsProperty
().
bind
(
model
.
currentGoalNodesProperty
());
getActiveInspectionViewTab
().
getGoalView
().
itemsProperty
().
bind
(
model
.
currentGoalNodesProperty
());
model
.
currentSelectedGoalNodeProperty
().
addListener
((
p
,
old
,
fresh
)
->
{