Merge branch 'master' into 'Add_registering_GUI'

# Conflicts:
#   src/Client/src/main/java/greenify/client/Application.java
#   src/Client/src/main/java/greenify/client/controller/UserController.java
#   src/Client/src/main/resources/stylesheets/dashboardStyle.css
This commit is contained in:
Sem van der Hoeven
2019-03-16 17:40:58 +00:00
34 changed files with 882 additions and 491 deletions

View File

@@ -21,11 +21,6 @@ public class Application extends javafx.application.Application {
launch(args);
}
// @Bean
// public RestTemplate restTemplate(RestTemplateBuilder builder) {
// return builder.build();
// }
@Override
public void init() throws Exception {
springContext = SpringApplication.run(Application.class);
@@ -50,14 +45,4 @@ public class Application extends javafx.application.Application {
public void stop() {
springContext.stop();
}
// @Bean
// public CommandLineRunner run(RestTemplate restTemplate) throws Exception {
// return args -> {
// User user = restTemplate.getForObject(
// "http://localhost:8080/user", User.class);
// log.info(user.toString());
//
// };
// }
}

View File

@@ -5,7 +5,6 @@ import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.effect.DropShadow;
import javafx.scene.layout.AnchorPane;
import org.springframework.beans.factory.annotation.Autowired;
@@ -26,8 +25,9 @@ public class DashBoardController {
public Button dashboardButton;
public Button activitiesButton;
public Button userButton;
public Label scoreField;
DropShadow shadow = new DropShadow();
// DropShadow shadow = new DropShadow();
/**
@@ -35,10 +35,13 @@ public class DashBoardController {
* @param event the event (clicking the button)
*/
public void displayDashboard(ActionEvent event) {
System.out.println("display dashboard");
dashboardPane.setVisible(true);
userPane.setVisible(false);
activitiesPane.setVisible(false);
// welcomebacktext.setText("Welcome back, " + UserController.getUsernameText() + "!");
}
@@ -63,6 +66,8 @@ public class DashBoardController {
userPane.setVisible(true);
activitiesPane.setVisible(false);
}
// public void addShadow(MouseEvent event) {
// userButton.setEffect(shadow);
// }

View File

@@ -34,21 +34,6 @@ public class UserController {
@FXML
private Button signupButton;
// @Value("${my.url}")
// private String myUrl;
// @FXML
// private void initialize(ActionEvent event) throws IOException {
// Parent parent = FXMLLoader.load(getClass().getResource("sample.fxml"));
// Scene scene = new Scene(parent);
// Stage app_stage = (Stage)((Node) event.getSource()).getScene().getWindow();
// app_stage.setScene(scene);
// app_stage.show();
// }
@FXML
protected void handleLoginButtonAction(ActionEvent event) throws IOException {
Window owner = loginButton.getScene().getWindow();
@@ -94,22 +79,18 @@ public class UserController {
* @author sem
*/
public void openDashboard() throws IOException {
// Font.loadFont(getClass().getResourceAsStream("stylesheets/DesignioRegular.otf"), 21);
Parent dash = FXMLLoader.load(
this.getClass().getClassLoader().getResource("fxml/Dashboard.fxml")
);
Scene scene = new Scene(dash);
scene.getStylesheets().add(getClass().getClassLoader().getResource("stylesheets/dashboardStyle.css").toExternalForm());
Stage appStage = new Stage();
appStage.setScene(scene);
// app_stage.setFullScreen(true);
appStage.show();
}
// public final String getUsernameText() {
//
// return user.getName();
// }
public static class AlertHelper {
/**
* alerts for the login screen.

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.shape.*?>
<?import javafx.scene.image.*?>
<?import javafx.collections.*?>
<?import javafx.scene.text.*?>
<?import java.lang.*?>
@@ -11,28 +13,30 @@
<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;">
<AnchorPane fx:id="menuBar" prefHeight="603.0" prefWidth="216.0" style="-fx-background-color: #5a635c;">
<children>
<Label alignment="CENTER" contentDisplay="CENTER" layoutY="-2.0" prefHeight="90.0" prefWidth="216.0" text="Go Green" textAlignment="CENTER" textFill="#07a11c">
<Label alignment="CENTER" contentDisplay="CENTER" layoutY="-2.0" prefHeight="90.0" prefWidth="216.0" text="Go Green" textAlignment="CENTER" textFill="#71bc84">
<font>
<Font size="36.0" />
</font>
</Label>
<Button fx:id="dashboardButton" layoutY="88.0" mnemonicParsing="false" onAction="#displayDashboard" prefHeight="45.0" prefWidth="216.0" style="-fx-background-color: #5a635c;" text="dashboard">
<Button fx:id="dashboardButton" layoutY="88.0" mnemonicParsing="false" onAction="#displayDashboard" prefHeight="45.0" prefWidth="216.0" text="dashboard">
<font>
<Font size="21.0" />
</font>
</Button>
<Button fx:id="activitiesButton" layoutY="133.0" mnemonicParsing="false" onAction="#displayActivities" prefHeight="45.0" prefWidth="216.0" style="-fx-background-color: #5a635c;" text="activities">
<Button fx:id="activitiesButton" layoutY="133.0" mnemonicParsing="false" onAction="#displayActivities" prefHeight="45.0" prefWidth="216.0" text="activities">
<font>
<Font size="21.0" />
</font>
</Button>
<Button fx:id="userButton" layoutY="178.0" mnemonicParsing="false" onAction="#displayUser" prefHeight="45.0" prefWidth="216.0" style="-fx-background-color: #5a635c;" text="you">
<Button fx:id="userButton" layoutY="178.0" mnemonicParsing="false" onAction="#displayUser" prefHeight="45.0" prefWidth="216.0" text="you">
<font>
<Font size="21.0" />
</font>
</Button>
<Line endX="104.0" layoutX="102.0" layoutY="133.0" scaleY="0.7" startX="-100.0" stroke="#e3ffe8" AnchorPane.leftAnchor="5.0" AnchorPane.rightAnchor="5.0" />
<Line endX="104.0" layoutX="105.0" layoutY="178.0" scaleY="0.7" startX="-100.0" stroke="#e3ffe8" AnchorPane.leftAnchor="5.0" AnchorPane.rightAnchor="5.0" />
</children></AnchorPane>
<AnchorPane fx:id="activitiesPane" layoutX="214.0" prefHeight="603.0" prefWidth="711.0" visible="false">
<children>
@@ -41,7 +45,7 @@
<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">
<Button layoutX="60.0" layoutY="116.0" mnemonicParsing="false" style="-fx-background-color: #009623; -fx-border-radius: 25px;" text="Add a vegetarian meal" textFill="#e0ffe1">
<font>
<Font size="14.0" />
</font>
@@ -54,6 +58,20 @@
<Font size="30.0" />
</font>
</Text>
<VBox layoutX="517.0" layoutY="28.0" prefHeight="53.0" prefWidth="100.0" style="-fx-background-color: #daefdf; -fx-border-radius: 20%;">
<children>
<Text fill="#004d11" strokeType="OUTSIDE" strokeWidth="0.0" text="Score" textAlignment="CENTER" wrappingWidth="100.79296875">
<font>
<Font size="24.0" />
</font>
</Text>
<Label fx:id="scoreField" alignment="CENTER" contentDisplay="CENTER" prefHeight="17.0" prefWidth="101.0" text="score" textAlignment="CENTER">
<font>
<Font size="18.0" />
</font>
</Label>
</children>
</VBox>
</children></AnchorPane>
<AnchorPane fx:id="dashboardPane" layoutX="215.0" prefHeight="603.0" prefWidth="711.0">
<children>
@@ -63,11 +81,19 @@
<Font size="30.0" />
</font>
</Label>
<Button layoutX="583.0" layoutY="41.0" mnemonicParsing="false" onAction="#displayActivities" style="-fx-background-color: #167526;" text="+" textFill="#e0fcdb">
<Button layoutX="567.0" layoutY="26.0" mnemonicParsing="false" onAction="#displayActivities" prefHeight="74.0" prefWidth="62.0" style="-fx-border-radius: 20px; -fx-padding: 0px 0px 0px 0px; -fx-background-color: transparent;" textFill="#e0fcdb">
<font>
<Font name="Eras Bold ITC" size="28.0" />
</font>
<graphic>
<ImageView fitHeight="81.0" fitWidth="74.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../addActivity1.png" />
</image>
</ImageView>
</graphic>
</Button>
<!--<ComboBox fx:id="addActivity" layoutX="532.0" layoutY="28.0" prefWidth="150.0" promptText="Add an Activity" style="-fx-background-color: #1f951f;">-->
<!--<items>-->
<!--<FXCollections fx:factory="observableArrayList">-->

View File

@@ -2,4 +2,53 @@
/*-fx-border-width: 0px 0px 1px 0px;*/
/*-fx-border-color: #f9f9f9;*/
/*-fx-border-radius: 0%;*/
/*}*/
/*}*/
/*@font-face {*/
/*font-family: 'Nunito Sans';*/
/*src: url('https://fonts.googleapis.com/css?family=Nunito+Sans:200');*/
/*}*/
@font-face {
font-family: 'Designio Regular ';
src: url('stylesheets/DesignioRegular.otf');
}
/*@font-face {*/
/*font-family: 'Big Designer';*/
/*src: url('Big Designer.ttf');*/
/*}*/
/*test if fonts work*/
/*@font-face {*/
/*font-family: 'ConcertOne';*/
/*src: url('https://fonts.googleapis.com/css?family=Concert+One');*/
/*}*/
.root {
-fx-background-color: #f9fffb;
-fx-font-family: "Big Designer";
/*-fx-font-family: Designio;*/
/*-fx-font-family: "Nunito Sans";*/
/*-fx-font-family: "Concert One";*/
}
#dashboardButton {
-fx-background-color: #5a635c;
}
#dashboardButton:pressed {
-fx-background-color: #b7e2c2;
}
#userButton {
-fx-background-color: #5a635c;
}
#userButton:pressed {
-fx-background-color: #b7e2c2;
}
#activitiesButton {
-fx-background-color: #5a635c;
}
#activitiesButton:pressed {
-fx-background-color: #b7e2c2;
}

View File

@@ -1,16 +0,0 @@
import greenify.client.Application;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
public class ApplicationTest {
@Test
public void applicationContextLoaded() {
}
@Test
public void applicationContextTest() {
Application.main(new String[] {});
}
}