From 63ddd9e636e374bb3a3a3fe8a97ab26c6abc04c9 Mon Sep 17 00:00:00 2001
From: jwansek <eddie.atten.ea29@gmail.com>
Date: Mon, 29 Nov 2021 20:54:48 +0000
Subject: added hello world javafx program

---
 src/IDE/IDE/HelloApplication.java | 25 +++++++++++++++++++++++++
 src/IDE/IDE/HelloController.java  | 14 ++++++++++++++
 src/IDE/IDE/hello-view.fxml       | 16 ++++++++++++++++
 src/IDE/Makefile                  |  5 +++++
 src/IDE/readme.md                 | 19 +++++++++++++++++++
 5 files changed, 79 insertions(+)
 create mode 100644 src/IDE/IDE/HelloApplication.java
 create mode 100644 src/IDE/IDE/HelloController.java
 create mode 100644 src/IDE/IDE/hello-view.fxml
 create mode 100644 src/IDE/Makefile
 create mode 100644 src/IDE/readme.md

(limited to 'src/IDE')

diff --git a/src/IDE/IDE/HelloApplication.java b/src/IDE/IDE/HelloApplication.java
new file mode 100644
index 0000000..aaa728f
--- /dev/null
+++ b/src/IDE/IDE/HelloApplication.java
@@ -0,0 +1,25 @@
+package IDE;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Scene;
+import javafx.stage.Stage;
+import java.io.File;
+import javafx.scene.Parent;
+
+import java.io.IOException;
+
+public class HelloApplication extends Application {
+    @Override
+    public void start(Stage stage) throws IOException {
+        Parent root = FXMLLoader.load(getClass().getResource("hello-view.fxml"));
+        Scene scene = new Scene(root, 320, 240);
+        stage.setTitle("Hello!");
+        stage.setScene(scene);
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        launch();
+    }
+}
\ No newline at end of file
diff --git a/src/IDE/IDE/HelloController.java b/src/IDE/IDE/HelloController.java
new file mode 100644
index 0000000..877e5ba
--- /dev/null
+++ b/src/IDE/IDE/HelloController.java
@@ -0,0 +1,14 @@
+package IDE;
+
+import javafx.fxml.FXML;
+import javafx.scene.control.Label;
+
+public class HelloController {
+    @FXML
+    private Label welcomeText;
+
+    @FXML
+    protected void onHelloButtonClick() {
+        welcomeText.setText("Welcome to the FORTRAN compiler application!");
+    }
+}
\ No newline at end of file
diff --git a/src/IDE/IDE/hello-view.fxml b/src/IDE/IDE/hello-view.fxml
new file mode 100644
index 0000000..c31d9e2
--- /dev/null
+++ b/src/IDE/IDE/hello-view.fxml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.geometry.Insets?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.layout.VBox?>
+
+<?import javafx.scene.control.Button?>
+<VBox alignment="CENTER" spacing="20.0" xmlns:fx="http://javafx.com/fxml"
+      fx:controller="IDE.HelloController">
+    <padding>
+        <Insets bottom="20.0" left="20.0" right="20.0" top="20.0"/>
+    </padding>
+
+    <Label fx:id="welcomeText"/>
+    <Button text="Hello!" onAction="#onHelloButtonClick"/>
+</VBox>
diff --git a/src/IDE/Makefile b/src/IDE/Makefile
new file mode 100644
index 0000000..127db02
--- /dev/null
+++ b/src/IDE/Makefile
@@ -0,0 +1,5 @@
+all:
+	javac --module-path ../../../javafx-sdk-17.0.1/lib/ --add-modules javafx.controls,javafx.fxml ./IDE/*.java
+
+clean:
+	rm -vf IDE/*.class
diff --git a/src/IDE/readme.md b/src/IDE/readme.md
new file mode 100644
index 0000000..0dc9faa
--- /dev/null
+++ b/src/IDE/readme.md
@@ -0,0 +1,19 @@
+# esotericFORTRAN IDE
+
+## Setting Up
+
+Install FXML from [here](https://gluonhq.com/products/javafx/) and extract it in the directory behind `EsotericProject`
+
+## Running
+
+To compile, simply run `make`. Then to run:
+
+`java --module-path ..\..\..\javafx-sdk-17.0.1\lib\ --add-modules javafx.controls,javafx.fxml IDE.HelloApplication`
+
+## Editors?
+
+If you got intellisense and stuff to work in vscodium, well done, coz I couldn't do that :3
+
+### IntelliJ
+
+I hate IntelliJ but its the only way I could get a working intellisense. Right click on this folder and select 'Open Folder as an IntelliJ IDEA Community Edition Project', then follow [this](https://openjfx.io/openjfx-docs/#install-javafx) guide (select 'JavaFX and IntelliJ' in the website sidebar).
\ No newline at end of file
-- 
cgit v1.2.3