Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
10ab037
[refactor] Struktur
Jan 5, 2022
fd6d350
[test] Tests an Main angepasst
Jan 5, 2022
9e9e11d
[feat] Anfang der abstrakten GUI-Klasse
Jan 6, 2022
16bbc45
[style] unnecessary debug
Jan 6, 2022
2ad2b1a
[feat] Main Screen + MenuBar
Jan 6, 2022
732b86f
[chore] util version angepasst
Jan 7, 2022
0c1ff7f
[fix] util oopsies
Jan 7, 2022
cf630bd
[refactor] App zu LoginWindow umbenannt
Jan 8, 2022
a633201
[feat] LoginWindow done
Jan 8, 2022
76714d8
[Style] Min Breite und Höhe vom Fenster fest
Jan 8, 2022
1ae595c
[feat] MenuBar erstellt
Jan 8, 2022
f266dcc
[style] Kommentar geändert
Jan 8, 2022
78eb796
[fix] OnAction von setUrl vorerst rausgenommen
Jan 8, 2022
a402cbc
[fix] Ergänzung zum vorherigen + Basic Function...
Jan 8, 2022
dc58b41
[feat] FunctionChooser Overlay done
Jan 8, 2022
e4db72c
Merge branch 'main' into gui
joshuajeschek Jan 8, 2022
41b306f
[feat] Log
Jan 8, 2022
18631c8
[feat] schönerer Login-Screen (finde ich)
Jan 8, 2022
ff2d0fb
[feat] Laderädchen hinzugefügt
Jan 8, 2022
c8bdec4
[docs] falscher Kommentar
Jan 8, 2022
3c19ee8
[feat] TrialSelector (activate by pressing ctrl+K)
Jan 8, 2022
b6b85d5
[fix] checkstyle TrialSelector
Jan 8, 2022
38a0baf
[feat] Analyzer
Jan 8, 2022
be13f9a
[fix] trialId -> trialIdComp
Jan 8, 2022
2c6127c
[refactor] dataBaseClient in Main gepackt
Jan 9, 2022
ca53435
[feat] login on enter
Jan 9, 2022
44b9c2b
[feat] aktueller Stand TrialSelector
Jan 9, 2022
a193ec6
[style] checkstyle
Jan 9, 2022
d9611d2
[refactor] initialize now returns controller
Jan 9, 2022
fbfc2f7
[feat] Änderung HeatmapConfig (Color)
Jan 9, 2022
85cc0cf
[feat] Konfiguration Heatmap Versuche
Jan 9, 2022
99f02cc
[style] checkstyle
Jan 9, 2022
86fbe49
[feat] added controller
Jan 9, 2022
22a8b4b
[fix] private -> protected
Jan 9, 2022
cd74255
[feat] Konfiguration Diagramm Versuche
Jan 9, 2022
2efa884
[test] value change
Jan 9, 2022
3c871f8
Merge branch 'main' into gui
Jan 10, 2022
128f3ee
[feat] database url stuff
Jan 10, 2022
f2eae8c
Merge branch 'main' into gui
Jan 11, 2022
18c41c1
[fix] debug stuff entfernt
Jan 11, 2022
a4d0b6c
[feat] pom JVM update
Jan 11, 2022
96bf9bc
[feat] aktueller Stand TrialSelector
Jan 11, 2022
98f5b5a
[feat] show current analyse-type
Jan 12, 2022
739654b
[fix] show icons in analyse-dialogs
Jan 12, 2022
a3f0f6b
[feat] error trial == comptrial
Jan 12, 2022
05ed839
[feat] toString Heatmap & Diagram Config
Jan 12, 2022
42ce1d7
[feat] back, export, rawexport buttons
Jan 12, 2022
92f5502
[chore] util upgrade
Jan 13, 2022
87450ea
[feat] TrialSelector fertig
Jan 13, 2022
b126a24
[style] unused variable
Jan 13, 2022
88ed7d5
[refactor] Sortierung
Jan 13, 2022
b6682e9
[fix] controller klassen
Jan 13, 2022
f55c7aa
[feat] TrialCreator-GUI
Jan 13, 2022
1a6ae8a
[fix] root persistence
Jan 14, 2022
f23c42d
[feat] Configurator Grundstruktur
Jan 14, 2022
e023534
[refactor] resources oopsies
Jan 14, 2022
bf3eee0
[feat] tactical retreat
Jan 14, 2022
09f7a96
[fix] Fenstergröße resized nur bei Login
Jan 15, 2022
052faca
[fix] configId always fixed
Jan 15, 2022
89a2f50
[feat] neuanordnung configurator
Jan 15, 2022
c5ada6f
[fix] sizing + debug removed
Jan 15, 2022
40e0186
[feat] reset analyse on log out
Jan 15, 2022
42dc912
Merge branch 'gui' of https://github.com/weichware10/analyse into gui
Jan 15, 2022
1675dc7
[style] checkstyle
Jan 15, 2022
3d3898c
[fix] reset everything
Jan 15, 2022
4ceb0ff
[fix] window resizing
Jan 15, 2022
ca84f3f
[fix] logsMenu
Jan 15, 2022
456dee4
[refactor] Log und AbsScene nach util verlegt
Jan 15, 2022
2a47710
[fix] smoll fix
Jan 15, 2022
4ac11f4
[refactor] deletion
Jan 15, 2022
279561e
[feat] delete temp folder
Jan 15, 2022
4b43319
[fix] util version
Jan 15, 2022
abd3fcd
[feat] javafx color to awt color converter
Jan 15, 2022
5ce7558
[refactor] delete Analyse method
Jan 15, 2022
fd2f61e
[feat] heatmap implemented
Jan 15, 2022
3f18645
[feat] ZoomMaps Heatmap
Jan 16, 2022
fc6b355
[feat] export function
Jan 16, 2022
8a92fc5
[refactor] depth calcs in analyse
Jan 16, 2022
529cca3
[feat] saveImage -> Analyse
Jan 16, 2022
9a9d4e2
[refactor] delete VerlaufTest
Jan 16, 2022
8bc01dc
[fix] saveImage from Analyse
Jan 16, 2022
b73381e
[feat] Verlauf Analyse & Export
Jan 16, 2022
c15879b
[fix] delete analyse: RELFRQIMGAREA
Jan 18, 2022
5f5844f
[fix] delete amountAreas from fxml
Jan 18, 2022
4bbfaf6
[feat] analysis result in pane + status label + rawExport + RELDEPTHD…
Jan 18, 2022
5e0adf6
[fix] x-Label unit fix & zm dots removed
Jan 18, 2022
73d237f
[feat] save heatmap in thread
Jan 18, 2022
6f99353
[fix] pane -> stackpane for alignment
Jan 18, 2022
349c209
[rework] heatmap
Jan 18, 2022
d058c17
Merge branch 'main' into analyse
Jan 18, 2022
18083be
Merge branch 'rework-heatmap' into analyse
Jan 18, 2022
0e13909
[feat] smoll things
Jan 18, 2022
397a211
[chore] update util version to v3.3
Jan 18, 2022
9832942
Merge branch 'main' into analyse
philipkbh Jan 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- shoutout to https://github.com/wiverson/maven-jpackage-template -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.github.weichware10</groupId>
Expand Down Expand Up @@ -75,12 +74,19 @@
<version>${javafx.version}</version>
<classifier>${platform}</classifier>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-swing -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>11-ea+24</version>
</dependency>


