Compare commits
	
		
			3 Commits
		
	
	
		
			7422271b9d
			...
			cf4014f552
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | cf4014f552 | ||
| 2b719ea39f | |||
| 2652f5e9ac | 
| @@ -0,0 +1,50 @@ | |||||||
|  | package de.subway_surfers.vpr_app; | ||||||
|  |  | ||||||
|  | import javafx.event.ActionEvent; | ||||||
|  | import javafx.fxml.FXML; | ||||||
|  | import javafx.geometry.Pos; | ||||||
|  | import javafx.scene.Node; | ||||||
|  | import javafx.scene.control.Control; | ||||||
|  | import javafx.scene.layout.ColumnConstraints; | ||||||
|  | import javafx.scene.layout.GridPane; | ||||||
|  | import javafx.scene.layout.Priority; | ||||||
|  | import javafx.scene.layout.RowConstraints; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | public class EssensverwaltungMitarbeiterView { | ||||||
|  | 	@FXML | ||||||
|  | 	private GridPane tagesplan; | ||||||
|  |  | ||||||
|  | 	public void initialize(){ | ||||||
|  | 		for (int i = 0; i < tagesplan.getColumnCount(); i++) { | ||||||
|  | 			ColumnConstraints cc = new ColumnConstraints(); | ||||||
|  | 			cc.setHgrow(Priority.ALWAYS); | ||||||
|  | 			cc.setFillWidth(true); | ||||||
|  | 			tagesplan.getColumnConstraints().add(cc); | ||||||
|  | 		} | ||||||
|  | 		VerwaltungApplication.responsiveBreiteGrid(tagesplan); | ||||||
|  |  | ||||||
|  | 		tagesplan.heightProperty().addListener((obs,oldValue,newValue) -> { | ||||||
|  | 			final int zeile = 1; | ||||||
|  | 			for (Node n : tagesplan.getChildren()){ | ||||||
|  | 				if(n instanceof Control  && GridPane.getRowIndex(n) == zeile){ | ||||||
|  | 					((Control) n).setPrefHeight(newValue.floatValue()); | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 		}); | ||||||
|  |  | ||||||
|  | 	} | ||||||
|  | 	public void onAbmelden(ActionEvent actionEvent) { | ||||||
|  | 		VerwaltungApplication.sceneWechseln("login-view.fxml"); | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	public void onFilter(ActionEvent actionEvent) { | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	public void onHinzufuegen(ActionEvent actionEvent) { | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	public void onZurueck(ActionEvent actionEvent) { | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -2,8 +2,11 @@ package de.subway_surfers.vpr_app; | |||||||
|  |  | ||||||
| import javafx.application.Application; | import javafx.application.Application; | ||||||
| import javafx.fxml.FXMLLoader; | import javafx.fxml.FXMLLoader; | ||||||
|  | import javafx.scene.Node; | ||||||
| import javafx.scene.Scene; | import javafx.scene.Scene; | ||||||
| import javafx.scene.control.Alert; | import javafx.scene.control.Alert; | ||||||
|  | import javafx.scene.control.Control; | ||||||
|  | import javafx.scene.layout.GridPane; | ||||||
| import javafx.stage.Stage; | import javafx.stage.Stage; | ||||||
|  |  | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
| @@ -111,6 +114,24 @@ public class VerwaltungApplication extends Application { | |||||||
| 		sceneWechseln("login-view.fxml"); | 		sceneWechseln("login-view.fxml"); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	/** | ||||||
|  | 	 * Methode zum automatischen vergrößern und verkleinern von Grids | ||||||
|  | 	 * | ||||||
|  | 	 * Geschrieben: Max Heer, Sven Alteköster | ||||||
|  | 	 * Getestet | ||||||
|  | 	 * | ||||||
|  | 	 * @param grid das responsiv sein soll | ||||||
|  | 	 */ | ||||||
|  | 	public static void responsiveBreiteGrid (GridPane grid) { | ||||||
|  | 		grid.widthProperty().addListener((obs, oldValue, newValue) -> { | ||||||
|  | 			for (Node n : grid.getChildren()) { | ||||||
|  | 				if (n instanceof Control) { | ||||||
|  | 					((Control) n).setPrefWidth(newValue.floatValue() / grid.getColumnCount()); | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 		}); | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	public static void main(String[] args) { | 	public static void main(String[] args) { | ||||||
| 		launch(); | 		launch(); | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -0,0 +1,65 @@ | |||||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||||
|  | <!--Erstellt von Max Heer--> | ||||||
|  |  | ||||||
|  | <?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.EssensverwaltungMitarbeiterView" | ||||||
|  |             prefHeight="400.0" prefWidth="600.0" | ||||||
|  |             stylesheets="@layout.css"> | ||||||
|  |     <top> | ||||||
|  |         <BorderPane styleClass="kopfzeile"> | ||||||
|  |             <right> | ||||||
|  |                 <Button text="Abmelden" onAction="#onAbmelden"/> | ||||||
|  |             </right> | ||||||
|  |             <left> | ||||||
|  |                 <Button text="Zurück" onAction="#onZurueck"/> | ||||||
|  |             </left> | ||||||
|  |         </BorderPane> | ||||||
|  |     </top> | ||||||
|  |     <center> | ||||||
|  |         <BorderPane> | ||||||
|  |             <top> | ||||||
|  |                 <BorderPane> | ||||||
|  |                     <left> | ||||||
|  |                         <HBox styleClass="test" spacing="10"> | ||||||
|  |                             <Button text="Filter" onAction="#onFilter"/> | ||||||
|  |                             <Button text="Hinzufügen" onAction="#onHinzufuegen"/> | ||||||
|  |                         </HBox> | ||||||
|  |                     </left> | ||||||
|  |                     <right> | ||||||
|  |                         <HBox styleClass="test" spacing="10"> | ||||||
|  |                             <Button styleClass="pfeil, links"/> | ||||||
|  |                             <Label text="Montag DD.MM.YY"/> | ||||||
|  |                             <Button styleClass="pfeil"/> | ||||||
|  |                         </HBox> | ||||||
|  |                     </right> | ||||||
|  |                 </BorderPane> | ||||||
|  |             </top> | ||||||
|  |             <center> | ||||||
|  |                 <AnchorPane> | ||||||
|  |                     <GridPane fx:id="tagesplan" AnchorPane.bottomAnchor="20" AnchorPane.rightAnchor="20" AnchorPane.leftAnchor="20" AnchorPane.topAnchor="20" styleClass="essensuebersicht_gridlines"> | ||||||
|  |                         <Label text="GerichtName" GridPane.columnIndex="0" GridPane.rowIndex="0"/> | ||||||
|  |                         <Label GridPane.columnIndex="1" GridPane.rowIndex="0"/> | ||||||
|  |                         <Label GridPane.columnIndex="2" GridPane.rowIndex="0"/> | ||||||
|  |                         <Label GridPane.columnIndex="3" GridPane.rowIndex="0"/> | ||||||
|  |                         <Label GridPane.columnIndex="0" GridPane.rowIndex="1"/> | ||||||
|  |                     </GridPane> | ||||||
|  |                 </AnchorPane> | ||||||
|  |             </center> | ||||||
|  |         </BorderPane> | ||||||
|  |  | ||||||
|  |     </center> | ||||||
|  |     <bottom> | ||||||
|  |         <BorderPane styleClass="button-untenrechts"> | ||||||
|  |             <right> | ||||||
|  |                 <Button text="Bestätigen" styleClass=".button"/> | ||||||
|  |             </right> | ||||||
|  |         </BorderPane> | ||||||
|  |     </bottom> | ||||||
|  | </BorderPane> | ||||||
| @@ -73,6 +73,13 @@ | |||||||
|     -fx-vgap: 10; |     -fx-vgap: 10; | ||||||
|     -fx-hgap: 10; |     -fx-hgap: 10; | ||||||
| } | } | ||||||
|  | .test { | ||||||
|  |     -fx-padding: 10 20; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .essensuebersicht_gridlines { | ||||||
|  |      -fx-grid-lines-visible: true; | ||||||
|  | } | ||||||
|  |  | ||||||
| .accounterstellung_links { | .accounterstellung_links { | ||||||
|     -fx-spacing: 20; |     -fx-spacing: 20; | ||||||
| @@ -82,3 +89,18 @@ | |||||||
|     -fx-background-color: #FFDCDC; |     -fx-background-color: #FFDCDC; | ||||||
|     -fx-text-fill: #FFDCDC; |     -fx-text-fill: #FFDCDC; | ||||||
| } | } | ||||||
|  | .essensuebersicht_gridlines > * { | ||||||
|  |     -fx-alignment: center; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .pfeil{ | ||||||
|  |     -fx-background-color: -fx-mark-highlight-color, -fx-mark-color; | ||||||
|  |     -fx-background-insets: 0 0 -1 0, 0; | ||||||
|  |     -fx-padding: 0.25em; | ||||||
|  |     -fx-shape: "M 0 -3.5 v 7 l 4 -3.5 z"; | ||||||
|  |     -fx-pref-width: 25; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .links { | ||||||
|  |     -fx-rotate: 180; | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user