Commit 0848a23c authored by Alexander Weigl's avatar Alexander Weigl

working on license window

parent 69a12418
Pipeline #17068 passed with stages
in 8 minutes and 50 seconds
......@@ -6,6 +6,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/license" isTestSource="false" generated="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
......
......@@ -41,11 +41,14 @@ import javafx.concurrent.Task;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.control.*;
import javafx.scene.layout.BorderPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.FileChooser;
import javafx.stage.Modality;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.antlr.v4.runtime.RecognitionException;
......@@ -452,6 +455,26 @@ public class DebuggerMain implements Initializable {
}
}
@FXML
public void showAbout(ActionEvent event) {
try {
BorderPane content = FXMLLoader.load(AboutDialog.class.getResource("AboutDialog.fxml"));
Dialog dialog = new Dialog();
DialogPane pane = new DialogPane();
pane.setContent(content);
pane.getButtonTypes().add(ButtonType.OK);
dialog.setDialogPane(pane);
dialog.initModality(Modality.APPLICATION_MODAL);
dialog.setWidth(800);
dialog.setHeight(600);
dialog.setResizable(true);
dialog.showAndWait();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Execute the script that with using the interpreter that is build using the interpreterbuilder
*
......@@ -505,7 +528,7 @@ public class DebuggerMain implements Initializable {
assert model.getDebuggerFramework() != null;
btnInteractiveMode.setSelected(false);
PTreeNode<KeyData> statePointer = model.getDebuggerFramework().getStatePointer();
assert statePointer!=null;
assert statePointer != null;
State<KeyData> lastState = statePointer.getStateAfterStmt();
getInspectionViewsController().getActiveInspectionViewTab().activate(statePointer, lastState);
......@@ -1140,6 +1163,7 @@ public class DebuggerMain implements Initializable {
}
public class ContractLoaderService extends Service<List<Contract>> {
@Override
protected void succeeded() {
......
package edu.kit.iti.formal.psdbg.gui.controls;
import edu.kit.iti.formal.psdbg.gui.ProofScriptDebugger;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.web.WebView;
import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ResourceBundle;
/**
* @author Alexander Weigl
* @version 1 (19.01.18)
*/
public class AboutDialog implements Initializable {
private StringProperty programName = new SimpleStringProperty();
private SimpleStringProperty version = new SimpleStringProperty();
private SimpleStringProperty subtitle = new SimpleStringProperty();
private SimpleStringProperty license = new SimpleStringProperty();
private SimpleStringProperty keyLicense = new SimpleStringProperty();
private SimpleStringProperty thridPartyLicense = new SimpleStringProperty();
private SimpleStringProperty aboutText = new SimpleStringProperty();
@FXML
private WebView webView;
@Override
public void initialize(URL location, ResourceBundle resources) {
setProgramName(ProofScriptDebugger.NAME);
setVersion(ProofScriptDebugger.VERSION);
setSubtitle("KeY Version: " + ProofScriptDebugger.KEY_VERSION);
try {
InputStream is = getClass().getResourceAsStream("/about.html");
if (is != null)
webView.getEngine().loadContent(IOUtils.toString(is,"utf-8"));
} catch (IOException e) {
e.printStackTrace();
}
try {
InputStream is = getClass().getResourceAsStream("/LICENSE");
if (is != null)
setLicense(IOUtils.toString(is, "utf-8"));
} catch (IOException e) {
e.printStackTrace();
}
try {
InputStream is = getClass().getResourceAsStream("/THIRD-PARTY.txt");
if (is != null)
setThridPartyLicense(IOUtils.toString(is, "utf-8"));
} catch (IOException e) {
e.printStackTrace();
}
}
public String getProgramName() {
return programName.get();
}
public void setProgramName(String programName) {
this.programName.set(programName);
}
public StringProperty programNameProperty() {
return programName;
}
public String getVersion() {
return version.get();
}
public void setVersion(String version) {
this.version.set(version);
}
public SimpleStringProperty versionProperty() {
return version;
}
public String getSubtitle() {
return subtitle.get();
}
public void setSubtitle(String subtitle) {
this.subtitle.set(subtitle);
}
public SimpleStringProperty subtitleProperty() {
return subtitle;
}
public String getLicense() {
return license.get();
}
public void setLicense(String license) {
this.license.set(license);
}
public SimpleStringProperty licenseProperty() {
return license;
}
public String getKeyLicense() {
return keyLicense.get();
}
public void setKeyLicense(String keyLicense) {
this.keyLicense.set(keyLicense);
}
public SimpleStringProperty keyLicenseProperty() {
return keyLicense;
}
public String getThridPartyLicense() {
return thridPartyLicense.get();
}
public void setThridPartyLicense(String thridPartyLicense) {
this.thridPartyLicense.set(thridPartyLicense);
}
public SimpleStringProperty thridPartyLicenseProperty() {
return thridPartyLicense;
}
public String getAboutText() {
return aboutText.get();
}
public SimpleStringProperty aboutTextProperty() {
return aboutText;
}
public void setAboutText(String aboutText) {
this.aboutText.set(aboutText);
}
}
This diff is collapsed.
<html>
<head>
<style>
</style>
</head>
<body>
<h3>Licensed under GPLv3</h3>
<h3>Developed by:</h3>
<ul>
<li>Sarah Grebing</li>
<li>Alexander Weigl</li>
</ul>
<h3>Thanks to:</h3>
<ul>
<li>Lulu Luang</li>
<li>Mattias Ulbrich</li>
</ul>
</body>
</html>
\ No newline at end of file
......@@ -194,7 +194,7 @@
</Menu>
<Menu text="Help">
<items>
<MenuItem text="About"/>
<MenuItem text="About" onAction="#showAbout"/>
</items>
</Menu>
</menus>
......
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.web.WebView?>
<BorderPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.121"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="edu.kit.iti.formal.psdbg.gui.controls.AboutDialog">
<top>
<VBox spacing="10.0" style="-fx-background-color: white;">
<Label text="${controller.programName}">
<VBox.margin>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0"/>
</VBox.margin>
<font>
<Font name="System Bold" size="24.0"/>
</font>
</Label>
<Label text="${controller.subtitle}">
<VBox.margin>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0"/>
</VBox.margin>
<font>
<Font name="System Italic" size="18.0"/>
</font>
</Label>
<padding>
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0"/>
</padding>
<BorderPane.margin>
<Insets/>
</BorderPane.margin>
</VBox>
</top>
<center>
<TabPane prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="UNAVAILABLE"
BorderPane.alignment="CENTER">
<tabs>
<Tab text="About PSDBG">
<content>
<WebView fx:id="webView"></WebView>
</content>
</Tab>
<Tab text="License">
<content>
<TextArea text="${controller.license}"/>
</content>
</Tab>
<!--
<Tab text="KeY License">
<content>
<TextArea text="${controller.keyLicense}"/>
</content>
</Tab>
-->
<Tab text="Third Party License">
<content>
<TextArea text="${controller.thridPartyLicense}"/>
</content>
</Tab>
</tabs>
</TabPane>
</center>
</BorderPane>
......@@ -136,7 +136,11 @@ is published at [HVC 2017](http://rdcu.be/E4fF)
<li>PSDBG - <strong>Version 1.0-FM</strong>
<a href="~/releases/psdbg-1.0-fm.jar">psdbg-1.0-fm.jar</a>
<br>
Special Version for the tool paper at Formal Methods 2018.
Special Version for the tool paper at Formal Methods 2018.
Including examples and all dependencies.
<br>
<a href="https://www.gnu.org/licenses/gpl-3.0.txt">License: GPLv3</a>
<a href="THIRD_PARTIES/">Third Party Licenses</a>
</li>
</ul>
......
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