<!-- UTIL -->
<dependency>
<groupId>com.github.weichware10</groupId>
<artifactId>util</artifactId>
<version>v3.2</version>
<version>v3.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
<dependency>
Expand Down Expand Up @@ -306,15 +312,15 @@
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.3.0</version>
<configuration>
<!-- <repoToken></repoToken> -->
<!-- <repoToken></repoToken> -->
</configuration>
<dependencies>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.3</version>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.3</version>
</dependency>
</dependencies>
</dependencies>
</plugin>
<!-- UPDATE VERSION-->
<plugin>
Expand All @@ -334,7 +340,7 @@
<phase>validate</phase>
<configuration>
<target>
<mkdir dir="${platform}-javafx/javafx-jmods-${javafx.version}"/>
<mkdir dir="${platform}-javafx/javafx-jmods-${javafx.version}" />
<get src="https://raw.githubusercontent.com/weichware10/javafx-jmods/main/${platform}-javafx/javafx-jmods-${javafx.version}/javafx.base.jmod" dest="${platform}-javafx/javafx-jmods-${javafx.version}/javafx.base.jmod" skipexisting="true" />
<get src="https://raw.githubusercontent.com/weichware10/javafx-jmods/main/${platform}-javafx/javafx-jmods-${javafx.version}/javafx.controls.jmod" dest="${platform}-javafx/javafx-jmods-${javafx.version}/javafx.controls.jmod" skipexisting="true" />
<get src="https://raw.githubusercontent.com/weichware10/javafx-jmods/main/${platform}-javafx/javafx-jmods-${javafx.version}/javafx.fxml.jmod" dest="${platform}-javafx/javafx-jmods-${javafx.version}/javafx.fxml.jmod" skipexisting="true" />
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/github/weichware10/analyse/Main.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package github.weichware10.analyse;

