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"));
|
||||
primaryStage.setTitle("Greenify");
|
||||
Scene scene = new Scene(rootNode);
|
||||
scene.getStylesheets()
|
||||
.add(getClass().getClassLoader().getResource("stylesheets/LoginWindowStyle.css").toExternalForm());
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
@@ -36,12 +36,16 @@ public class DashBoardController {
|
||||
@FXML
|
||||
private Label welcomebacktext;
|
||||
|
||||
FadeTransition fadeTrans;
|
||||
private FadeTransition fadeTrans;
|
||||
|
||||
public void initialize() {
|
||||
welcomebacktext.setText("Welcome back, " + userService.currentUser.getName() + "!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Add transition between scenes.
|
||||
* @param node for method
|
||||
*/
|
||||
public void addFadeTransition(Node node) {
|
||||
|
||||
fadeTrans = new FadeTransition(Duration.millis(400), node);
|
||||
@@ -50,7 +54,6 @@ public class DashBoardController {
|
||||
fadeTrans.play();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* displays the dashboard pane.
|
||||
* @param event the event (clicking the button)
|
||||
@@ -71,7 +74,6 @@ public class DashBoardController {
|
||||
*/
|
||||
public void displayActivities(ActionEvent event) {
|
||||
addFadeTransition(activitiesPane);
|
||||
|
||||
totalVeganMealCounter.setText("" + userService.currentUser.getVeganMeal());
|
||||
System.out.println("display activities");
|
||||
dashboardPane.setVisible(false);
|
||||
@@ -90,8 +92,6 @@ public class DashBoardController {
|
||||
dashboardPane.setVisible(false);
|
||||
userPane.setVisible(true);
|
||||
activitiesPane.setVisible(false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,8 +99,6 @@ public class DashBoardController {
|
||||
* @param event the event (clicking the button)
|
||||
*/
|
||||
public void addVeganMeal(ActionEvent event) {
|
||||
FadeTransition updateTrans = new FadeTransition(Duration.millis(200), totalVeganMealCounter);
|
||||
|
||||
count++;
|
||||
int net = userService.currentUser.getVeganMeal() + count;
|
||||
totalVeganMealCounter.setText("" + net);
|
||||
@@ -110,4 +108,4 @@ public class DashBoardController {
|
||||
userService.currentUser.getName());
|
||||
System.out.println("Vegetarian meal is added");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ public class UserController {
|
||||
.getResource("stylesheets/dashboardStyle.css").toExternalForm());
|
||||
Stage appStage = new Stage();
|
||||
appStage.setScene(scene);
|
||||
appStage.setTitle("Greenify - " + usernameField.getText());
|
||||
appStage.show();
|
||||
}
|
||||
|
||||
|
||||
@@ -216,3 +216,4 @@
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
<?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.image.Image?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?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">
|
||||
<children>
|
||||
<ImageView fitHeight="600.0" fitWidth="943.0" layoutX="-1.0" pickOnBounds="true">
|
||||
@@ -17,15 +13,15 @@
|
||||
</image></ImageView>
|
||||
<Text fill="#23773d" layoutX="283.0" layoutY="100.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Go Green" textAlignment="CENTER" wrappingWidth="374.936767578125">
|
||||
<font>
|
||||
<Font name="Corbel" size="72.0" />
|
||||
<Font name="Californian FB" size="72.0" />
|
||||
</font>
|
||||
</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="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" />
|
||||
<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 name="Corbel Bold" size="18.0" />
|
||||
<Font name="Bodoni MT Bold" size="18.0" />
|
||||
</font>
|
||||
</Hyperlink>
|
||||
<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 {
|
||||
-fx-background-color: #5a635c;
|
||||
}
|
||||
#dashboardButton:hover {
|
||||
-fx-background-color: #677069;
|
||||
}
|
||||
#dashboardButton:pressed {
|
||||
-fx-background-color: #b7e2c2;
|
||||
}
|
||||
@@ -22,9 +19,6 @@
|
||||
#userButton {
|
||||
-fx-background-color: #5a635c;
|
||||
}
|
||||
#userButton:hover {
|
||||
-fx-background-color: #677069;
|
||||
}
|
||||
#userButton:pressed {
|
||||
-fx-background-color: #b7e2c2;
|
||||
}
|
||||
@@ -32,9 +26,6 @@
|
||||
#activitiesButton {
|
||||
-fx-background-color: #5a635c;
|
||||
}
|
||||
#activitiesButton:hover {
|
||||
-fx-background-color: #677069;
|
||||
}
|
||||
#activitiesButton:pressed {
|
||||
-fx-background-color: #b7e2c2;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package greenify.server.rest;
|
||||
|
||||
import greenify.common.UserDto;
|
||||
import greenify.server.data.model.User;
|
||||
import greenify.server.data.repository.UserRepository;
|
||||
import greenify.server.service.UserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
public class UserController {
|
||||
|
||||
@@ -10,3 +10,4 @@ public class ApplicationTest {
|
||||
@Test
|
||||
public void contextLoads() throws Exception{ }
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import greenify.server.data.repository.UserRepository;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.TestConfiguration;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
|
||||
Reference in New Issue
Block a user