diff --git a/QuickLaunch/bin/basics/BasicGuiApp$1.class b/QuickLaunch/bin/basics/BasicGuiApp$1.class index c9c55f2..89a05e4 100644 Binary files a/QuickLaunch/bin/basics/BasicGuiApp$1.class and b/QuickLaunch/bin/basics/BasicGuiApp$1.class differ diff --git a/QuickLaunch/bin/guis/MainGui$1.class b/QuickLaunch/bin/guis/MainGui$1.class index 0049661..b7635d5 100644 Binary files a/QuickLaunch/bin/guis/MainGui$1.class and b/QuickLaunch/bin/guis/MainGui$1.class differ diff --git a/QuickLaunch/bin/guis/MainGui$2.class b/QuickLaunch/bin/guis/MainGui$2.class index 5477b9b..cd8cd4b 100644 Binary files a/QuickLaunch/bin/guis/MainGui$2.class and b/QuickLaunch/bin/guis/MainGui$2.class differ diff --git a/QuickLaunch/bin/guis/MainGui$3.class b/QuickLaunch/bin/guis/MainGui$3.class index 5d738af..15752b4 100644 Binary files a/QuickLaunch/bin/guis/MainGui$3.class and b/QuickLaunch/bin/guis/MainGui$3.class differ diff --git a/QuickLaunch/bin/guis/SettingGui$1.class b/QuickLaunch/bin/guis/SettingGui$1.class index 31921cc..23383ee 100644 Binary files a/QuickLaunch/bin/guis/SettingGui$1.class and b/QuickLaunch/bin/guis/SettingGui$1.class differ diff --git a/QuickLaunch/bin/guis/SettingGui$2.class b/QuickLaunch/bin/guis/SettingGui$2.class index 140b760..f99bc66 100644 Binary files a/QuickLaunch/bin/guis/SettingGui$2.class and b/QuickLaunch/bin/guis/SettingGui$2.class differ diff --git a/QuickLaunch/bin/guis/SettingGui$3.class b/QuickLaunch/bin/guis/SettingGui$3.class index b519814..97dd6fc 100644 Binary files a/QuickLaunch/bin/guis/SettingGui$3.class and b/QuickLaunch/bin/guis/SettingGui$3.class differ diff --git a/QuickLaunch/bin/main/KeyChecker$1.class b/QuickLaunch/bin/main/KeyChecker$1.class index 24cfc93..64788f1 100644 Binary files a/QuickLaunch/bin/main/KeyChecker$1.class and b/QuickLaunch/bin/main/KeyChecker$1.class differ diff --git a/QuickLaunch/bin/main/KeyChecker$2.class b/QuickLaunch/bin/main/KeyChecker$2.class index 6ea0d18..d6171ad 100644 Binary files a/QuickLaunch/bin/main/KeyChecker$2.class and b/QuickLaunch/bin/main/KeyChecker$2.class differ diff --git a/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$1$1.class b/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$1$1.class index ad2aed7..8284eb2 100644 Binary files a/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$1$1.class and b/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$1$1.class differ diff --git a/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$1.class b/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$1.class index 6f6b8ac..0e431ff 100644 Binary files a/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$1.class and b/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$1.class differ diff --git a/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$2.class b/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$2.class index b0861b6..8447731 100644 Binary files a/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$2.class and b/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$2.class differ diff --git a/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$3.class b/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$3.class index 154755f..89f99fc 100644 Binary files a/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$3.class and b/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$3.class differ diff --git a/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$4.class b/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$4.class index b561d3b..9dc083c 100644 Binary files a/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$4.class and b/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$4.class differ diff --git a/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$5.class b/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$5.class index d6bf914..e65109c 100644 Binary files a/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$5.class and b/QuickLaunch/bin/mod_quicklaunch/ShortcutWindow$5.class differ diff --git a/QuickLaunch/bin/update/UpdateChecker.class b/QuickLaunch/bin/update/UpdateChecker.class index 183a619..529ee17 100644 Binary files a/QuickLaunch/bin/update/UpdateChecker.class and b/QuickLaunch/bin/update/UpdateChecker.class differ diff --git a/QuickLaunch/settings.properties b/QuickLaunch/settings.properties index 2f6a4f2..92bb83f 100644 --- a/QuickLaunch/settings.properties +++ b/QuickLaunch/settings.properties @@ -1,5 +1,5 @@ -#Mon Apr 15 11:05:55 CEST 2019 -Load-File-on-startup=true -key2=44 -key1=29 -Check-for-updates-on-startup=true +#Thu Apr 18 14:02:07 CEST 2019 +Load-File-on-startup=true +key2=44 +key1=29 +Check-for-updates-on-startup=true diff --git a/QuickLaunch/src/update/UpdateChecker.java b/QuickLaunch/src/update/UpdateChecker.java index b135ce7..4b94a90 100644 --- a/QuickLaunch/src/update/UpdateChecker.java +++ b/QuickLaunch/src/update/UpdateChecker.java @@ -14,7 +14,7 @@ public class UpdateChecker { public void requestServerData(){ try { Socket socket = new Socket(); - socket.connect(new InetSocketAddress(InetAddress.getByName("cookiestudios.org"), 9999), 2000); + socket.connect(new InetSocketAddress(InetAddress.getByName(/*"cookiestudios.org"*/"localhost"), 9999), 2000); DataInputStream in = new DataInputStream(socket.getInputStream()); DataOutputStream out = new DataOutputStream(socket.getOutputStream()); diff --git a/QuickLaunchUpdateServer/bin/run/ServerThread.class b/QuickLaunchUpdateServer/bin/run/ServerThread.class deleted file mode 100644 index a3bca70..0000000 Binary files a/QuickLaunchUpdateServer/bin/run/ServerThread.class and /dev/null differ diff --git a/QuickLaunchUpdateServer/bin/run/Start.class b/QuickLaunchUpdateServer/bin/run/Start.class index 93ec466..5e19124 100644 Binary files a/QuickLaunchUpdateServer/bin/run/Start.class and b/QuickLaunchUpdateServer/bin/run/Start.class differ diff --git a/QuickLaunchUpdateServer/bin/run/UpdateThread.class b/QuickLaunchUpdateServer/bin/run/UpdateThread.class deleted file mode 100644 index 40c6bfc..0000000 Binary files a/QuickLaunchUpdateServer/bin/run/UpdateThread.class and /dev/null differ diff --git a/QuickLaunchUpdateServer/src/customNodes/LogTextArea.java b/QuickLaunchUpdateServer/src/customNodes/LogTextArea.java new file mode 100644 index 0000000..f517fe6 --- /dev/null +++ b/QuickLaunchUpdateServer/src/customNodes/LogTextArea.java @@ -0,0 +1,25 @@ +package customNodes; + +import javafx.geometry.Insets; +import javafx.scene.control.TextArea; + +public class LogTextArea extends TextArea{ + + private final int WIDTH = 500; + private final int HEIGHT = 515; + + public LogTextArea() { + this.setLayoutX(25); + this.setLayoutY(65); + this.setEditable(false); + this.setMinWidth(WIDTH); + this.setMaxWidth(WIDTH); + this.setPadding(new Insets(0,0,0,-10)); + this.setMinHeight(HEIGHT); + this.setMaxHeight(HEIGHT); + this.setStyle("-fx-background-color: transparent;" + + "-fx-control-inner-background: white;" + + "-fx-text-fill: black"); + } + +} diff --git a/QuickLaunchUpdateServer/src/customNodes/NewUpdateButton.java b/QuickLaunchUpdateServer/src/customNodes/NewUpdateButton.java new file mode 100644 index 0000000..d5e3cb6 --- /dev/null +++ b/QuickLaunchUpdateServer/src/customNodes/NewUpdateButton.java @@ -0,0 +1,16 @@ +package customNodes; + +import javafx.scene.control.Button; +import javafx.scene.paint.Color; + +public class NewUpdateButton extends Button{ + + public NewUpdateButton(String text) { + this.setText(text); + this.setLayoutX(550); + this.setLayoutY(400); + this.setTextFill(Color.WHITE); + this.setStyle("-fx-background-color: blue"); + } + +} diff --git a/QuickLaunchUpdateServer/src/data/ServerData.java b/QuickLaunchUpdateServer/src/data/ServerData.java new file mode 100644 index 0000000..a46e42a --- /dev/null +++ b/QuickLaunchUpdateServer/src/data/ServerData.java @@ -0,0 +1,5 @@ +package data; + +public class ServerData { + public static float version = 0.0f; +} diff --git a/QuickLaunchUpdateServer/src/run/ServerThread.java b/QuickLaunchUpdateServer/src/network/ServerThread.java similarity index 70% rename from QuickLaunchUpdateServer/src/run/ServerThread.java rename to QuickLaunchUpdateServer/src/network/ServerThread.java index ff0ae22..f6001ea 100644 --- a/QuickLaunchUpdateServer/src/run/ServerThread.java +++ b/QuickLaunchUpdateServer/src/network/ServerThread.java @@ -1,20 +1,26 @@ -package run; +package network; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; -import run.Start; + +import scenes.LogScene; public class ServerThread implements Runnable { - int PORT; - - public ServerThread(int port) { - this.PORT = port; + + private final int PORT = 9999; + public static float version = -1.0f; + + LogScene display; + + public ServerThread(LogScene scene) { + display = scene; } + ServerSocket ses; Socket s; DataOutputStream out; @@ -29,8 +35,11 @@ implements Runnable { System.out.println("Connected with: " + s.getInetAddress()); out = new DataOutputStream(s.getOutputStream()); in = new DataInputStream(s.getInputStream()); - System.out.println(in.readUTF()); - out.writeUTF("VERSION="+Start.version); + String data = in.readUTF(); + display.appendText(data); + System.out.println(data); + + out.writeUTF("VERSION="+version); out.close(); in.close(); diff --git a/QuickLaunchUpdateServer/src/run/Start.java b/QuickLaunchUpdateServer/src/run/Start.java index 1b00598..801cc99 100644 --- a/QuickLaunchUpdateServer/src/run/Start.java +++ b/QuickLaunchUpdateServer/src/run/Start.java @@ -1,23 +1,12 @@ package run; -import javax.swing.JOptionPane; -import run.ServerThread; -import run.UpdateThread; +import javafx.application.Application; +import stages.AppStage; public class Start { - public static float version = -1.0f; - - private static final int PORT = 9999; public static void main(String[] args) { - - version = Float.parseFloat(JOptionPane.showInputDialog("QuickLaunch version:")); - Thread ut = new Thread(new UpdateThread()); - ut.start(); - System.out.println("Update thread started"); - Thread st = new Thread(new ServerThread(PORT)); - st.start(); - System.out.println("Server listening"); + Application.launch(AppStage.class); } } \ No newline at end of file diff --git a/QuickLaunchUpdateServer/src/run/UpdateThread.java b/QuickLaunchUpdateServer/src/run/UpdateThread.java deleted file mode 100644 index 9330ff3..0000000 --- a/QuickLaunchUpdateServer/src/run/UpdateThread.java +++ /dev/null @@ -1,14 +0,0 @@ -package run; - -import javax.swing.JOptionPane; -import run.Start; - -public class UpdateThread -implements Runnable { - @Override - public void run() { - do { - Start.version = Float.parseFloat(JOptionPane.showInputDialog("QuickLaunch version (" + Start.version + "): ")); - } while (true); - } -} \ No newline at end of file diff --git a/QuickLaunchUpdateServer/src/scenes/LogScene.java b/QuickLaunchUpdateServer/src/scenes/LogScene.java new file mode 100644 index 0000000..2eaee54 --- /dev/null +++ b/QuickLaunchUpdateServer/src/scenes/LogScene.java @@ -0,0 +1,78 @@ +package scenes; + +import java.util.Optional; + +import data.ServerData; +import customNodes.LogTextArea; +import customNodes.NewUpdateButton; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.geometry.Side; +import javafx.scene.chart.PieChart; +import javafx.scene.chart.PieChart.Data; +import javafx.scene.control.TextInputDialog; +import javafx.scene.layout.AnchorPane; +import javafx.stage.Stage; + +public class LogScene extends AnchorPane{ + private NewUpdateButton mNewUpdate; + private LogTextArea mLogView; + private ObservableList pieChartData; + + + public LogScene(Stage primaryStage) { + + this.setPrefWidth(800); + this.setPrefHeight(600); + this.setMaxHeight(600); + + mNewUpdate = new NewUpdateButton("New update"); + mNewUpdate.setOnAction(new EventHandler() { + + + public void handle(ActionEvent event) { + TextInputDialog dialog = new TextInputDialog(); + dialog.setTitle("Create new update"); + dialog.setHeaderText("Realese new Update"); + dialog.setContentText("New version:"); + + Optional result = dialog.showAndWait(); + if (result.isPresent()){ + ServerData.version = Float.parseFloat(result.get()); + } + } + }); + + mLogView = new LogTextArea(); + pieChartData = + FXCollections.observableArrayList( + new PieChart.Data("Win 7", 0), + new PieChart.Data("Win 10", 0), + new PieChart.Data("Linux", 0)); + final PieChart chart = new PieChart(pieChartData); + chart.setLayoutX(500); + chart.setLayoutY(35); + chart.setMaxHeight(200); + chart.setMaxWidth(300); + chart.setLabelsVisible(true); + chart.setLegendSide(Side.RIGHT); + chart.setLabelLineLength(10); + chart.setStyle("-fx-font-size: 8pt"); + this.getChildren().add(mNewUpdate); + this.getChildren().add(mLogView); + this.getChildren().add(chart); + } + + public void appendText(String text) { + for(Data d : pieChartData) { + if(d.getName().equals("Linux")) { + d.setPieValue(d.getPieValue()+1); + } + } + mLogView.appendText(text+"\n"); + } + + +} diff --git a/QuickLaunchUpdateServer/src/stages/AppStage.java b/QuickLaunchUpdateServer/src/stages/AppStage.java new file mode 100644 index 0000000..b7f8834 --- /dev/null +++ b/QuickLaunchUpdateServer/src/stages/AppStage.java @@ -0,0 +1,25 @@ +package stages; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.stage.Stage; +import network.ServerThread; +import scenes.LogScene; + +public class AppStage extends Application{ + + + public void start(Stage primaryStage) throws Exception { + primaryStage.setOnCloseRequest(event -> { + System.exit(0); + }); + LogScene ls = new LogScene(primaryStage); + Thread st = new Thread(new ServerThread(ls)); + st.start(); + primaryStage.setScene(new Scene(ls)); + primaryStage.setResizable(false); + primaryStage.show(); + + } + +}