FIX::edited correct names in fxml files

changed the controller names to use the greenify packages

ADD::added button to add a vegetarian meal

only the button
This commit is contained in:
Sem van der Hoeven
2019-03-14 19:23:30 +01:00
parent 0be9322f66
commit e9bee87a38
6 changed files with 28 additions and 13 deletions

View File

@@ -23,15 +23,13 @@ public class DashBoardController {
// public ComboBox addActivity;
@FXML
public Label dashboardText;
public Label activitiesText;
public Label userText;
public Button dashboardButton;
public Button activitiesButton;
public Button userButton;
DropShadow shadow = new DropShadow();
/**
* displays the dashboard pane.
* @param event the event (clicking the button)
@@ -41,6 +39,7 @@ public class DashBoardController {
dashboardPane.setVisible(true);
userPane.setVisible(false);
activitiesPane.setVisible(false);
// welcomebacktext.setText("Welcome back, " + UserController.getUsernameText() + "!");
}
/**

View File

@@ -23,7 +23,7 @@ public class UserController {
UserService userService;
@FXML
private TextField usernameField;
public TextField usernameField;
@FXML
private PasswordField passwordField;
@@ -35,6 +35,8 @@ public class UserController {
private Button signupButton;
// @Value("${my.url}")
// private String myUrl;
@@ -99,6 +101,11 @@ public class UserController {
appStage.show();
}
// public final String getUsernameText() {
//
// return user.getName();
// }
public static class AlertHelper {
/**

View File

@@ -9,7 +9,7 @@
<?import javafx.scene.layout.*?>
<?import javafx.collections.FXCollections?>
<AnchorPane prefHeight="602.0" prefWidth="926.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="gogreen.client.controller.DashBoardController">
<AnchorPane prefHeight="602.0" prefWidth="926.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="greenify.client.controller.DashBoardController">
<children>
<AnchorPane fx:id="menuBar" prefHeight="603.0" prefWidth="216.0" style="-fx-background-color: #545b4f;">
<children>
@@ -34,13 +34,18 @@
</font>
</Button>
</children></AnchorPane>
<AnchorPane fx:id="activitiesPane" layoutX="214.0" prefHeight="603.0" prefWidth="711.0" visible="false">
<AnchorPane fx:id="activitiesPane" layoutX="214.0" prefHeight="603.0" prefWidth="711.0">
<children>
<Text layoutX="101.0" layoutY="74.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Available Activities" AnchorPane.leftAnchor="60.0" AnchorPane.topAnchor="40.0">
<font>
<Font size="30.0" />
</font>
</Text>
<Button layoutX="60.0" layoutY="173.0" mnemonicParsing="false" style="-fx-background-color: #009623; -fx-border-radius: 50%;" text="Add a vegetarian meal!" textFill="#cce4ca">
<font>
<Font size="14.0" />
</font>
</Button>
</children></AnchorPane>
<AnchorPane fx:id="userPane" layoutX="215.0" layoutY="-1.0" prefHeight="603.0" prefWidth="711.0" visible="false">
<children>
@@ -50,7 +55,7 @@
</font>
</Text>
</children></AnchorPane>
<AnchorPane fx:id="dashboardPane" layoutX="215.0" prefHeight="603.0" prefWidth="711.0">
<AnchorPane fx:id="dashboardPane" layoutX="215.0" prefHeight="603.0" prefWidth="711.0" visible="false">
<children>
<HBox layoutX="97.0" layoutY="124.0" prefHeight="100.0" prefWidth="200.0" />
<Label fx:id="welcomebacktext" layoutX="69.0" layoutY="53.0" text="Welcome back user!" AnchorPane.leftAnchor="60.0" AnchorPane.topAnchor="40.0">
@@ -58,7 +63,7 @@
<Font size="30.0" />
</font>
</Label>
<Button layoutX="583.0" layoutY="41.0" mnemonicParsing="false" style="-fx-background-color: #167526;" text="+" textFill="#e0fcdb">
<Button layoutX="583.0" layoutY="41.0" mnemonicParsing="false" onAction="#displayActivities" style="-fx-background-color: #167526;" text="+" textFill="#e0fcdb">
<font>
<Font name="Eras Bold ITC" size="28.0" />
</font>

View File

@@ -10,7 +10,7 @@
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane fx:controller="gogreen.client.controller.UserController" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="574.0" prefWidth="934.0" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1">
<AnchorPane fx:controller="greenify.client.controller.UserController" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="574.0" prefWidth="934.0" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1">
<children>
<ImageView fitHeight="574.0" fitWidth="943.0" layoutX="-1.0" pickOnBounds="true">
<image>

View File

@@ -1,5 +1,9 @@
package greenify.common;
// DTO stands for Data Transfer Object.
// is an object that carries data between processes.
// The motivation for its use is that communication between processes is usually done
// resorting to remote interfaces (e.g., web services), where each call is an expensive operation.
public class UserDTO {
private Long id;
private String name;

View File

@@ -8,17 +8,17 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
//@AllArgsConstructor
@Entity
@Data
//@AllArgsConstructor
@NoArgsConstructor
public class User {
@Id
private @Id
@GeneratedValue(strategy = GenerationType.AUTO)
Long id;
String name;
String password;
private String name;
private String password;
/**
* makes a user object.