Compare commits
4 Commits
2147ca1ad8
...
4aafae9896
Author | SHA1 | Date | |
---|---|---|---|
4aafae9896 | |||
cb5982ef2d | |||
3848baddb6 | |||
057c4504d4 |
@ -126,7 +126,21 @@ public class MainController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void onSettingBtnClick(){
|
protected void onSettingBtnClick(){
|
||||||
|
try{
|
||||||
|
FXMLLoader fxmlLoader = new FXMLLoader(
|
||||||
|
MainApplication.class.getResource("option-view.fxml"));
|
||||||
|
Scene scene = new Scene(fxmlLoader.load(), 650, 650);
|
||||||
|
scene.getStylesheets().add(Objects.requireNonNull(
|
||||||
|
MainApplication.class.getResource("option-view.css")).toExternalForm());
|
||||||
|
Stage stage = new Stage();
|
||||||
|
stage.setTitle("Einstellungen");
|
||||||
|
stage.setScene(scene);
|
||||||
|
stage.initModality(Modality.APPLICATION_MODAL);
|
||||||
|
stage.setResizable(false);
|
||||||
|
stage.showAndWait();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onLogoutBtnClick(ActionEvent event){
|
protected void onLogoutBtnClick(ActionEvent event){
|
||||||
|
68
client/app/src/main/java/main/OptionController.java
Normal file
68
client/app/src/main/java/main/OptionController.java
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
package main;
|
||||||
|
|
||||||
|
import com.jfoenix.controls.*;
|
||||||
|
import javafx.collections.FXCollections;
|
||||||
|
import javafx.collections.ObservableList;
|
||||||
|
import javafx.event.ActionEvent;
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.fxml.FXMLLoader;
|
||||||
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
import javafx.stage.Modality;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class OptionController {
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public JFXButton updateUserBtn;
|
||||||
|
@FXML
|
||||||
|
public JFXButton deleteUserBtn;
|
||||||
|
@FXML
|
||||||
|
public JFXButton createUserBtn;
|
||||||
|
@FXML
|
||||||
|
public JFXToggleButton saveLoginTBtn;
|
||||||
|
@FXML
|
||||||
|
public Label labelError;
|
||||||
|
@FXML
|
||||||
|
public JFXComboBox<String> userCmb;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public void initialize(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onBackBtnClick(ActionEvent actionEvent) {
|
||||||
|
Stage stage = (Stage) ((Node) actionEvent.getSource()).getScene().getWindow();
|
||||||
|
stage.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCreateBtnClick(ActionEvent actionEvent) {
|
||||||
|
try{
|
||||||
|
FXMLLoader fxmlLoader = new FXMLLoader(
|
||||||
|
MainApplication.class.getResource("../users/create-user.fxml"));
|
||||||
|
Scene scene = new Scene(fxmlLoader.load(), 800, 650);
|
||||||
|
scene.getStylesheets().add(Objects.requireNonNull(
|
||||||
|
MainApplication.class.getResource("../users/create-user.css")).toExternalForm());
|
||||||
|
Stage stage = new Stage();
|
||||||
|
stage.setTitle("User erstellen");
|
||||||
|
stage.setScene(scene);
|
||||||
|
stage.initModality(Modality.APPLICATION_MODAL);
|
||||||
|
stage.setResizable(false);
|
||||||
|
stage.showAndWait();
|
||||||
|
Stage stageOld = (Stage) ((Node) actionEvent.getSource()).getScene().getWindow();
|
||||||
|
stageOld.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onUpdateBtnClick(ActionEvent actionEvent) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDeleteBtnClick(ActionEvent actionEvent) {
|
||||||
|
}
|
||||||
|
}
|
58
client/app/src/main/resources/main/option-view.css
Normal file
58
client/app/src/main/resources/main/option-view.css
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
GridPane{
|
||||||
|
-fx-background-color: #3E415F;
|
||||||
|
-fx-padding: 20px;
|
||||||
|
-fx-font-size: 20px;
|
||||||
|
-fx-font-family: Segoe UI;
|
||||||
|
|
||||||
|
-fx-border-insets: 1;
|
||||||
|
-fx-border-color: #B0B0B0;
|
||||||
|
-fx-border-style: solid;
|
||||||
|
-fx-border-width: 2;
|
||||||
|
-fx-effect: dropshadow(three-pass-box, rgba(100, 100, 100, 1), 24, 0.5, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Label{
|
||||||
|
-fx-text-fill: white;
|
||||||
|
-fx-max-width: 200px;
|
||||||
|
-fx-min-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mainLabel{
|
||||||
|
-fx-background-color: #8D99AE;
|
||||||
|
-fx-padding: 10px;
|
||||||
|
-fx-max-width: 200px;
|
||||||
|
-fx-min-width: 200px;
|
||||||
|
-fx-font-weight: bold;
|
||||||
|
-fx-alignment: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mainButton{
|
||||||
|
-fx-font-weight: bold;
|
||||||
|
-fx-background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
JFXButton{
|
||||||
|
-fx-background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#labelError{
|
||||||
|
-fx-font-weight: bold;
|
||||||
|
-fx-max-width: 1000px;
|
||||||
|
-fx-text-fill: #ff5555;
|
||||||
|
-fx-padding: 16px;
|
||||||
|
-fx-min-height: 140px;
|
||||||
|
-fx-max-height: 400px;
|
||||||
|
-fx-wrap-text: true;
|
||||||
|
-fx-font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comboBox{
|
||||||
|
-fx-background-color: white;
|
||||||
|
-fx-max-width: 200px;
|
||||||
|
-fx-min-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userBtn{
|
||||||
|
-fx-max-width: 200px;
|
||||||
|
-fx-min-width: 200px;
|
||||||
|
}
|
58
client/app/src/main/resources/main/option-view.fxml
Normal file
58
client/app/src/main/resources/main/option-view.fxml
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.control.*?>
|
||||||
|
<?import javafx.scene.layout.*?>
|
||||||
|
<?import com.jfoenix.controls.*?>
|
||||||
|
<?import javafx.collections.FXCollections?>
|
||||||
|
|
||||||
|
<GridPane xmlns="http://javafx.com/javafx"
|
||||||
|
xmlns:fx="http://javafx.com/fxml"
|
||||||
|
fx:controller="main.OptionController"
|
||||||
|
prefHeight="400.0" prefWidth="600.0">
|
||||||
|
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints minWidth="100"/>
|
||||||
|
<ColumnConstraints minWidth="100"/>
|
||||||
|
<ColumnConstraints minWidth="200"/>
|
||||||
|
<ColumnConstraints minWidth="100"/>
|
||||||
|
<ColumnConstraints minWidth="100"/>
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
</rowConstraints>
|
||||||
|
|
||||||
|
<Label styleClass="mainLabel" GridPane.columnIndex="2" GridPane.halignment="CENTER" >Einstellungen</Label>
|
||||||
|
|
||||||
|
<Label GridPane.columnIndex="1" GridPane.rowIndex="2" GridPane.halignment="CENTER">User:</Label>
|
||||||
|
<JFXComboBox styleClass="comboBox" fx:id="userCmb" GridPane.columnIndex="2" GridPane.rowIndex="2">
|
||||||
|
<items>
|
||||||
|
<FXCollections fx:factory="observableArrayList">
|
||||||
|
|
||||||
|
</FXCollections>
|
||||||
|
</items>
|
||||||
|
</JFXComboBox>
|
||||||
|
|
||||||
|
<JFXButton styleClass="userBtn" fx:id="updateUserBtn" GridPane.columnIndex="1" GridPane.columnSpan="3"
|
||||||
|
GridPane.rowIndex="4" GridPane.halignment="CENTER" onAction="#onUpdateBtnClick">User bearbeiten</JFXButton>
|
||||||
|
<JFXButton styleClass="userBtn" fx:id="deleteUserBtn" GridPane.columnIndex="1" GridPane.columnSpan="3"
|
||||||
|
GridPane.rowIndex="5" GridPane.halignment="CENTER" onAction="#onDeleteBtnClick">User löschen</JFXButton>
|
||||||
|
<JFXButton styleClass="userBtn" fx:id="createUserBtn" GridPane.columnIndex="1" GridPane.columnSpan="3"
|
||||||
|
GridPane.rowIndex="7" GridPane.halignment="CENTER" onAction="#onCreateBtnClick">User anlegen</JFXButton>
|
||||||
|
|
||||||
|
<Label styleClass="loginLbl" GridPane.columnIndex="1" GridPane.rowIndex="8"
|
||||||
|
GridPane.halignment="CENTER">Angemeldet bleiben:</Label>
|
||||||
|
<JFXToggleButton fx:id="saveLoginTBtn" GridPane.columnIndex="3" GridPane.rowIndex="8"/>
|
||||||
|
|
||||||
|
<Label fx:id="labelError" styleClass="errorMessage" GridPane.columnIndex="1" GridPane.rowIndex="9"/>
|
||||||
|
<JFXButton GridPane.columnIndex="4" GridPane.rowIndex="9" onAction="#onBackBtnClick">Zurück</JFXButton>
|
||||||
|
|
||||||
|
</GridPane>
|
44
client/data/src/main/java/res/User.java
Normal file
44
client/data/src/main/java/res/User.java
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
package res;
|
||||||
|
|
||||||
|
public class User {
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
private String loginName;
|
||||||
|
private String forename;
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public User(){
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLoginName() {
|
||||||
|
return loginName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoginName(String loginName) {
|
||||||
|
this.loginName = loginName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getForename() {
|
||||||
|
return forename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setForename(String forename) {
|
||||||
|
this.forename = forename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user