Compare commits
3 Commits
refactor
...
d574849407
| Author | SHA1 | Date | |
|---|---|---|---|
| d574849407 | |||
| da24f73f46 | |||
| 0296333733 |
@@ -15,10 +15,18 @@ public class MainApplication extends Application {
|
||||
|
||||
Scene scene = new Scene(fxmlLoader.load(), 1200, 700);
|
||||
scene.getStylesheets().add(Objects.requireNonNull(MainApplication.class.getResource("main-view.css")).toExternalForm());
|
||||
stage.setTitle("Hello!");
|
||||
stage.setTitle("SharePlaner");
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
|
||||
FXMLLoader fxmlLoaderLogin = new FXMLLoader(MainApplication.class.getResource("../users/login.fxml"));
|
||||
Scene sceneLogin = new Scene(fxmlLoaderLogin.load(), 650, 500);
|
||||
sceneLogin.getStylesheets().add(Objects.requireNonNull(MainApplication.class.getResource("../users/login.css")).toExternalForm());
|
||||
Stage stageLogin = new Stage();
|
||||
stageLogin.setTitle("Anmelden");
|
||||
stageLogin.setScene(sceneLogin);
|
||||
stageLogin.show();
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package main;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.geometry.Pos;
|
||||
@@ -76,8 +78,7 @@ public class MainController {
|
||||
stage.setResizable(false);
|
||||
//stage.initStyle(StageStyle.UNDECORATED);
|
||||
stage.showAndWait();
|
||||
}
|
||||
catch (IOException e){
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
updateEvents();
|
||||
@@ -133,8 +134,12 @@ public class MainController {
|
||||
Label nameLabel = new Label(event.getName());
|
||||
vBox.getChildren().add(nameLabel);
|
||||
|
||||
Label timeLabel = new Label(event.getStart() + "-" + event.getEnd());
|
||||
if (event.getStart() != null || event.getEnd() != null) {
|
||||
String timeStr = (event.getStart() != null ? formatTime(event.getStart()) : "")
|
||||
+ (event.getEnd() != null ? " - " + formatTime(event.getEnd()) : "");
|
||||
Label timeLabel = new Label(timeStr);
|
||||
vBox.getChildren().add(timeLabel);
|
||||
}
|
||||
|
||||
Label typeLabel = new Label("Wer: " + event.getOwnerName());
|
||||
vBox.getChildren().add(typeLabel);
|
||||
@@ -163,6 +168,14 @@ public class MainController {
|
||||
}
|
||||
}
|
||||
|
||||
private String formatTime(String time) {
|
||||
String[] timeArr = time.split(":");
|
||||
if (timeArr.length > 2) {
|
||||
return timeArr[0] + ":" + timeArr[1];
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
||||
private void setDates() {
|
||||
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("LLLL yyyy");
|
||||
DateTimeFormatter dayFormatter = DateTimeFormatter.ofPattern("E dd.MM");
|
||||
@@ -171,7 +184,7 @@ public class MainController {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
int dayOfWeek = Integer.parseInt(dayOfWeekFormatter.format(now));
|
||||
|
||||
weekStartDateTime = now.minusDays(weekOffset * 7L + dayOfWeek - 1);
|
||||
weekStartDateTime = now.plusDays(weekOffset * 7L - dayOfWeek + 1);
|
||||
|
||||
for (int i = 0; i < 7; i++) {
|
||||
dayLabel[i].setText(dayFormatter.format(weekStartDateTime.plusDays(i)));
|
||||
|
||||
12
client/app/src/main/java/users/CreateUserController.java
Normal file
12
client/app/src/main/java/users/CreateUserController.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package users;
|
||||
|
||||
import javafx.scene.control.CheckBox;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class CreateUserController {
|
||||
|
||||
public TextField textName;
|
||||
public TextField textPassword;
|
||||
public TextField textPasswordSecond;
|
||||
public CheckBox checkBoxIsAdmin;
|
||||
}
|
||||
4
client/app/src/main/java/users/LoginControler.java
Normal file
4
client/app/src/main/java/users/LoginControler.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package users;
|
||||
|
||||
public class LoginControler {
|
||||
}
|
||||
1
client/app/src/main/resources/users/create-user.css
Normal file
1
client/app/src/main/resources/users/create-user.css
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
35
client/app/src/main/resources/users/create-user.fxml
Normal file
35
client/app/src/main/resources/users/create-user.fxml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<GridPane xmlns="http://javafx.com/javafx"
|
||||
xmlns:fx="http://javafx.com/fxml"
|
||||
fx:controller="users.CreateUserController">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints/>
|
||||
<ColumnConstraints/>
|
||||
<ColumnConstraints/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints vgrow="ALWAYS" />
|
||||
<RowConstraints vgrow="ALWAYS" />
|
||||
<RowConstraints vgrow="ALWAYS" />
|
||||
<RowConstraints vgrow="ALWAYS" />
|
||||
<RowConstraints vgrow="ALWAYS" />
|
||||
<RowConstraints vgrow="ALWAYS" />
|
||||
</rowConstraints>
|
||||
|
||||
<Label styleClass="mainLabel">User anlegen</Label>
|
||||
|
||||
<Label styleClass="inputLabel" GridPane.rowIndex="1">Name:</Label>
|
||||
<Label styleClass="inputLabel" GridPane.rowIndex="3">Passwort:</Label>
|
||||
<Label styleClass="inputLabel" GridPane.rowIndex="4">Passwort wiederholen:</Label>
|
||||
<Label styleClass="inputLabel" GridPane.rowIndex="6">Admin:</Label>
|
||||
|
||||
<TextField fx:id="textName" GridPane.columnIndex="2" GridPane.rowIndex="1" maxWidth="400" minWidth="400"/>
|
||||
<TextField fx:id="textPassword" GridPane.columnIndex="2" GridPane.rowIndex="3" maxWidth="400" minWidth="400"/>
|
||||
<TextField fx:id="textPasswordSecond" GridPane.columnIndex="2" GridPane.rowIndex="4" maxWidth="400" minWidth="400"/>
|
||||
|
||||
<CheckBox fx:id="checkBoxIsAdmin" GridPane.columnIndex="2" GridPane.rowIndex="6"/>
|
||||
</GridPane>
|
||||
|
||||
0
client/app/src/main/resources/users/login.css
Normal file
0
client/app/src/main/resources/users/login.css
Normal file
11
client/app/src/main/resources/users/login.fxml
Normal file
11
client/app/src/main/resources/users/login.fxml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import java.lang.*?>
|
||||
<?import java.util.*?>
|
||||
<?import javafx.scene.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<GridPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" fx:controller="users.LoginControler">
|
||||
|
||||
</GridPane>
|
||||
Reference in New Issue
Block a user