-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
663 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#Sun, 19 Jul 2020 17:51:38 +0200 | ||
#Fri, 24 Jul 2020 15:15:01 +0200 | ||
|
||
|
||
C\:\\Users\\lukak\\Documents\\NetBeansProjects\\AdminTools= |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import java.net.URL?> | ||
<?import javafx.geometry.Insets?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.control.PasswordField?> | ||
<?import javafx.scene.control.ProgressBar?> | ||
<?import javafx.scene.control.TextField?> | ||
<?import javafx.scene.effect.DropShadow?> | ||
<?import javafx.scene.layout.AnchorPane?> | ||
<?import javafx.scene.layout.StackPane?> | ||
<?import javafx.scene.paint.LinearGradient?> | ||
<?import javafx.scene.paint.Stop?> | ||
<?import javafx.scene.text.Font?> | ||
<?import javafx.scene.text.Text?> | ||
|
||
<AnchorPane id="AnchorPane" fx:id="rootPane" prefHeight="593.0" prefWidth="973.0" styleClass="imageBackground" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.251" fx:controller="rconclient.gui.LoginWindowController"> | ||
<stylesheets> | ||
<URL value="@Style.css" /> | ||
</stylesheets> | ||
<children> | ||
<AnchorPane prefHeight="71.0" prefWidth="973.0" styleClass="settingsTitlePane" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> | ||
<children> | ||
<Text layoutX="14.0" layoutY="51.0" strokeType="OUTSIDE" strokeWidth="0.0" styleClass="title" text="Login" /> | ||
</children> | ||
<effect> | ||
<DropShadow color="#00000081" /> | ||
</effect> | ||
</AnchorPane> | ||
<StackPane layoutX="6.0" layoutY="71.0" prefHeight="522.0" prefWidth="973.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="71.0"> | ||
<children> | ||
<AnchorPane fx:id="loginPane" maxHeight="-Infinity" maxWidth="-Infinity" opacity="0.9" prefHeight="290.0" prefWidth="441.0" styleClass="loginCenter" StackPane.alignment="CENTER"> | ||
<children> | ||
<Label layoutX="15.0" layoutY="87.0" styleClass="text" text="IP : " AnchorPane.leftAnchor="15.0" AnchorPane.topAnchor="87.0" /> | ||
<TextField fx:id="ip" layoutX="87.0" layoutY="83.0" prefHeight="29.0" prefWidth="245.0" styleClass="rconTextField" AnchorPane.leftAnchor="87.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="83.0" /> | ||
<Label layoutX="15.0" layoutY="137.0" styleClass="text" text="Port : " AnchorPane.leftAnchor="15.0" AnchorPane.topAnchor="137.0" /> | ||
<TextField fx:id="port" layoutX="87.0" layoutY="133.0" prefHeight="29.0" prefWidth="245.0" styleClass="rconTextField" AnchorPane.leftAnchor="87.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="133.0" /> | ||
<Label layoutX="15.0" layoutY="187.0" styleClass="text" text="Password : " AnchorPane.leftAnchor="15.0" AnchorPane.topAnchor="187.0" /> | ||
<PasswordField fx:id="password" layoutX="87.0" layoutY="183.0" prefHeight="29.0" prefWidth="245.0" styleClass="rconTextField" AnchorPane.leftAnchor="87.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="183.0" /> | ||
<Label fx:id="loginButton" layoutX="299.0" layoutY="488.0" onMouseClicked="#login" styleClass="labelButton" text="Log in" AnchorPane.bottomAnchor="14.0" AnchorPane.rightAnchor="14.0" /> | ||
<Text layoutX="104.0" layoutY="56.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Admin Tools"> | ||
<fill> | ||
<LinearGradient endX="1.0" endY="1.0" startY="1.0"> | ||
<stops> | ||
<Stop color="#38ff00" /> | ||
<Stop color="#0095ff" offset="1.0" /> | ||
</stops> | ||
</LinearGradient> | ||
</fill> | ||
<font> | ||
<Font size="39.0" /> | ||
</font> | ||
</Text> | ||
<ProgressBar fx:id="loginProgress" layoutX="16.0" layoutY="252.0" prefHeight="20.0" prefWidth="357.0" progress="0.0" /> | ||
<Label fx:id="loginInfo" layoutX="18.0" layoutY="229.0" styleClass="text" /> | ||
</children> | ||
<StackPane.margin> | ||
<Insets bottom="50.0" left="50.0" right="50.0" top="50.0" /> | ||
</StackPane.margin> | ||
</AnchorPane> | ||
</children> | ||
</StackPane> | ||
</children> | ||
</AnchorPane> |
Binary file not shown.
Binary file modified
BIN
+66 Bytes
(100%)
AdminTools/build/classes/rconclient/gui/RconWindowController.class
Binary file not shown.
Binary file modified
BIN
+1.13 KB
(120%)
AdminTools/build/classes/rconclient/gui/SettingsWindowController.class
Binary file not shown.
Binary file modified
BIN
+400 Bytes
(100%)
AdminTools/build/classes/rconclient/gui/StatusWindowController.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+1.01 KB
(150%)
AdminTools/build/classes/rconclient/util/WindowLoader.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import java.net.URL?> | ||
<?import javafx.geometry.Insets?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.control.PasswordField?> | ||
<?import javafx.scene.control.ProgressBar?> | ||
<?import javafx.scene.control.TextField?> | ||
<?import javafx.scene.effect.DropShadow?> | ||
<?import javafx.scene.layout.AnchorPane?> | ||
<?import javafx.scene.layout.StackPane?> | ||
<?import javafx.scene.paint.LinearGradient?> | ||
<?import javafx.scene.paint.Stop?> | ||
<?import javafx.scene.text.Font?> | ||
<?import javafx.scene.text.Text?> | ||
|
||
<AnchorPane id="AnchorPane" fx:id="rootPane" prefHeight="593.0" prefWidth="973.0" styleClass="imageBackground" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.251" fx:controller="rconclient.gui.LoginWindowController"> | ||
<stylesheets> | ||
<URL value="@Style.css" /> | ||
</stylesheets> | ||
<children> | ||
<AnchorPane prefHeight="71.0" prefWidth="973.0" styleClass="settingsTitlePane" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> | ||
<children> | ||
<Text layoutX="14.0" layoutY="51.0" strokeType="OUTSIDE" strokeWidth="0.0" styleClass="title" text="Login" /> | ||
</children> | ||
<effect> | ||
<DropShadow color="#00000081" /> | ||
</effect> | ||
</AnchorPane> | ||
<StackPane layoutX="6.0" layoutY="71.0" prefHeight="522.0" prefWidth="973.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="71.0"> | ||
<children> | ||
<AnchorPane fx:id="loginPane" maxHeight="-Infinity" maxWidth="-Infinity" opacity="0.9" prefHeight="290.0" prefWidth="441.0" styleClass="loginCenter" StackPane.alignment="CENTER"> | ||
<children> | ||
<Label layoutX="15.0" layoutY="87.0" styleClass="text" text="IP : " AnchorPane.leftAnchor="15.0" AnchorPane.topAnchor="87.0" /> | ||
<TextField fx:id="ip" layoutX="87.0" layoutY="83.0" prefHeight="29.0" prefWidth="245.0" styleClass="rconTextField" AnchorPane.leftAnchor="87.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="83.0" /> | ||
<Label layoutX="15.0" layoutY="137.0" styleClass="text" text="Port : " AnchorPane.leftAnchor="15.0" AnchorPane.topAnchor="137.0" /> | ||
<TextField fx:id="port" layoutX="87.0" layoutY="133.0" prefHeight="29.0" prefWidth="245.0" styleClass="rconTextField" AnchorPane.leftAnchor="87.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="133.0" /> | ||
<Label layoutX="15.0" layoutY="187.0" styleClass="text" text="Password : " AnchorPane.leftAnchor="15.0" AnchorPane.topAnchor="187.0" /> | ||
<PasswordField fx:id="password" layoutX="87.0" layoutY="183.0" prefHeight="29.0" prefWidth="245.0" styleClass="rconTextField" AnchorPane.leftAnchor="87.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="183.0" /> | ||
<Label fx:id="loginButton" layoutX="299.0" layoutY="488.0" onMouseClicked="#login" styleClass="labelButton" text="Log in" AnchorPane.bottomAnchor="14.0" AnchorPane.rightAnchor="14.0" /> | ||
<Text layoutX="104.0" layoutY="56.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Admin Tools"> | ||
<fill> | ||
<LinearGradient endX="1.0" endY="1.0" startY="1.0"> | ||
<stops> | ||
<Stop color="#38ff00" /> | ||
<Stop color="#0095ff" offset="1.0" /> | ||
</stops> | ||
</LinearGradient> | ||
</fill> | ||
<font> | ||
<Font size="39.0" /> | ||
</font> | ||
</Text> | ||
<ProgressBar fx:id="loginProgress" layoutX="16.0" layoutY="252.0" prefHeight="20.0" prefWidth="357.0" progress="0.0" /> | ||
<Label fx:id="loginInfo" layoutX="18.0" layoutY="229.0" styleClass="text" /> | ||
</children> | ||
<StackPane.margin> | ||
<Insets bottom="50.0" left="50.0" right="50.0" top="50.0" /> | ||
</StackPane.margin> | ||
</AnchorPane> | ||
</children> | ||
</StackPane> | ||
</children> | ||
</AnchorPane> |
144 changes: 144 additions & 0 deletions
144
AdminTools/src/rconclient/gui/LoginWindowController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package rconclient.gui; | ||
|
||
import java.io.IOException; | ||
import java.net.URL; | ||
import java.util.ArrayList; | ||
import java.util.Random; | ||
import java.util.ResourceBundle; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
import javafx.application.Platform; | ||
import javafx.fxml.FXML; | ||
import javafx.fxml.Initializable; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.control.PasswordField; | ||
import javafx.scene.control.ProgressBar; | ||
import javafx.scene.control.TextField; | ||
import javafx.scene.layout.AnchorPane; | ||
import net.kronos.rkon.core.ex.AuthenticationException; | ||
import rconclient.util.CustomRcon; | ||
import rconclient.util.Data; | ||
import rconclient.util.WindowLoader; | ||
import simplefxdialog.Dialog; | ||
import simplefxdialog.img.DialogImage; | ||
|
||
/** | ||
* FXML Controller class | ||
* | ||
* @author lukak | ||
*/ | ||
public class LoginWindowController implements Initializable { | ||
|
||
@FXML | ||
private AnchorPane rootPane; | ||
@FXML | ||
private TextField ip; | ||
@FXML | ||
private TextField port; | ||
@FXML | ||
private PasswordField password; | ||
@FXML | ||
private Label loginButton; | ||
@FXML | ||
private ProgressBar loginProgress; | ||
@FXML | ||
private Label loginInfo; | ||
@FXML | ||
private AnchorPane loginPane; | ||
|
||
/** | ||
* Initializes the controller class. | ||
*/ | ||
@Override | ||
public void initialize(URL url, ResourceBundle rb) { | ||
// TODO | ||
} | ||
|
||
@FXML | ||
private void login() { | ||
Thread loginThread = new Thread(() -> { | ||
Platform.runLater(() -> { | ||
loginPane.setDisable(true); | ||
loginProgress.setProgress(ProgressBar.INDETERMINATE_PROGRESS); | ||
loginInfo.setText("Starting up"); | ||
}); | ||
|
||
try { | ||
Thread.sleep(new Random().nextInt(200)); | ||
} catch (InterruptedException ex) { | ||
|
||
} | ||
|
||
Platform.runLater(() -> { | ||
loginInfo.setText("Connecting and autentificating"); | ||
}); | ||
|
||
boolean connected = true; | ||
try { | ||
CustomRcon rcon = CustomRcon.getInstance(ip.getText(), Integer.valueOf(port.getText()), password.getText().getBytes()); | ||
} catch (IOException ex) { | ||
connected = false; | ||
Platform.runLater(() -> { | ||
loginProgress.setProgress(0); | ||
loginInfo.setText(""); | ||
Dialog.okDialog(DialogImage.error, "Connnection Error", "Couldnt connect to server.\n Probably an incorect IP."); | ||
ip.setText(""); | ||
}); | ||
} catch (AuthenticationException ex) { | ||
connected = false; | ||
Platform.runLater(() -> { | ||
loginProgress.setProgress(0); | ||
loginInfo.setText(""); | ||
Dialog.okDialog(DialogImage.error, "Connnection Error", "Couldnt authenticate with server. \nIncorrect password."); | ||
password.setText(""); | ||
}); | ||
} catch (NumberFormatException ex) { | ||
connected = false; | ||
Platform.runLater(() -> { | ||
loginProgress.setProgress(0); | ||
loginInfo.setText(""); | ||
Dialog.okDialog(DialogImage.error, "Conversion error", "Port you specified is not a valid integer"); | ||
port.setText(""); | ||
}); | ||
} catch (Exception ex) { | ||
connected = false; | ||
Platform.runLater(() -> { | ||
loginProgress.setProgress(0); | ||
loginInfo.setText(""); | ||
Dialog.okDialog(DialogImage.error, "Error", "General exception\n" + ex.getMessage()); | ||
}); | ||
} | ||
|
||
loginPane.setDisable(false); | ||
|
||
if (connected) { | ||
Data.rconTextData = null; | ||
|
||
//Write to credentials | ||
ArrayList<String> props = Data.credentialsDefaults; | ||
|
||
props.set(0, ip.getText()); //set ip | ||
props.set(1, port.getText()); //set port | ||
props.set(2, password.getText()); //set password | ||
try { | ||
Data.writeCredentials(props); | ||
} catch (IOException ex) { | ||
|
||
} | ||
Data.refresh(); | ||
|
||
Platform.runLater(() -> { | ||
loginInfo.setText("Login successful"); | ||
loginProgress.setProgress(0); | ||
WindowLoader.loadRcon(rootPane); | ||
}); | ||
} | ||
}); | ||
loginThread.start(); | ||
} | ||
} |
Oops, something went wrong.