Commit 400269f0 authored by Alexander Weigl's avatar Alexander Weigl

interaction mode, undocking

parent b3b1128d
......@@ -26,7 +26,6 @@ import edu.kit.iti.formal.psdbg.interpreter.KeYProofFacade;
import edu.kit.iti.formal.psdbg.interpreter.KeyInterpreter;
import edu.kit.iti.formal.psdbg.interpreter.data.GoalNode;
import edu.kit.iti.formal.psdbg.interpreter.data.KeyData;
import edu.kit.iti.formal.psdbg.interpreter.data.State;
import edu.kit.iti.formal.psdbg.interpreter.dbg.*;
import edu.kit.iti.formal.psdbg.parser.ast.ProofScript;
import javafx.application.Platform;
......@@ -81,14 +80,10 @@ public class DebuggerMain implements Initializable {
protected static final Logger LOGGER = LogManager.getLogger(DebuggerMain.class);
public final ContractLoaderService contractLoaderService = new ContractLoaderService();
private InspectionViewsController inspectionViewsController;
private final ExecutorService executorService = Executors.newFixedThreadPool(2);
@Getter
private final DebuggerMainModel model = new DebuggerMainModel();
private InspectionViewsController inspectionViewsController;
private ScriptController scriptController;
@FXML
......@@ -128,7 +123,7 @@ public class DebuggerMain implements Initializable {
private CheckMenuItem miProofTree;
@FXML
private Button btnIM;
private ToggleButton btnIM;
private JavaArea javaArea = new JavaArea();
......@@ -289,9 +284,11 @@ public class DebuggerMain implements Initializable {
* @see {@link #handleStatePointer(PTreeNode)}
*/
private void handleStatePointerUI(PTreeNode<KeyData> node) {
if (node != null) {
getInspectionViewsController().getActiveInspectionViewTab().activate(node, node.getStateBeforeStmt());
scriptController.getDebugPositionHighlighter().highlight(node.getStatement());
}
}
private void marriageJavaCode() {
//Listener on chosenContract from
......@@ -501,10 +498,12 @@ public class DebuggerMain implements Initializable {
statusBar.publishSuccessMessage("Interpreter finished.");
btnIM.setDisable(false);
assert model.getDebuggerFramework() != null;
PTreeNode<KeyData> statePointer = model.getDebuggerFramework().getStatePointer();
btnIM.setSelected(true);
/*PTreeNode<KeyData> statePointer = model.getDebuggerFramework().getStatePointer();
assert statePointer!=null;
State<KeyData> lastState = statePointer.getStateAfterStmt();
getInspectionViewsController().getActiveInspectionViewTab().activate(statePointer, lastState);
*/
});
}
......@@ -858,11 +857,15 @@ public class DebuggerMain implements Initializable {
@FXML
public void interactiveMode(ActionEvent actionEvent) {
if (btnIM.isSelected()) {
interactiveModeController.stop();
} else {
interactiveModeController.setActivated(true);
interactiveModeController.start(getFacade().getProof(), getInspectionViewsController().getActiveInspectionViewTab().getModel());
}
}
}
@FXML
public void showWelcomeDock(ActionEvent actionEvent) {
if (!welcomePaneDock.isDocked() && !welcomePaneDock.isFloating()) {
......
......@@ -67,6 +67,7 @@ public class InteractiveModeController {
public void stop() {
Events.unregister(this);
String c = getCasesAsString();
scriptController.getDockNode(scriptArea).undock();
Events.fire(new Events.InsertAtTheEndOfMainScript(c));
}
......
......@@ -122,7 +122,7 @@ public class ScriptController {
return getDockNode(findEditor(filepath));
}
private DockNode getDockNode(ScriptArea editor) {
public DockNode getDockNode(ScriptArea editor) {
if (editor == null) {
return null;
}
......@@ -178,7 +178,7 @@ public class ScriptController {
if (lastScriptArea == null)
dockNode.dock(parent, DockPos.LEFT);
else
dockNode.dock(parent, DockPos.LEFT, getDockNode(lastScriptArea));
dockNode.dock(parent, DockPos.CENTER, getDockNode(lastScriptArea));
area.dirtyProperty().addListener(new ChangeListener<Boolean>() {
@Override
......
......@@ -9,6 +9,7 @@
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import org.dockfx.DockPane?>
<?import org.controlsfx.control.ToggleSwitch?>
<BorderPane xmlns:fx="http://javafx.com/fxml/1" fx:id="rootPane" xmlns="http://javafx.com/javafx/8.0.112"
fx:controller="edu.kit.iti.formal.psdbg.gui.controller.DebuggerMain"
prefWidth="1024" prefHeight="640">
......@@ -275,7 +276,7 @@
</tooltip>
</Button>
<Button fx:id="btnIM" onAction="#interactiveMode" disable="true">
<ToggleButton fx:id="btnIM" onAction="#interactiveMode" disable="true">
<!--disable="${! controller.debugMode}"-->
<graphic>
<MaterialDesignIconView glyphName="HAND_POINTING_RIGHT" size="24.0"/>
......@@ -283,7 +284,7 @@
<tooltip>
<Tooltip text="Start/Stop Interactive Mode"/>
</tooltip>
</Button>
</ToggleButton>
<Pane HBox.hgrow="ALWAYS"/>
<Label text="Windows:"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment