Complete rewrite/restructure of the project
This commit is contained in:
41
hellofx/app/build.gradle.kts
Normal file
41
hellofx/app/build.gradle.kts
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
plugins {
|
||||
id("application")
|
||||
id("org.openjfx.javafxplugin") version "0.0.10"
|
||||
}
|
||||
|
||||
javafx {
|
||||
version = "11"
|
||||
modules(
|
||||
"javafx.controls",
|
||||
"javafx.fxml"
|
||||
)
|
||||
}
|
||||
|
||||
application {
|
||||
mainClassName = "client.MainApplication"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":data"))
|
||||
}
|
||||
|
||||
val jar by tasks.getting(Jar::class) {
|
||||
manifest {
|
||||
attributes["Main-Class"] = "client.Launcher"
|
||||
}
|
||||
from({
|
||||
configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }
|
||||
})
|
||||
}
|
||||
|
||||
tasks.register("blabla", Copy::class) {
|
||||
group = "dasdas"
|
||||
dependsOn("clean")
|
||||
dependsOn("jar")
|
||||
|
||||
from("$buildDir/libs/app.jar")
|
||||
|
||||
mkdir("$buildDir/newShit/")
|
||||
into("$buildDir/newShit/")
|
||||
}
|
133
hellofx/app/build/resources/main/client/main-view.fxml
Normal file
133
hellofx/app/build/resources/main/client/main-view.fxml
Normal file
@@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<GridPane gridLinesVisible="true" style="-fx-background-color: #424242;"
|
||||
xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="client.MainController">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="NEVER" maxWidth="60.0" minWidth="60.0"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||
</rowConstraints>
|
||||
<VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0" spacing="5.0"
|
||||
style="-fx-background-color: #333333;">
|
||||
<ImageView fitHeight="50.0" fitWidth="50.0" pickOnBounds="true" preserveRatio="true">
|
||||
</ImageView>
|
||||
<Button mnemonicParsing="false" onAction="#onAddBtnClick" prefHeight="50" prefWidth="50"
|
||||
style="-fx-background-color: #424242;" text="ADD" textAlignment="CENTER" textFill="WHITE">
|
||||
<cursor>
|
||||
<Cursor fx:constant="HAND"/>
|
||||
</cursor>
|
||||
</Button>
|
||||
<Button mnemonicParsing="false" prefHeight="50" prefWidth="50" style="-fx-background-color: #424242;"
|
||||
textAlignment="CENTER" textFill="WHITE">
|
||||
ADD
|
||||
<cursor>
|
||||
<Cursor fx:constant="HAND"/>
|
||||
</cursor>
|
||||
</Button>
|
||||
<Button mnemonicParsing="false" prefHeight="50" prefWidth="50" style="-fx-background-color: #424242;"
|
||||
textAlignment="CENTER" textFill="WHITE">
|
||||
ADD
|
||||
<cursor>
|
||||
<Cursor fx:constant="HAND"/>
|
||||
</cursor>
|
||||
</Button>
|
||||
</VBox>
|
||||
<GridPane fx:id="calendarGrid" gridLinesVisible="true" GridPane.columnIndex="1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="25.0" minHeight="25.0" vgrow="NEVER"/>
|
||||
<RowConstraints maxHeight="25.0" minHeight="25.0" vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="ALWAYS"/>
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Label textFill="WHITE">
|
||||
Monat
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
|
||||
<Label textFill="WHITE" GridPane.columnIndex="0" GridPane.rowIndex="1">
|
||||
Mo
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label textFill="WHITE" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
Di
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label textFill="WHITE" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
||||
Mi
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label textFill="WHITE" GridPane.columnIndex="3" GridPane.rowIndex="1">
|
||||
Do
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label textFill="WHITE" GridPane.columnIndex="4" GridPane.rowIndex="1">
|
||||
Fr
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label textFill="WHITE" GridPane.columnIndex="5" GridPane.rowIndex="1">
|
||||
Sa
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label textFill="WHITE" GridPane.columnIndex="6" GridPane.rowIndex="1">
|
||||
So
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
|
||||
<VBox fx:id="vBoxMon" spacing="5.0" GridPane.columnIndex="0" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
<VBox fx:id="vBoxTue" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
<VBox fx:id="vBoxWen" spacing="5.0" GridPane.columnIndex="2" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
<VBox fx:id="vBoxThu" spacing="5.0" GridPane.columnIndex="3" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
<VBox fx:id="vBoxFri" spacing="5.0" GridPane.columnIndex="4" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
<VBox fx:id="vBoxSat" spacing="5.0" GridPane.columnIndex="5" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
<VBox fx:id="vBoxSun" spacing="5.0" GridPane.columnIndex="6" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
</children>
|
||||
</GridPane>
|
||||
</GridPane>
|
8
hellofx/app/src/main/java/client/Launcher.java
Normal file
8
hellofx/app/src/main/java/client/Launcher.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package client;
|
||||
|
||||
public class Launcher {
|
||||
|
||||
public static void main(String[] args) {
|
||||
MainApplication.main(args);
|
||||
}
|
||||
}
|
25
hellofx/app/src/main/java/client/MainApplication.java
Normal file
25
hellofx/app/src/main/java/client/MainApplication.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package client;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
import res.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class MainApplication extends Application {
|
||||
@Override
|
||||
public void start(Stage stage) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("main-view.fxml"));
|
||||
Scene scene = new Scene(fxmlLoader.load(), 1200, 800);
|
||||
stage.setTitle("Hello!");
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch();
|
||||
}
|
||||
}
|
43
hellofx/app/src/main/java/client/MainController.java
Normal file
43
hellofx/app/src/main/java/client/MainController.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package client;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.paint.Color;
|
||||
import res.Event;
|
||||
import res.RestController;
|
||||
|
||||
public class MainController {
|
||||
@FXML
|
||||
private GridPane calendarGrid;
|
||||
|
||||
@FXML
|
||||
private VBox vBoxMon;
|
||||
@FXML
|
||||
private VBox vBoxTue;
|
||||
@FXML
|
||||
private VBox vBoxWen;
|
||||
@FXML
|
||||
private VBox vBoxThu;
|
||||
@FXML
|
||||
private VBox vBoxFri;
|
||||
@FXML
|
||||
private VBox vBoxSat;
|
||||
@FXML
|
||||
private VBox vBoxSun;
|
||||
|
||||
|
||||
@FXML
|
||||
protected void onAddBtnClick(){
|
||||
RestController restController = new RestController();
|
||||
Event[] eventList = restController.getAllEvents();
|
||||
|
||||
for(Event event : eventList){
|
||||
Label label = new Label();
|
||||
label.setText(event.toString());
|
||||
label.setTextFill(Color.WHITE);
|
||||
vBoxWen.getChildren().add(label);
|
||||
}
|
||||
}
|
||||
}
|
131
hellofx/app/src/main/resources/client/main-view.fxml
Normal file
131
hellofx/app/src/main/resources/client/main-view.fxml
Normal file
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<GridPane gridLinesVisible="true" style="-fx-background-color: #424242;"
|
||||
xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="client.MainController">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="NEVER" maxWidth="60.0" minWidth="60.0"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||
</rowConstraints>
|
||||
<VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0" spacing="5.0"
|
||||
style="-fx-background-color: #333333;">
|
||||
<ImageView fitHeight="50.0" fitWidth="50.0" pickOnBounds="true" preserveRatio="true">
|
||||
</ImageView>
|
||||
<Button mnemonicParsing="false" onAction="#onAddBtnClick" prefHeight="50" prefWidth="50"
|
||||
style="-fx-background-color: #424242;" text="ADD" textAlignment="CENTER" textFill="WHITE">
|
||||
<cursor>
|
||||
<Cursor fx:constant="HAND"/>
|
||||
</cursor>
|
||||
</Button>
|
||||
<Button mnemonicParsing="false" prefHeight="50" prefWidth="50" style="-fx-background-color: #424242;"
|
||||
textAlignment="CENTER" textFill="WHITE">
|
||||
ADD
|
||||
<cursor>
|
||||
<Cursor fx:constant="HAND"/>
|
||||
</cursor>
|
||||
</Button>
|
||||
<Button mnemonicParsing="false" prefHeight="50" prefWidth="50" style="-fx-background-color: #424242;"
|
||||
textAlignment="CENTER" textFill="WHITE">
|
||||
ADD
|
||||
<cursor>
|
||||
<Cursor fx:constant="HAND"/>
|
||||
</cursor>
|
||||
</Button>
|
||||
</VBox>
|
||||
<GridPane fx:id="calendarGrid" gridLinesVisible="true" GridPane.columnIndex="1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="25.0" minHeight="25.0" vgrow="NEVER"/>
|
||||
<RowConstraints maxHeight="25.0" minHeight="25.0" vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="ALWAYS"/>
|
||||
</rowConstraints>
|
||||
<Label textFill="WHITE">
|
||||
Monat
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
|
||||
<Label textFill="WHITE" GridPane.columnIndex="0" GridPane.rowIndex="1">
|
||||
Mo
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label textFill="WHITE" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
Di
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label textFill="WHITE" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
||||
Mi
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label textFill="WHITE" GridPane.columnIndex="3" GridPane.rowIndex="1">
|
||||
Do
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label textFill="WHITE" GridPane.columnIndex="4" GridPane.rowIndex="1">
|
||||
Fr
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label textFill="WHITE" GridPane.columnIndex="5" GridPane.rowIndex="1">
|
||||
Sa
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
<Label textFill="WHITE" GridPane.columnIndex="6" GridPane.rowIndex="1">
|
||||
So
|
||||
<padding>
|
||||
<Insets left="5"/>
|
||||
</padding>
|
||||
</Label>
|
||||
|
||||
<VBox fx:id="vBoxMon" spacing="5.0" GridPane.columnIndex="0" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
<VBox fx:id="vBoxTue" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
<VBox fx:id="vBoxWen" spacing="5.0" GridPane.columnIndex="2" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
<VBox fx:id="vBoxThu" spacing="5.0" GridPane.columnIndex="3" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
<VBox fx:id="vBoxFri" spacing="5.0" GridPane.columnIndex="4" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
<VBox fx:id="vBoxSat" spacing="5.0" GridPane.columnIndex="5" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
<VBox fx:id="vBoxSun" spacing="5.0" GridPane.columnIndex="6" GridPane.rowIndex="2">
|
||||
|
||||
</VBox>
|
||||
</GridPane>
|
||||
</GridPane>
|
Reference in New Issue
Block a user