Update branch
This commit is contained in:
@@ -43,8 +43,6 @@ public class Application extends javafx.application.Application {
|
|||||||
Parent rootNode = load(this.getClass().getClassLoader().getResource("fxml/sample.fxml"));
|
Parent rootNode = load(this.getClass().getClassLoader().getResource("fxml/sample.fxml"));
|
||||||
primaryStage.setTitle("Greenify");
|
primaryStage.setTitle("Greenify");
|
||||||
Scene scene = new Scene(rootNode);
|
Scene scene = new Scene(rootNode);
|
||||||
scene.getStylesheets()
|
|
||||||
.add(getClass().getClassLoader().getResource("stylesheets/LoginWindowStyle.css").toExternalForm());
|
|
||||||
primaryStage.setScene(scene);
|
primaryStage.setScene(scene);
|
||||||
primaryStage.show();
|
primaryStage.show();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,12 +36,16 @@ public class DashBoardController {
|
|||||||
@FXML
|
@FXML
|
||||||
private Label welcomebacktext;
|
private Label welcomebacktext;
|
||||||
|
|
||||||
FadeTransition fadeTrans;
|
private FadeTransition fadeTrans;
|
||||||
|
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
welcomebacktext.setText("Welcome back, " + userService.currentUser.getName() + "!");
|
welcomebacktext.setText("Welcome back, " + userService.currentUser.getName() + "!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add transition between scenes.
|
||||||
|
* @param node for method
|
||||||
|
*/
|
||||||
public void addFadeTransition(Node node) {
|
public void addFadeTransition(Node node) {
|
||||||
|
|
||||||
fadeTrans = new FadeTransition(Duration.millis(400), node);
|
fadeTrans = new FadeTransition(Duration.millis(400), node);
|
||||||
@@ -50,7 +54,6 @@ public class DashBoardController {
|
|||||||
fadeTrans.play();
|
fadeTrans.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* displays the dashboard pane.
|
* displays the dashboard pane.
|
||||||
* @param event the event (clicking the button)
|
* @param event the event (clicking the button)
|
||||||
@@ -71,7 +74,6 @@ public class DashBoardController {
|
|||||||
*/
|
*/
|
||||||
public void displayActivities(ActionEvent event) {
|
public void displayActivities(ActionEvent event) {
|
||||||
addFadeTransition(activitiesPane);
|
addFadeTransition(activitiesPane);
|
||||||
|
|
||||||
totalVeganMealCounter.setText("" + userService.currentUser.getVeganMeal());
|
totalVeganMealCounter.setText("" + userService.currentUser.getVeganMeal());
|
||||||
System.out.println("display activities");
|
System.out.println("display activities");
|
||||||
dashboardPane.setVisible(false);
|
dashboardPane.setVisible(false);
|
||||||
@@ -90,8 +92,6 @@ public class DashBoardController {
|
|||||||
dashboardPane.setVisible(false);
|
dashboardPane.setVisible(false);
|
||||||
userPane.setVisible(true);
|
userPane.setVisible(true);
|
||||||
activitiesPane.setVisible(false);
|
activitiesPane.setVisible(false);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -99,8 +99,6 @@ public class DashBoardController {
|
|||||||
* @param event the event (clicking the button)
|
* @param event the event (clicking the button)
|
||||||
*/
|
*/
|
||||||
public void addVeganMeal(ActionEvent event) {
|
public void addVeganMeal(ActionEvent event) {
|
||||||
FadeTransition updateTrans = new FadeTransition(Duration.millis(200), totalVeganMealCounter);
|
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
int net = userService.currentUser.getVeganMeal() + count;
|
int net = userService.currentUser.getVeganMeal() + count;
|
||||||
totalVeganMealCounter.setText("" + net);
|
totalVeganMealCounter.setText("" + net);
|
||||||
@@ -110,4 +108,4 @@ public class DashBoardController {
|
|||||||
userService.currentUser.getName());
|
userService.currentUser.getName());
|
||||||
System.out.println("Vegetarian meal is added");
|
System.out.println("Vegetarian meal is added");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ public class UserController {
|
|||||||
.getResource("stylesheets/dashboardStyle.css").toExternalForm());
|
.getResource("stylesheets/dashboardStyle.css").toExternalForm());
|
||||||
Stage appStage = new Stage();
|
Stage appStage = new Stage();
|
||||||
appStage.setScene(scene);
|
appStage.setScene(scene);
|
||||||
appStage.setTitle("Greenify - " + usernameField.getText());
|
|
||||||
appStage.show();
|
appStage.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -216,3 +216,4 @@
|
|||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import java.lang.*?>
|
|
||||||
<?import javafx.scene.image.*?>
|
|
||||||
<?import javafx.scene.layout.*?>
|
|
||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.*?>
|
||||||
<?import javafx.scene.image.Image?>
|
<?import javafx.scene.image.Image?>
|
||||||
<?import javafx.scene.image.ImageView?>
|
<?import javafx.scene.image.ImageView?>
|
||||||
<?import javafx.scene.layout.AnchorPane?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
<?import javafx.scene.text.*?>
|
<?import javafx.scene.text.*?>
|
||||||
|
|
||||||
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="602.0" prefWidth="934.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="greenify.client.controller.UserController">
|
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="602.0" prefWidth="934.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="greenify.client.controller.UserController">
|
||||||
<children>
|
<children>
|
||||||
<ImageView fitHeight="600.0" fitWidth="943.0" layoutX="-1.0" pickOnBounds="true">
|
<ImageView fitHeight="600.0" fitWidth="943.0" layoutX="-1.0" pickOnBounds="true">
|
||||||
@@ -17,15 +13,15 @@
|
|||||||
</image></ImageView>
|
</image></ImageView>
|
||||||
<Text fill="#23773d" layoutX="283.0" layoutY="100.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Go Green" textAlignment="CENTER" wrappingWidth="374.936767578125">
|
<Text fill="#23773d" layoutX="283.0" layoutY="100.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Go Green" textAlignment="CENTER" wrappingWidth="374.936767578125">
|
||||||
<font>
|
<font>
|
||||||
<Font name="Corbel" size="72.0" />
|
<Font name="Californian FB" size="72.0" />
|
||||||
</font>
|
</font>
|
||||||
</Text>
|
</Text>
|
||||||
<Button fx:id="loginButton" layoutX="419.0" layoutY="274.0" mnemonicParsing="false" onAction="#handleLoginButtonAction" prefHeight="26.0" prefWidth="96.0" text="Login" textAlignment="CENTER" />
|
<Button fx:id="loginButton" layoutX="419.0" layoutY="274.0" mnemonicParsing="false" onAction="#handleLoginButtonAction" prefHeight="26.0" prefWidth="96.0" text="Login" textAlignment="CENTER" />
|
||||||
<Button fx:id="signupButton" layoutX="42.0" layoutY="52.0" mnemonicParsing="false" onAction="#handleRegisterButtonAction" prefHeight="10.0" prefWidth="96.0" text="Sign up!" />
|
<Button fx:id="signupButton" layoutX="42.0" layoutY="52.0" mnemonicParsing="false" onAction="#handleRegisterButtonAction" prefHeight="10.0" prefWidth="96.0" text="Sign up!" />
|
||||||
<PasswordField fx:id="passwordField" layoutX="318.0" layoutY="210.0" prefHeight="42.0" prefWidth="303.0" promptText="Password" />
|
<PasswordField fx:id="passwordField" layoutX="318.0" layoutY="210.0" prefHeight="42.0" prefWidth="303.0" promptText="Password" />
|
||||||
<Hyperlink alignment="CENTER" layoutX="384.0" layoutY="301.0" prefHeight="42.0" prefWidth="173.0" text="Forgot Password?" textAlignment="CENTER" textFill="#3db25a" textOverrun="LEADING_WORD_ELLIPSIS">
|
<Hyperlink layoutX="392.0" layoutY="308.0" prefHeight="42.0" prefWidth="173.0" text="Forgot Password?" textAlignment="CENTER" textFill="WHITE" textOverrun="LEADING_WORD_ELLIPSIS">
|
||||||
<font>
|
<font>
|
||||||
<Font name="Corbel Bold" size="18.0" />
|
<Font name="Bodoni MT Bold" size="18.0" />
|
||||||
</font>
|
</font>
|
||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
<Text fill="#23773d" layoutX="20.0" layoutY="40.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Not Member?" textAlignment="CENTER" wrappingWidth="146.13673400878906">
|
<Text fill="#23773d" layoutX="20.0" layoutY="40.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Not Member?" textAlignment="CENTER" wrappingWidth="146.13673400878906">
|
||||||
|
|||||||
@@ -12,9 +12,6 @@
|
|||||||
#dashboardButton {
|
#dashboardButton {
|
||||||
-fx-background-color: #5a635c;
|
-fx-background-color: #5a635c;
|
||||||
}
|
}
|
||||||
#dashboardButton:hover {
|
|
||||||
-fx-background-color: #677069;
|
|
||||||
}
|
|
||||||
#dashboardButton:pressed {
|
#dashboardButton:pressed {
|
||||||
-fx-background-color: #b7e2c2;
|
-fx-background-color: #b7e2c2;
|
||||||
}
|
}
|
||||||
@@ -22,9 +19,6 @@
|
|||||||
#userButton {
|
#userButton {
|
||||||
-fx-background-color: #5a635c;
|
-fx-background-color: #5a635c;
|
||||||
}
|
}
|
||||||
#userButton:hover {
|
|
||||||
-fx-background-color: #677069;
|
|
||||||
}
|
|
||||||
#userButton:pressed {
|
#userButton:pressed {
|
||||||
-fx-background-color: #b7e2c2;
|
-fx-background-color: #b7e2c2;
|
||||||
}
|
}
|
||||||
@@ -32,9 +26,6 @@
|
|||||||
#activitiesButton {
|
#activitiesButton {
|
||||||
-fx-background-color: #5a635c;
|
-fx-background-color: #5a635c;
|
||||||
}
|
}
|
||||||
#activitiesButton:hover {
|
|
||||||
-fx-background-color: #677069;
|
|
||||||
}
|
|
||||||
#activitiesButton:pressed {
|
#activitiesButton:pressed {
|
||||||
-fx-background-color: #b7e2c2;
|
-fx-background-color: #b7e2c2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package greenify.server.rest;
|
package greenify.server.rest;
|
||||||
|
|
||||||
import greenify.common.UserDto;
|
import greenify.common.UserDto;
|
||||||
|
import greenify.server.data.model.User;
|
||||||
|
import greenify.server.data.repository.UserRepository;
|
||||||
import greenify.server.service.UserService;
|
import greenify.server.service.UserService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
public class UserController {
|
public class UserController {
|
||||||
|
|||||||
@@ -10,3 +10,4 @@ public class ApplicationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void contextLoads() throws Exception{ }
|
public void contextLoads() throws Exception{ }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import greenify.server.data.repository.UserRepository;
|
|||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mock;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.TestConfiguration;
|
import org.springframework.boot.test.context.TestConfiguration;
|
||||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||||
|
|||||||
Reference in New Issue
Block a user