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