diff --git a/src/main/java/app/admintools/gui/StatusWindowController.java b/src/main/java/app/admintools/gui/StatusWindowController.java index 012ad6a..ef122a0 100644 --- a/src/main/java/app/admintools/gui/StatusWindowController.java +++ b/src/main/java/app/admintools/gui/StatusWindowController.java @@ -9,6 +9,8 @@ import java.net.URL; import java.util.ArrayList; import java.util.ResourceBundle; + +import app.admintools.AdminTools; import javafx.application.Platform; import javafx.fxml.FXML; import javafx.fxml.Initializable; @@ -48,22 +50,6 @@ public class StatusWindowController implements Initializable { d-dot statusDot but shortened */ - @FXML - private Pane sd1; - @FXML - private Pane sd2; - @FXML - private Pane sd3; - @FXML - private Pane sd4; - @FXML - private Pane sd5; - @FXML - private Pane sd6; - @FXML - private Pane sd7; - @FXML - private ProgressBar pbApi; //For mc serv status @FXML @@ -84,7 +70,6 @@ public class StatusWindowController implements Initializable { @Override public void initialize(URL url, ResourceBundle rb) { tickMcRefresh(); - tickApi(); } @FXML @@ -102,63 +87,6 @@ private void loadHome() { WindowLoader.loadHome(rootPane); } - @FXML - public void handleMouseClick(MouseEvent arg0) { - System.out.println("clicked on " + sOnlinePlayers.getSelectionModel().getSelectedItem()); - } - - private void refreshApiStatus() { - //set progressbar to spin - pbApi.setProgress(ProgressBar.INDETERMINATE_PROGRESS); - Thread st = new Thread(() -> { //new thread worker - //Initilse array list - ArrayList arrStatus = new ArrayList(); - try { - arrStatus = ApiQuerry.querry(); //querry - } catch (IOException ex) { - AtLogger.logger.warning(AtLogger.formatException(ex)); - } - final ArrayList arrStatus_ = arrStatus; //final arraylist - Platform.runLater(() -> { - // - sd1.setStyle("-fx-background-color : " + arrStatus_.get(0) + ";"); - sd2.setStyle("-fx-background-color : " + arrStatus_.get(2) + ";"); - sd3.setStyle("-fx-background-color : " + arrStatus_.get(3) + ";"); - sd4.setStyle("-fx-background-color : " + arrStatus_.get(4) + ";"); - sd5.setStyle("-fx-background-color : " + arrStatus_.get(5) + ";"); - sd6.setStyle("-fx-background-color : " + arrStatus_.get(6) + ";"); - sd7.setStyle("-fx-background-color : " + arrStatus_.get(7) + ";"); - pbApi.setProgress(0); - }); - }); - st.start(); - } - - private void tickApi() { - Thread ratf = new Thread(() -> { - if (Data.isOnStatusWindow) { - Platform.runLater(() -> { - refreshApiStatus(); - }); - Data data = Data.getInstance(); - try { - int timeSleep = (int) data.getQuerryMojangApiRefreshRate() * 1000; - for (int i = 0; i < timeSleep / 500; i++) { - if (!Data.isOnStatusWindow) { - return; - } - Thread.sleep(500); - } - } catch (InterruptedException | IOException ex) { - AtLogger.logger.warning(AtLogger.formatException(ex)); - } - tickApi(); - } - }); - ratf.setName("ApiTick"); - ThreadManager.startThread(ratf, ThreadType.ASYNCJOB); - } - @FXML private void mcStatusRefresh() { Thread mcsr = new Thread(() -> { @@ -174,7 +102,7 @@ private void mcStatusRefresh() { if (data.getFavicon() != null) { sFavicon.setImage(QuerryUtils.convertToImage(data.getFavicon())); } else { - sFavicon.setImage(new Image(StatusWindowController.class.getResourceAsStream("/app/admintools/img/unknown_server.png"))); + sFavicon.setImage(new Image(AdminTools.class.getResourceAsStream("/img/unknown-server.png"))); } }); diff --git a/src/main/java/app/admintools/util/Version.java b/src/main/java/app/admintools/util/Version.java index 2a68ad3..6e85d43 100644 --- a/src/main/java/app/admintools/util/Version.java +++ b/src/main/java/app/admintools/util/Version.java @@ -5,13 +5,13 @@ import java.util.concurrent.atomic.AtomicInteger; public class Version { - private final String VERSION_NUMBER = "7.0.0"; + private final String VERSION_NUMBER = "7.1.0"; /** * Snapshot version, only used if isDevelopmentVersion is true * * Version number goes like 23d12m2020y001v . So its [Day Of Release]d[Month Of Release]m[Year Of Release]y[Snapshot Number]v */ - private final String SNAPSHOT_VER = "8d3m2021y001v"; + private final String SNAPSHOT_VER = "17d3m2022y000v"; private final boolean isDevelopmentVersion = false; private static Version instance = null; diff --git a/src/main/resources/gui/fxml/StatusWindow.fxml b/src/main/resources/gui/fxml/StatusWindow.fxml index 4d3bcbd..aab01ad 100644 --- a/src/main/resources/gui/fxml/StatusWindow.fxml +++ b/src/main/resources/gui/fxml/StatusWindow.fxml @@ -1,14 +1,11 @@ - - - @@ -24,35 +21,14 @@ - - - - - - + diff --git a/src/main/resources/img/unknown-server.png b/src/main/resources/img/unknown-server.png new file mode 100644 index 0000000..23372ec Binary files /dev/null and b/src/main/resources/img/unknown-server.png differ