Commit a1064f96 authored by Alexander Weigl's avatar Alexander Weigl

welcome fm pane

parent 71831907
package edu.kit.iti.formal.psdbg.gui.controls;
import edu.kit.iti.formal.psdbg.examples.Examples;
import edu.kit.iti.formal.psdbg.gui.controller.DebuggerMain;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.layout.AnchorPane;
/**
* Welcome pane that allows for a more usable entry point
* Created by weigl on 7/7/17.
*/
public class WelcomePaneFMEdition extends AnchorPane {
private final DebuggerMain proofScriptDebugger;
public WelcomePaneFMEdition(DebuggerMain debugger) {
this.proofScriptDebugger = debugger;
Utils.createWithFXML(this);
}
/**
* Load the contraposition example
*
* @param event
*/
public void loadContraPosition(ActionEvent event) {
proofScriptDebugger.getWelcomePaneDock().close();
proofScriptDebugger.showActiveInspector(null);
Examples.loadExamples().forEach(example -> {
if (example.getName().equals("Contraposition"))
example.open(proofScriptDebugger);
});
/* proofScriptDebugger.openScript(
new File("")
);
proofScriptDebugger.openKeyFile(
new File("src/test/resources/edu/kit/formal/psdb/interpreter/contraposition/contraposition.key"));
*/
}
/**
* Load a test example
* @param event
*/
public void loadJavaTest(ActionEvent event) {
proofScriptDebugger.getWelcomePaneDock().close();
proofScriptDebugger.showActiveInspector(null);
}
/**
* Load teh help page documentation
* @param event
*/
public void loadHelpPage(ActionEvent event) {
proofScriptDebugger.getWelcomePaneDock().close();
proofScriptDebugger.showCommandHelp(event);
proofScriptDebugger.showHelpText();
}
/**
* Load a Java problem with an existing script
* @param event
*/
public void loadJavaProblem(ActionEvent event) {
proofScriptDebugger.getWelcomePaneDock().close();
proofScriptDebugger.showActiveInspector(null);
proofScriptDebugger.openJavaFile();
proofScriptDebugger.openScript();
}
public void loadNewScript(ActionEvent event) {
proofScriptDebugger.getWelcomePaneDock().close();
proofScriptDebugger.showActiveInspector(null);
proofScriptDebugger.getScriptController().newScript();
}
public void openScript(ActionEvent event) {
proofScriptDebugger.getWelcomePaneDock().close();
proofScriptDebugger.showActiveInspector(null);
proofScriptDebugger.openScript();
}
/**
* Load a Java File and an Empty Script
*
* @param event
*/
public void loadJavaProblemWithNewScript(ActionEvent event) {
proofScriptDebugger.getWelcomePaneDock().close();
proofScriptDebugger.showActiveInspector(null);
proofScriptDebugger.openJavaFile();
proofScriptDebugger.getScriptController().newScript();
}
@FXML
public void loadKeyProblem(ActionEvent event) {
proofScriptDebugger.getWelcomePaneDock().close();
proofScriptDebugger.showActiveInspector(event);
proofScriptDebugger.loadKeYFile();
proofScriptDebugger.getScriptController().newScript();
}
}
<?xml version="1.0" encoding="UTF-8"?>
<?import de.jensd.fx.glyphs.materialdesignicons.*?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.Font?>
<fx:root prefHeight="485.0" prefWidth="716.0" type="AnchorPane" xmlns="http://javafx.com/javafx/8.0.121"
xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label layoutX="14.0" layoutY="14.0" text="Welcome to the ProofScriptDebugger">
<font>
<Font size="24.0"/>
</font>
</Label>
<Label text="FM 2018 - Edition">
<font>
<Font size="20.0"/>
</font>
</Label>
<Label alignment="TOP_LEFT" layoutX="14.0" layoutY="71.0" prefHeight="129.0" prefWidth="573.0"
text="This application is the Proof Script debugger for the KeY system. It allows to perform proofs using a proof scripting language on top of the KeY system."
wrapText="true"/>
<HBox fillHeight="true" layoutX="117.0" layoutY="200.0"
maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"
spacing="25.0">
<padding>
<Insets bottom="25.0" left="25.0" right="25.0" top="25.0"/>
</padding>
</HBox>
<StackPane layoutX="-31.0" layoutY="180.0" prefHeight="195.0" prefWidth="621.0" AnchorPane.bottomAnchor="10"
AnchorPane.leftAnchor="-31.0" AnchorPane.rightAnchor="10">
<children>
<GridPane hgap="25.0" layoutX="13.0" layoutY="155.0" vgap="25.0" StackPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="1.7976931348623157E308" minHeight="50.0" prefHeight="30.0"
valignment="CENTER" vgrow="ALWAYS"/>
<RowConstraints maxHeight="1.7976931348623157E308" minHeight="50.0" prefHeight="30.0"
valignment="CENTER" vgrow="ALWAYS"/>
<RowConstraints maxHeight="1.7976931348623157E308" minHeight="50.0" prefHeight="30.0"
valignment="CENTER" vgrow="ALWAYS"/>
<RowConstraints maxHeight="1.7976931348623157E308" minHeight="50.0" prefHeight="30.0"
valignment="CENTER" vgrow="ALWAYS"/>
</rowConstraints>
<children>
<Button contentDisplay="TOP" maxWidth="1.7976931348623157E308" onAction="#loadNewScript"
text="New Script" GridPane.columnIndex="0" GridPane.rowIndex="0">
<graphic>
<MaterialDesignIconView glyphName="NEW_BOX" size="24"/>
</graphic>
</Button>
<Button contentDisplay="TOP" maxWidth="1.7976931348623157E308" onAction="#openScript"
text="Open Script..." GridPane.columnIndex="1" GridPane.rowIndex="0">
<graphic>
<MaterialDesignIconView glyphName="CODE" size="24"/>
</graphic>
</Button>
<Button contentDisplay="TOP" maxHeight="1.7976931348623157E308"
maxWidth="1.7976931348623157E308" onAction="#loadJavaProblem" text="Open Java..."
GridPane.columnIndex="2" GridPane.rowIndex="0">
<graphic>
<MaterialDesignIconView glyphName="BOOK_OPEN_VARIANT" size="24"/>
</graphic>
</Button>
<Button contentDisplay="TOP" maxHeight="1.7976931348623157E308"
maxWidth="1.7976931348623157E308" onAction="#loadKeyProblem" text="Open KeY Problem"
GridPane.columnIndex="3" GridPane.rowIndex="0">
<graphic>
<MaterialDesignIconView glyphName="BARCODE_SCAN" size="24"/>
</graphic>
</Button>
<Button contentDisplay="TOP" maxHeight="1.7976931348623157E308"
maxWidth="1.7976931348623157E308" onAction="#loadHelpPage" text="Introduction"
GridPane.columnIndex="3" GridPane.rowIndex="1">
<graphic>
<MaterialDesignIconView glyphName="HELP_CIRCLE" size="24"/>
</graphic>
</Button>
<Button contentDisplay="TOP" maxWidth="1.7976931348623157E308"
onAction="#loadJavaProblemWithNewScript" text="Java File with Empty Script"
GridPane.columnIndex="2" GridPane.rowIndex="1">
<graphic>
<MaterialDesignIconView glyphName="BOOK_OPEN" size="24"/>
</graphic>
</Button>
<!-- <Button contentDisplay="TOP" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"
onAction="#loadJavaTest" text="Java Test Example" GridPane.columnIndex="1" GridPane.rowIndex="1">
<graphic>
<MaterialDesignIconView glyphName="NEW_BOX" size="24" />
</graphic>
</Button>
<Button contentDisplay="TOP" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"
onAction="#loadContraPosition" text="Contraposition"
GridPane.columnIndex="0" GridPane.rowIndex="1">
<graphic>
<MaterialDesignIconView glyphName="NEW_BOX" size="24" />
</graphic>
</Button>
-->
</children>
<StackPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</StackPane.margin>
</GridPane>
</children>
</StackPane>
</children>
</fx:root>
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