VPR 11.12 1.Block
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
package de.subway_surfers.vpr_app;
|
||||
|
||||
import javafx.collections.ListChangeListener;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.layout.VBox;
|
||||
|
||||
public class AccounterstellungMitarbeiter {
|
||||
|
||||
private @FXML HBox kindanzeige;
|
||||
private @FXML GridPane kindDaten;
|
||||
private @FXML RadioButton typMitarbeiter;
|
||||
private @FXML RadioButton typEltern;
|
||||
private ToggleGroup accountTyp;
|
||||
|
||||
public void initialize() {
|
||||
accountTyp = new ToggleGroup();
|
||||
accountTyp.getToggles().add(typEltern);
|
||||
accountTyp.getToggles().add(typMitarbeiter);
|
||||
}
|
||||
|
||||
public void onZurueck(ActionEvent actionEvent) {
|
||||
VerwaltungApplication.sceneWechseln("hauptmenue_mitarbeiter-view.fxml");
|
||||
}
|
||||
|
||||
public void onAbmelden(ActionEvent actionEvent) {
|
||||
VerwaltungApplication.abmelden();
|
||||
}
|
||||
|
||||
public void onTypMitarbeiter(ActionEvent actionEvent) {
|
||||
kindDaten.getChildren().clear();
|
||||
}
|
||||
|
||||
public void onTypEltern(ActionEvent actionEvent) {
|
||||
Label ueberschrift = new Label();
|
||||
ueberschrift.setText("Daten des Kindes:");
|
||||
kindDaten.addRow(0);
|
||||
kindDaten.addColumn(0);
|
||||
kindDaten.addRow(1);
|
||||
kindDaten.add(ueberschrift,0,0);
|
||||
|
||||
kindDaten.addRow(1);
|
||||
Label name = new Label("Name:");
|
||||
kindDaten.add(name, 0, 1);
|
||||
TextField nameEingabe = new TextField();
|
||||
kindDaten.add(nameEingabe, 1, 1);
|
||||
|
||||
kindDaten.addRow(2);
|
||||
Label geburtstag = new Label("Geburtstag: ");
|
||||
kindDaten.add(geburtstag, 0, 2);
|
||||
DatePicker geburtstagEingabe = new DatePicker();
|
||||
kindDaten.add(geburtstagEingabe, 1, 2);
|
||||
|
||||
kindDaten.addRow(3);
|
||||
Button hinzufuegen = new Button("hinzufügen");
|
||||
kindDaten.add(hinzufuegen, 1, 3);
|
||||
|
||||
kindDaten.addRow(4);
|
||||
hinzufuegen.setOnAction(e -> {
|
||||
if (!nameEingabe.getText().equals("")) {
|
||||
Button neues = new Button(nameEingabe.getText());
|
||||
kindanzeige.getChildren().add(neues);
|
||||
neues.setOnAction(a -> {
|
||||
((HBox) neues.getParent()).getChildren().remove(neues);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@@ -3,7 +3,13 @@ package de.subway_surfers.vpr_app;
|
||||
import javafx.event.ActionEvent;
|
||||
|
||||
public class HauptmenueMitarbeiterView {
|
||||
|
||||
public void onAbmelden(ActionEvent actionEvent) {
|
||||
VerwaltungApplication.sceneWechseln("login-view.fxml");
|
||||
VerwaltungApplication.abmelden();
|
||||
}
|
||||
|
||||
public void onAccountAnlegen(ActionEvent actionEvent) {
|
||||
VerwaltungApplication.sceneWechseln("accounterstellung_mitarbeiter.fxml");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -105,7 +105,10 @@ public class VerwaltungApplication extends Application {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void abmelden() {
|
||||
sceneWechseln("login-view.fxml");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import java.lang.*?>
|
||||
<?import java.util.*?>
|
||||
<?import javafx.scene.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<BorderPane xmlns="http://javafx.com/javafx"
|
||||
xmlns:fx="http://javafx.com/fxml"
|
||||
fx:controller="de.subway_surfers.vpr_app.AccounterstellungMitarbeiter"
|
||||
prefHeight="400.0" prefWidth="600.0"
|
||||
stylesheets="@layout.css">
|
||||
|
||||
<top>
|
||||
<BorderPane styleClass="kopfzeile">
|
||||
<left>
|
||||
<Button text="Zurück" onAction="#onZurueck"/>
|
||||
</left>
|
||||
<right>
|
||||
<Button text="Abmelden" onAction="#onAbmelden"/>
|
||||
</right>
|
||||
</BorderPane>
|
||||
</top>
|
||||
<center>
|
||||
<BorderPane styleClass="main">
|
||||
<left>
|
||||
<VBox styleClass="accounterstellung_links">
|
||||
<GridPane styleClass="accounterstellung_daten">
|
||||
<Label text="Accountname:" GridPane.rowIndex="0" GridPane.columnIndex="0"/>
|
||||
<TextField GridPane.rowIndex="0" GridPane.columnIndex="1"/>
|
||||
<Label text="E-Mail:" GridPane.rowIndex="1" GridPane.columnIndex="0"/>
|
||||
<TextField GridPane.rowIndex="1" GridPane.columnIndex="1"/>
|
||||
<RadioButton fx:id="typMitarbeiter" onAction="#onTypMitarbeiter" text="Mitarbeiter" GridPane.rowIndex="2" GridPane.columnIndex="0"/>
|
||||
<RadioButton fx:id="typEltern" onAction="#onTypEltern" text="Eltern" GridPane.rowIndex="2" GridPane.columnIndex="1"/>
|
||||
</GridPane>
|
||||
<GridPane fx:id="kindDaten" styleClass="accounterstellung_daten"/>
|
||||
<HBox fx:id="kindanzeige"/>
|
||||
</VBox>
|
||||
</left>
|
||||
<right>
|
||||
<VBox>
|
||||
<Label text="Einmalpasswort: XXXXXXXX" />
|
||||
</VBox>
|
||||
</right>
|
||||
</BorderPane>
|
||||
</center>
|
||||
<bottom>
|
||||
<BorderPane>
|
||||
<right>
|
||||
<VBox styleClass="button-untenrechts">
|
||||
<Button text="Speichern"/>
|
||||
</VBox>
|
||||
</right>
|
||||
</BorderPane>
|
||||
</bottom>
|
||||
</BorderPane>
|
@@ -27,7 +27,7 @@
|
||||
<Button text="Alle Bestellungen anzeigen"/>
|
||||
<Button text="Rechnungen herunterladen"/>
|
||||
<Button text="Daten importieren/Exportieren"/>
|
||||
<Button text="Account anlegen"/>
|
||||
<Button text="Account anlegen" onAction="#onAccountAnlegen"/>
|
||||
</VBox>
|
||||
</left>
|
||||
<right>
|
||||
@@ -43,9 +43,4 @@
|
||||
</right>
|
||||
</BorderPane>
|
||||
</center>
|
||||
<right>
|
||||
<TilePane>
|
||||
|
||||
</TilePane>
|
||||
</right>
|
||||
</BorderPane>
|
||||
|
@@ -3,6 +3,9 @@
|
||||
-fx-font-size: 15;
|
||||
}
|
||||
|
||||
* {
|
||||
-fx-font-size: 15;
|
||||
}
|
||||
|
||||
|
||||
.kopfzeile{
|
||||
@@ -49,7 +52,7 @@
|
||||
-fx-pref-width: 200;
|
||||
}
|
||||
|
||||
.login_btn_anmelden {
|
||||
.button-untenrechts {
|
||||
-fx-padding: 20;
|
||||
}
|
||||
|
||||
@@ -61,3 +64,16 @@
|
||||
-fx-font-size: 30;
|
||||
}
|
||||
|
||||
.text-field {
|
||||
-fx-pref-width: 225;
|
||||
-fx-pref-height: 32;
|
||||
}
|
||||
|
||||
.accounterstellung_daten {
|
||||
-fx-vgap: 10;
|
||||
-fx-hgap: 10;
|
||||
}
|
||||
|
||||
.accounterstellung_links {
|
||||
-fx-spacing: 20;
|
||||
}
|
@@ -30,7 +30,7 @@
|
||||
<bottom>
|
||||
<BorderPane>
|
||||
<right>
|
||||
<VBox styleClass="login_btn_anmelden">
|
||||
<VBox styleClass="button-untenrechts">
|
||||
<Button text="Anmelden" onAction="#onAnmeldenClick"/>
|
||||
</VBox>
|
||||
|
||||
|
Reference in New Issue
Block a user