Adds various fixes to make the two java versions work as expected

Makes it possible to load a controller without generating a GUI, for better testing
Makes sure not to try and parse empty profile lines
Saves controller settings in a more readable and appendable format
Adds code for using the correct java version for the occasion
Adds a new function for writing to files
This commit is contained in:
2021-08-02 21:06:22 +02:00
parent 6ec44f1f92
commit f1eead3807
21 changed files with 350 additions and 136 deletions

View File

@ -1,13 +1,17 @@
package net.knarcraft.minecraftserverlauncher.userinterface;
import net.knarcraft.minecraftserverlauncher.Main;
import net.knarcraft.minecraftserverlauncher.profile.Controller;
import net.knarcraft.minecraftserverlauncher.profile.ServerLauncherController;
import net.knarcraft.minecraftserverlauncher.utility.CommonFunctions;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.io.InputStream;
@ -20,14 +24,14 @@ public class Tray {
private SystemTray tray;
private TrayIcon trayIcon;
private Controller controller;
private ServerLauncherGUI serverLauncherGUI;
private JFrame mainFrame;
private final ServerLauncherController controller;
private final ServerLauncherGUI serverLauncherGUI;
private final JFrame mainFrame;
/**
* Instantiates a new tray
*
* @param mainFrame <p>The main frame of the GUI</p>
* @param mainFrame <p>The main frame of the GUI</p>
* @param serverLauncherGUI <p>The server launcher GUI to use</p>
*/
public Tray(JFrame mainFrame, ServerLauncherGUI serverLauncherGUI) {