import github.weichware10.analyse.gui.general.Login;
import github.weichware10.util.Files;
import github.weichware10.util.Logger;
import github.weichware10.util.db.DataBaseClient;
import github.weichware10.util.gui.Log;
Expand Down Expand Up @@ -33,6 +34,8 @@ public static void main(String[] args) {
String logfile = String.format(
Dotenv.load().get("LOGS") + "/%s.log", DateTime.now().toString("yMMdd-HHmmss"));
Logger.setLogfile(logfile);
// delete temp dir
Runtime.getRuntime().addShutdownHook(Files.deleteTempDir());
launch(args);
}

Expand Down
14 changes: 14 additions & 0 deletions src/main/java/github/weichware10/analyse/config/HeatmapConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,18 @@ public String toString() {
isGrid(),
isImage());
}

/**
* Konvertiert javafx Color in awt Color.
*
* @param color - javafx Color
* @return awt Color
*/
public static java.awt.Color fxToAwtColor(Color color) {
return new java.awt.Color(
(float) color.getRed(),
(float) color.getGreen(),
(float) color.getBlue(),
(float) color.getOpacity());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ public enum AnalyseType {
HEATPMAP,
COMPHEATMAP,
VERLAUF,
RELFRQIMGAREA,
VIEWTIMEDISTR
RELDEPTHDISTR
}

This file was deleted.

197 changes: 193 additions & 4 deletions src/main/java/github/weichware10/analyse/gui/analyse/Analyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,25 @@
import github.weichware10.analyse.config.HeatmapConfig;
import github.weichware10.analyse.enums.AnalyseType;
import github.weichware10.analyse.gui.general.MainMenuBar;
import github.weichware10.analyse.logic.Heatmap;
import github.weichware10.analyse.logic.Verlauf;
import github.weichware10.util.Logger;
import github.weichware10.util.data.TrialData;
import github.weichware10.util.gui.AbsScene;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javafx.application.Platform;
import javafx.embed.swing.SwingFXUtils;
import javafx.scene.Parent;
import javafx.scene.SnapshotParameters;
import javafx.scene.chart.LineChart;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.image.WritableImage;
import javafx.stage.FileChooser;
import javafx.stage.FileChooser.ExtensionFilter;
import javax.imageio.ImageIO;

/**
* Analysefenster der App.
Expand All @@ -22,6 +37,8 @@ public class Analyzer extends AbsScene {
private static TrialData trialComp;
private static HeatmapConfig hmConfig = new HeatmapConfig();
private static DiagramConfig diaConfig = new DiagramConfig();
private static String heatmapImage;
private static LineChart<Number, Number> verlaufLineChart;

/**
* Startet die App.
Expand Down Expand Up @@ -53,6 +70,12 @@ public static void setAnalyseType(AnalyseType analyseType) {
diaConfig = new DiagramConfig();

controller.errorLabel.setVisible(false);
controller.statusLabel.setVisible(false);
controller.exportButton.setDisable(true);
controller.exportRawButton.setDisable(true);
controller.analysePane.getChildren().clear();
heatmapImage = null;
verlaufLineChart = null;

if (Analyzer.analyseType != AnalyseType.COMPHEATMAP) {
trialComp = null;
Expand Down Expand Up @@ -83,9 +106,15 @@ public static void setTrialId() {
controller.analyseButton.setDisable(true);
controller.selectCompTrialButton.setVisible(false);
controller.analyseTypMenuButton.setText("Analyse-Typ");
controller.errorLabel.setVisible(false);
controller.statusLabel.setVisible(false);
controller.exportButton.setDisable(true);
controller.exportRawButton.setDisable(true);
controller.analysePane.getChildren().clear();
heatmapImage = null;
verlaufLineChart = null;
hmConfig = new HeatmapConfig();
diaConfig = new DiagramConfig();
controller.errorLabel.setVisible(false);
}
controller.analyseTypMenuButton.setDisable(false);
Logger.info("trialId set to " + trial.trialId);
Expand All @@ -104,7 +133,7 @@ public static void setTrialIdComp() {
} else {
controller.analyseButton.setDisable(true);
controller.errorLabel.setText(
"Trial und Vergleichs-Trial sind identisch. Wähle ein anderes Vergleichs-Trial!");
"Trial & Vergleichs-Trial sind identisch. Wähle ein anderes Vergleichs-Trial!");
Comment thread
philipkbh marked this conversation as resolved.
controller.errorLabel.setVisible(true);
}
}
Expand All @@ -113,12 +142,14 @@ public static void setTrialIdComp() {
* Setzt die Konfiguration für Heatmap bzw. Diagramm Analyse
*/
public static void setConfig() {
controller.errorLabel.setVisible(false);
controller.statusLabel.setVisible(false);

if (analyseType == AnalyseType.COMPHEATMAP
|| analyseType == AnalyseType.HEATPMAP) {
HeatmapConfigurator.start(hmConfig);
Logger.info("Start Heatmap Configurator");
} else if (analyseType == AnalyseType.RELFRQIMGAREA
|| analyseType == AnalyseType.VIEWTIMEDISTR) {
} else if (analyseType == AnalyseType.RELDEPTHDISTR) {
DiagramConfigurator.start(diaConfig, analyseType);
Logger.info("Start Diagram Configurator");
}
Expand All @@ -136,6 +167,157 @@ public static void analyse() {
hmConfig.toString(),
diaConfig.toString());
Logger.info(output);

controller.statusLabel.setVisible(false);

switch (analyseType) {
case HEATPMAP:
heatmapImage = Heatmap.createHeatmap(trial, hmConfig);
break;
case COMPHEATMAP:
heatmapImage = Heatmap.createHeatmapComp(trial, trialComp, hmConfig);
break;
case VERLAUF:
verlaufLineChart = Verlauf.createVerlauf(trial);
break;
case RELDEPTHDISTR:
break;
default:
// sollte niemals eintreten
break;
}
if (heatmapImage != null) {
// Pane leeren
controller.analysePane.getChildren().clear();

// ImageView mit Heatmap setzen
ImageView imageView = new ImageView(new Image(heatmapImage));
imageView.setFitWidth(680.0f);
imageView.setFitHeight(405.0f);
imageView.setPreserveRatio(true);
controller.analysePane.getChildren().addAll(imageView);

// Export aktivieren
controller.exportButton.setDisable(false);
controller.exportRawButton.setDisable(false);
} else if (verlaufLineChart != null) {
// Pane leeren
controller.analysePane.getChildren().clear();

// LineChart vom Verlauf setzen
controller.analysePane.getChildren().addAll(verlaufLineChart);

// Export aktivieren
controller.exportButton.setDisable(false);
controller.exportRawButton.setDisable(false);
}
}

/**
* Exportiert erstelltes Bild oder Diagramm.
*/
public static void export() {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Analyse Bild speichern unter");
fileChooser.getExtensionFilters().add(
new ExtensionFilter("PNG Image", "*.png"));

// Dateipfad als String speichern
String location = fileChooser.showSaveDialog(Main.primaryStage).getAbsolutePath();
if (location != null) {
if (analyseType.equals(AnalyseType.HEATPMAP)) {
Thread taskThread = new Thread(new Runnable() {
@Override
public void run() {
if (saveImage(location)) {
Platform.runLater(() -> controller.setExportStatus(
String.format("Bild unter %s gesepeichert", location)));
} else {
Platform.runLater(() -> controller.setExportStatus(
"Bild konnte nicht gespeichert werden"));
}
}
});
taskThread.start();
} else if (analyseType.equals(AnalyseType.VERLAUF)) {
if (saveAsPng(location)) {
controller.setExportStatus(String.format(
"Diagramm unter %s gesepeichert", location));
} else {
controller.setExportStatus("Diagramm konnte nicht gespeichert werden");
}
}
}
}

// TODO: in util verschieben?(ja -> analysedImage als Paramter dazu)
/**
* Speichert Bild unter location.
*
* @param location - Speicherort
* @return Erfolgsboolean
*/
private static boolean saveImage(String location) {
BufferedImage image = null;
try {
image = ImageIO.read(new File(heatmapImage));
ImageIO.write(image, "png", new File(location));
} catch (IOException e) {
Logger.error("Failed to save image", e, true);
return false;
}
Logger.info("Image saved: " + location);
return true;
}

// TODO: in util verschieben?
/**
* Speichert Diagramm als Bild unter location.
*
* @param location - Speicherort
* @return Erfolgsboolean
*/
private static boolean saveAsPng(String location) {
WritableImage image = controller.analysePane.snapshot(new SnapshotParameters(), null);

File file = new File(location);

try {
ImageIO.write(SwingFXUtils.fromFXImage(image, null), "png", file);
} catch (IOException e) {
Logger.error("Failed to save Snapshot", e, true);
return false;
}
return true;
}

/**
* Export von Raw-Daten des Versuchs.
*/
public static void exportRaw() {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Versuchs-Daten speichern unter");
fileChooser.getExtensionFilters().add(
new ExtensionFilter("JSON File", "*.json"));

// Dateipfad als String speichern und json laden
String location = fileChooser.showSaveDialog(Main.primaryStage).getAbsolutePath();
if (location != null) {
Thread taskThread = new Thread(new Runnable() {
@Override
public void run() {
if (TrialData.toJson(location, trial)) {
Platform.runLater(() -> controller.setExportStatus(
String.format("Versuchs-Daten unter %s gespeichert", location)));
} else {
Platform.runLater(() -> controller.setExportStatus(
"Versuchs-Daten konnten nicht gespeichert werden"));
}
}
});
taskThread.start();
}

}

/**
Expand All @@ -148,10 +330,17 @@ public static void reset() {
controller.exportButton.setDisable(true);
controller.exportRawButton.setDisable(true);
controller.selectCompTrialButton.setVisible(false);
controller.exportButton.setDisable(true);
controller.exportRawButton.setDisable(true);
controller.errorLabel.setVisible(false);
controller.statusLabel.setVisible(false);
controller.analysePane.getChildren().clear();
Analyzer.analyseType = null;
Analyzer.trial = null;
Analyzer.trialComp = null;
Analyzer.hmConfig = new HeatmapConfig();
Analyzer.diaConfig = new DiagramConfig();
Analyzer.heatmapImage = null;
Analyzer.verlaufLineChart = null;
}
}
Loading