2 Commits

Author SHA1 Message Date
Sem van der Hoeven
3960efaad8 ADD::added button to display/hide explaination
EDIT::moved explaination to the center
2019-04-10 22:07:31 +02:00
Merel Steenbergen
867eae66f4 ADD::Explanation in first calculator screen 2019-04-09 16:28:17 +02:00
13 changed files with 127 additions and 180 deletions

View File

@@ -144,6 +144,7 @@ public class CalculatorController {
@FXML @FXML
private Label servicesLabel; private Label servicesLabel;
//extra pane //extra pane
@FXML @FXML
private AnchorPane extraPane; private AnchorPane extraPane;
@@ -400,7 +401,7 @@ public class CalculatorController {
} }
try { try {
extraActivityController.updateExtras(); extraActivityController.updateExtras();
} catch (Exception ex) { } catch (NullPointerException ex) {
System.out.println("continue"); System.out.println("continue");
} }
Float footprint = userService.saveFootprint(userService.currentUser.getName()); Float footprint = userService.saveFootprint(userService.currentUser.getName());

View File

@@ -2,15 +2,12 @@ package greenify.client.controller;
import com.sun.javafx.scene.control.skin.ButtonSkin; import com.sun.javafx.scene.control.skin.ButtonSkin;
import greenify.client.rest.UserService; import greenify.client.rest.UserService;
import javafx.animation.FadeTransition;
import javafx.animation.ParallelTransition;
import javafx.animation.ScaleTransition; import javafx.animation.ScaleTransition;
import javafx.animation.TranslateTransition; import javafx.animation.TranslateTransition;
import javafx.beans.value.ChangeListener; import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue; import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.Slider; import javafx.scene.control.Slider;
@@ -132,26 +129,12 @@ public class ExtraActivityController {
}); });
} }
public void addFadeTransAnimation(Node node) {
FadeTransition fade = new FadeTransition(Duration.millis(350), node);
fade.setFromValue(0);
fade.setToValue(1.0);
TranslateTransition trans = new TranslateTransition(Duration.millis(350), node);
trans.setFromX(-800);
trans.setToX(0);
ParallelTransition par = new ParallelTransition();
par.setNode(node);
par.getChildren().addAll(fade, trans);
par.play();
}
/** /**
* displays the vegetarian meal section. * displays the vegetarian meal section.
* @param event the click of the designated button * @param event the click of the designated button
*/ */
public void displayVeganMeal(ActionEvent event) { public void displayVeganMeal(ActionEvent event) {
// System.out.println("display vm"); // System.out.println("display vm");
addFadeTransAnimation(veganMealPane);
veganMealPane.setVisible(true); veganMealPane.setVisible(true);
bikePane.setVisible(false); bikePane.setVisible(false);
temperaturePane.setVisible(false); temperaturePane.setVisible(false);
@@ -166,7 +149,6 @@ public class ExtraActivityController {
*/ */
public void displayBike(ActionEvent event) { public void displayBike(ActionEvent event) {
// System.out.println("display b"); // System.out.println("display b");
addFadeTransAnimation(bikePane);
veganMealPane.setVisible(false); veganMealPane.setVisible(false);
bikePane.setVisible(true); bikePane.setVisible(true);
temperaturePane.setVisible(false); temperaturePane.setVisible(false);
@@ -181,7 +163,6 @@ public class ExtraActivityController {
*/ */
public void displayTemperature(ActionEvent event) { public void displayTemperature(ActionEvent event) {
// System.out.println("display t"); // System.out.println("display t");
addFadeTransAnimation(temperaturePane);
veganMealPane.setVisible(false); veganMealPane.setVisible(false);
bikePane.setVisible(false); bikePane.setVisible(false);
temperaturePane.setVisible(true); temperaturePane.setVisible(true);
@@ -196,7 +177,6 @@ public class ExtraActivityController {
*/ */
public void displaySolarPanel(ActionEvent event) { public void displaySolarPanel(ActionEvent event) {
// System.out.println("display sp"); // System.out.println("display sp");
addFadeTransAnimation(solarPanelPane);
veganMealPane.setVisible(false); veganMealPane.setVisible(false);
bikePane.setVisible(false); bikePane.setVisible(false);
temperaturePane.setVisible(false); temperaturePane.setVisible(false);
@@ -210,7 +190,6 @@ public class ExtraActivityController {
* @param event the click of the designated button * @param event the click of the designated button
*/ */
public void displayLocalProduce(ActionEvent event) { public void displayLocalProduce(ActionEvent event) {
addFadeTransAnimation(localProducePane);
veganMealPane.setVisible(false); veganMealPane.setVisible(false);
bikePane.setVisible(false); bikePane.setVisible(false);
temperaturePane.setVisible(false); temperaturePane.setVisible(false);
@@ -224,7 +203,6 @@ public class ExtraActivityController {
* @param event the click of the designated button * @param event the click of the designated button
*/ */
public void displayPublicTransport(ActionEvent event) { public void displayPublicTransport(ActionEvent event) {
addFadeTransAnimation(publicTransportPane);
veganMealPane.setVisible(false); veganMealPane.setVisible(false);
bikePane.setVisible(false); bikePane.setVisible(false);
temperaturePane.setVisible(false); temperaturePane.setVisible(false);

View File

@@ -1,6 +1,5 @@
package greenify.client.controller; package greenify.client.controller;
import com.sun.javafx.scene.control.skin.ButtonSkin;
import greenify.client.Application; import greenify.client.Application;
import greenify.client.rest.UserService; import greenify.client.rest.UserService;
import javafx.animation.FadeTransition; import javafx.animation.FadeTransition;
@@ -8,10 +7,8 @@ import javafx.animation.Interpolator;
import javafx.animation.KeyFrame; import javafx.animation.KeyFrame;
import javafx.animation.KeyValue; import javafx.animation.KeyValue;
import javafx.animation.ParallelTransition; import javafx.animation.ParallelTransition;
import javafx.animation.ScaleTransition;
import javafx.animation.Timeline; import javafx.animation.Timeline;
import javafx.animation.TranslateTransition; import javafx.animation.TranslateTransition;
import javafx.beans.value.ChangeListener; import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue; import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
@@ -27,6 +24,7 @@ import javafx.scene.control.ScrollPane;
import javafx.scene.control.Slider; import javafx.scene.control.Slider;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane; import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.scene.text.Text; import javafx.scene.text.Text;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.stage.Window; import javafx.stage.Window;
@@ -50,6 +48,10 @@ public class RegisterWindowController {
@Autowired @Autowired
ExtraActivityController extraActivityController; ExtraActivityController extraActivityController;
@FXML
private Text explainText;
//navigation panes //navigation panes
@FXML @FXML
private AnchorPane getStartedPane; private AnchorPane getStartedPane;
@@ -163,6 +165,9 @@ public class RegisterWindowController {
private PasswordField passwordField2; private PasswordField passwordField2;
@FXML @FXML
private Button signUpButton; private Button signUpButton;
//@FXML //@FXML
//private Line uNamePathLine; //private Line uNamePathLine;
@@ -175,8 +180,6 @@ public class RegisterWindowController {
addSlideAnimation(1100, passwordField, 300); addSlideAnimation(1100, passwordField, 300);
TimeUnit.MILLISECONDS.sleep(300); TimeUnit.MILLISECONDS.sleep(300);
addSlideAnimation(1100, passwordField2, -420); addSlideAnimation(1100, passwordField2, -420);
signUpButton.setSkin(new registerButtonSkin(signUpButton));
} }
/** /**
@@ -192,6 +195,18 @@ public class RegisterWindowController {
slideIn.play(); slideIn.play();
} }
public void showExplanation(ActionEvent event) throws InterruptedException {
System.out.println(explainText.isVisible());
if (explainText.isVisible()) {
System.out.println("set to false");
explainText.setVisible(false);
} else {
System.out.println("set to true");
explainText.setVisible(true);
}
}
/** /**
* Signs up the user. * Signs up the user.
* @param event the click of the sign up button * @param event the click of the sign up button
@@ -235,7 +250,7 @@ public class RegisterWindowController {
//close the register window after the user has entered all the credentials //close the register window after the user has entered all the credentials
Stage current = (Stage) owner; Stage current = (Stage) owner;
current.close(); current.close();
Parent calc = Application.load(this.getClass().getClassLoader() Parent calc = Application.load(this.getClass().getClassLoader()
.getResource("fxml/FirstCalculator.fxml")); .getResource("fxml/FirstCalculator.fxml"));
Scene scene = new Scene(calc); Scene scene = new Scene(calc);
@@ -618,37 +633,4 @@ public class RegisterWindowController {
carTravelElectricLabel.getText().replace(" km/Le", "")); carTravelElectricLabel.getText().replace(" km/Le", ""));
} }
} }
@SuppressWarnings("Duplicates")
public class registerButtonSkin extends ButtonSkin {
public registerButtonSkin(Button button) {
super(button);
ScaleTransition scaleUp = new ScaleTransition(Duration.millis(140));
scaleUp.setToX(1.2);
scaleUp.setToY(1.2);
scaleUp.setNode(button);
button.setOnMouseEntered(e -> scaleUp.playFromStart());
ScaleTransition scaleMiddleDown = new ScaleTransition(Duration.millis(50));
scaleMiddleDown.setToX(1.1);
scaleMiddleDown.setToY(1.1);
scaleMiddleDown.setNode(button);
button.setOnMousePressed(e -> scaleMiddleDown.playFromStart());
ScaleTransition scaleMiddleUp = new ScaleTransition(Duration.millis(50));
scaleMiddleUp.setToX(1.2);
scaleMiddleUp.setToY(1.2);
scaleMiddleUp.setNode(button);
button.setOnMouseReleased(e -> scaleMiddleUp.playFromStart());
ScaleTransition scaleDown = new ScaleTransition(Duration.millis(200));
scaleDown.setToX(1.0);
scaleDown.setToY(1.0);
scaleDown.setNode(button);
button.setOnMouseExited(e -> scaleDown.playFromStart());
}
}
} }

View File

@@ -1,9 +1,7 @@
package greenify.client.controller; package greenify.client.controller;
import com.sun.javafx.scene.control.skin.ButtonSkin;
import greenify.client.Application; import greenify.client.Application;
import greenify.client.rest.UserService; import greenify.client.rest.UserService;
import javafx.animation.ScaleTransition;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.Parent; import javafx.scene.Parent;
@@ -14,7 +12,6 @@ import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.stage.Window; import javafx.stage.Window;
import javafx.util.Duration;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.HttpClientErrorException;
@@ -39,10 +36,6 @@ public class UserController {
@FXML @FXML
private Button signUpButton; private Button signUpButton;
public void initialize() {
loginButton.setSkin(new LoginButtonSkin(loginButton));
signUpButton.setSkin(new LoginButtonSkin(signUpButton));
}
/** /**
* Handles when the user clicks on the login button. * Handles when the user clicks on the login button.
* it checks if the username and password fields are filled * it checks if the username and password fields are filled
@@ -143,47 +136,11 @@ public class UserController {
Parent registerWindow = Application.load(this.getClass().getClassLoader() Parent registerWindow = Application.load(this.getClass().getClassLoader()
.getResource("fxml/RegisterWindow.fxml")); .getResource("fxml/RegisterWindow.fxml"));
Scene registerScene = new Scene(registerWindow); Scene registerScene = new Scene(registerWindow);
registerScene.getStylesheets().add(this.getClass().getClassLoader()
.getResource("stylesheets/registerWindowStyle.css").toExternalForm());
Stage registerStage = new Stage(); Stage registerStage = new Stage();
registerStage.setScene(registerScene); registerStage.setScene(registerScene);
registerStage.setTitle("Enter register credentials"); registerStage.setTitle("Enter register credentials");
registerStage.show(); registerStage.show();
} }
@SuppressWarnings("Duplicates")
public class LoginButtonSkin extends ButtonSkin {
public LoginButtonSkin(Button button) {
super(button);
ScaleTransition scaleUp = new ScaleTransition(Duration.millis(140));
scaleUp.setToX(1.1);
scaleUp.setToY(1.1);
scaleUp.setNode(button);
button.setOnMouseEntered(e -> scaleUp.playFromStart());
ScaleTransition scaleMiddleDown = new ScaleTransition(Duration.millis(50));
scaleMiddleDown.setFromX(1.1);
scaleMiddleDown.setFromY(1.1);
scaleMiddleDown.setToX(1.05);
scaleMiddleDown.setToY(1.05);
scaleMiddleDown.setNode(button);
button.setOnMousePressed(e -> scaleMiddleDown.playFromStart());
ScaleTransition scaleMiddleUp = new ScaleTransition(Duration.millis(50));
scaleMiddleUp.setFromX(1.05);
scaleMiddleUp.setFromY(1.05);
scaleMiddleUp.setToX(1.1);
scaleMiddleUp.setToY(1.1);
scaleMiddleUp.setNode(button);
button.setOnMouseReleased(e -> scaleMiddleUp.playFromStart());
ScaleTransition scaleDown = new ScaleTransition(Duration.millis(200));
scaleDown.setToX(1.0);
scaleDown.setToY(1.0);
scaleDown.setNode(button);
button.setOnMouseExited(e -> scaleDown.playFromStart());
}
}
} }

View File

@@ -1,11 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.shape.*?> <?import java.lang.*?>
<?import javafx.geometry.*?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.image.*?> <?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import javafx.scene.shape.*?>
<?import javafx.scene.text.*?> <?import javafx.scene.text.*?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.Slider?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.shape.Line?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane prefHeight="703.0" prefWidth="820.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="greenify.client.controller.RegisterWindowController"> <AnchorPane prefHeight="703.0" prefWidth="820.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="greenify.client.controller.RegisterWindowController">
<children> <children>
@@ -146,6 +161,25 @@
</Label> </Label>
<Button fx:id="getStartedNextButton" layoutX="383.0" layoutY="406.0" mnemonicParsing="false" onAction="#displayTravel" styleClass="nextButton" text="Next" /> <Button fx:id="getStartedNextButton" layoutX="383.0" layoutY="406.0" mnemonicParsing="false" onAction="#displayTravel" styleClass="nextButton" text="Next" />
<Line endX="79.0" layoutX="147.0" layoutY="14.0" stroke="#545b54" /> <Line endX="79.0" layoutX="147.0" layoutY="14.0" stroke="#545b54" />
<Text layoutX="296.0" layoutY="51.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Welcome to Greenify!">
<font>
<Font name="System Bold" size="22.0" />
</font>
</Text>
<Text fx:id="explainText" layoutX="53.0" layoutY="487.0" strokeType="OUTSIDE" strokeWidth="0.0" text="This application will help you decrease your CO2-footprint. In the next screen, you will be asked to fill in certain things, like your yearly energy costs. These values will help us calculate your CO2-footprint. Warning: If you don't fill anything in, the calculator will use a default value based on averages, so if you want a value to be zero, please fill in zero. After that, you'll be able to see your score and compare your footprint to those of your friends. Let's go green and save the planet!" textAlignment="CENTER" visible="false" wrappingWidth="714.0">
<font>
<Font size="16.0" />
</font>
</Text>
<Button layoutX="14.0" layoutY="532.0" mnemonicParsing="false" onAction="#showExplanation" style="-fx-background-color: transparent; -fx-padding: 0 0 0 0;">
<graphic>
<ImageView fitHeight="73.0" fitWidth="72.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/questionmark.png" />
</image>
</ImageView>
</graphic>
</Button>
</children></AnchorPane> </children></AnchorPane>
<AnchorPane fx:id="travelPane" layoutY="85.0" prefHeight="618.0" prefWidth="820.0" visible="false"> <AnchorPane fx:id="travelPane" layoutY="85.0" prefHeight="618.0" prefWidth="820.0" visible="false">
<children> <children>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.image.*?> <?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
@@ -25,7 +24,7 @@
<Font size="13.0" /> <Font size="13.0" />
</font> </font>
</TextField> </TextField>
<Button fx:id="signUpButton" layoutX="115.0" layoutY="229.0" mnemonicParsing="false" onAction="#handleSignUpButton" text="Sign up!" textFill="#c4eec9"> <Button fx:id="signUpButton" layoutX="115.0" layoutY="229.0" mnemonicParsing="false" onAction="#handleSignUpButton" style="-fx-background-color: #005e07;" text="Sign up!" textFill="#c4eec9">
<font> <font>
<Font name="Corbel Bold" size="14.0" /> <Font name="Corbel Bold" size="14.0" />
</font> </font>

View File

@@ -461,14 +461,14 @@
</Button> </Button>
<TableView fx:id="globalLeaderboard" layoutX="56.0" layoutY="220.0" prefHeight="333.0" prefWidth="200.0"> <TableView fx:id="globalLeaderboard" layoutX="56.0" layoutY="220.0" prefHeight="333.0" prefWidth="200.0">
<columns> <columns>
<TableColumn fx:id="globalUser" prefWidth="121.0" text="User" /> <TableColumn fx:id="globalUser" prefWidth="75.0" text="User" />
<TableColumn fx:id="globalScore" prefWidth="78.0" text="Score" /> <TableColumn fx:id="globalScore" prefWidth="124.0" text="Score" />
</columns> </columns>
</TableView> </TableView>
<TableView fx:id="developmentLeaderboard" layoutX="302.0" layoutY="220.0" prefHeight="333.0" prefWidth="200.0"> <TableView fx:id="developmentLeaderboard" layoutX="302.0" layoutY="220.0" prefHeight="333.0" prefWidth="200.0">
<columns> <columns>
<TableColumn fx:id="developmentUser" prefWidth="126.0" text="User" /> <TableColumn fx:id="developmentUser" prefWidth="75.0" text="User" />
<TableColumn fx:id="developmentScore" prefWidth="73.0" text="Score" /> <TableColumn fx:id="developmentScore" prefWidth="124.0" text="Score" />
</columns> </columns>
</TableView> </TableView>
<Label layoutX="69.0" layoutY="177.0" prefHeight="46.0" prefWidth="187.0" text="Global Leaderboard" textAlignment="CENTER" textFill="#5f1616"> <Label layoutX="69.0" layoutY="177.0" prefHeight="46.0" prefWidth="187.0" text="Global Leaderboard" textAlignment="CENTER" textFill="#5f1616">

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.image.*?> <?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
@@ -9,6 +8,63 @@
<AnchorPane prefHeight="611.0" prefWidth="820.0" stylesheets="@../stylesheets/extraActivitiesStyle.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="greenify.client.controller.ExtraActivityController"> <AnchorPane prefHeight="611.0" prefWidth="820.0" stylesheets="@../stylesheets/extraActivitiesStyle.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="greenify.client.controller.ExtraActivityController">
<children> <children>
<AnchorPane prefHeight="611.0" prefWidth="107.0">
<children>
<Button fx:id="displayVeganMealButton" contentDisplay="TOP" layoutX="14.0" layoutY="62.0" mnemonicParsing="false" onAction="#displayVeganMeal" prefHeight="70.0" prefWidth="82.0" styleClass="navButton">
<graphic>
<ImageView fitHeight="45.0" fitWidth="45.0" pickOnBounds="true" preserveRatio="true" styleClass="navButton">
<image>
<Image url="@../icons/icons8-vegan-food-100.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button fx:id="displayLocalProduceButton" contentDisplay="TOP" layoutX="14.0" layoutY="143.0" mnemonicParsing="false" onAction="#displayLocalProduce" prefHeight="70.0" prefWidth="82.0" styleClass="navButton">
<graphic>
<ImageView fitHeight="45.0" fitWidth="45.0" pickOnBounds="true" preserveRatio="true" styleClass="navButton">
<image>
<Image url="@../icons/localProduce.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button fx:id="displayBikeButton" contentDisplay="TOP" layoutX="14.0" layoutY="224.0" mnemonicParsing="false" onAction="#displayBike" prefHeight="70.0" prefWidth="82.0" styleClass="navButton">
<graphic>
<ImageView fitHeight="45.0" fitWidth="48.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/icons8-bicycle-filled-100.png" />
</image>
</ImageView>
</graphic></Button>
<Button fx:id="displaySolarPanelButton" contentDisplay="TOP" layoutX="14.0" layoutY="467.0" mnemonicParsing="false" onAction="#displaySolarPanel" prefHeight="70.0" prefWidth="82.0" styleClass="navButton">
<graphic>
<ImageView fitHeight="45.0" fitWidth="48.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/icons8-solar-panel-filled-100.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button fx:id="displayTemperatureButton" contentDisplay="TOP" layoutX="14.0" layoutY="386.0" mnemonicParsing="false" onAction="#displayTemperature" prefHeight="70.0" prefWidth="82.0" styleClass="navButton">
<graphic>
<ImageView fitHeight="45.0" fitWidth="48.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/icons8-temperature-inside-64.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button fx:id="displayPublicTransportButton" contentDisplay="TOP" layoutX="14.0" layoutY="305.0" mnemonicParsing="false" onAction="#displayPublicTransport" prefHeight="70.0" prefWidth="82.0" styleClass="navButton">
<graphic>
<ImageView fitHeight="45.0" fitWidth="45.0" pickOnBounds="true" preserveRatio="true" styleClass="navButton">
<image>
<Image url="@../icons/publicTransport.png" />
</image>
</ImageView>
</graphic>
</Button>
</children>
</AnchorPane>
<AnchorPane fx:id="veganMealPane" layoutX="107.0" prefHeight="611.0" prefWidth="713.0"> <AnchorPane fx:id="veganMealPane" layoutX="107.0" prefHeight="611.0" prefWidth="713.0">
<children> <children>
<Line fx:id="line1" endX="79.0" layoutX="465.0" layoutY="7.0" stroke="#545b54" /> <Line fx:id="line1" endX="79.0" layoutX="465.0" layoutY="7.0" stroke="#545b54" />
@@ -201,62 +257,5 @@
</HBox> </HBox>
</children> </children>
</AnchorPane> </AnchorPane>
<AnchorPane prefHeight="611.0" prefWidth="107.0">
<children>
<Button fx:id="displayVeganMealButton" contentDisplay="TOP" layoutX="14.0" layoutY="62.0" mnemonicParsing="false" onAction="#displayVeganMeal" prefHeight="70.0" prefWidth="82.0" styleClass="navButton">
<graphic>
<ImageView fitHeight="45.0" fitWidth="45.0" pickOnBounds="true" preserveRatio="true" styleClass="navButton">
<image>
<Image url="@../icons/icons8-vegan-food-100.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button fx:id="displayLocalProduceButton" contentDisplay="TOP" layoutX="14.0" layoutY="143.0" mnemonicParsing="false" onAction="#displayLocalProduce" prefHeight="70.0" prefWidth="82.0" styleClass="navButton">
<graphic>
<ImageView fitHeight="45.0" fitWidth="45.0" pickOnBounds="true" preserveRatio="true" styleClass="navButton">
<image>
<Image url="@../icons/localProduce.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button fx:id="displayBikeButton" contentDisplay="TOP" layoutX="14.0" layoutY="224.0" mnemonicParsing="false" onAction="#displayBike" prefHeight="70.0" prefWidth="82.0" styleClass="navButton">
<graphic>
<ImageView fitHeight="45.0" fitWidth="48.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/icons8-bicycle-filled-100.png" />
</image>
</ImageView>
</graphic></Button>
<Button fx:id="displaySolarPanelButton" contentDisplay="TOP" layoutX="14.0" layoutY="467.0" mnemonicParsing="false" onAction="#displaySolarPanel" prefHeight="70.0" prefWidth="82.0" styleClass="navButton">
<graphic>
<ImageView fitHeight="45.0" fitWidth="48.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/icons8-solar-panel-filled-100.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button fx:id="displayTemperatureButton" contentDisplay="TOP" layoutX="14.0" layoutY="386.0" mnemonicParsing="false" onAction="#displayTemperature" prefHeight="70.0" prefWidth="82.0" styleClass="navButton">
<graphic>
<ImageView fitHeight="45.0" fitWidth="48.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/icons8-temperature-inside-64.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button fx:id="displayPublicTransportButton" contentDisplay="TOP" layoutX="14.0" layoutY="305.0" mnemonicParsing="false" onAction="#displayPublicTransport" prefHeight="70.0" prefWidth="82.0" styleClass="navButton">
<graphic>
<ImageView fitHeight="45.0" fitWidth="45.0" pickOnBounds="true" preserveRatio="true" styleClass="navButton">
<image>
<Image url="@../icons/publicTransport.png" />
</image>
</ImageView>
</graphic>
</Button>
</children>
</AnchorPane>
</children> </children>
</AnchorPane> </AnchorPane>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -2,12 +2,4 @@
-fx-background-color: #005e07; -fx-background-color: #005e07;
-fx-text-fill: #c4eec9; -fx-text-fill: #c4eec9;
-fx-font-weight: bold; -fx-font-weight: bold;
}
.button:hover {
-fx-background-color: #027009;
}
.button:pressed {
-fx-background-color: #1ba023;
} }

View File

@@ -78,8 +78,8 @@ public class AchievementService {
* @param user user for whom achiev6 changes * @param user user for whom achiev6 changes
*/ */
public void achieveLetItShine(User user) { public void achieveLetItShine(User user) {
int solar_panels = Integer.parseInt(user.getExtraInputs().get("solar_panels")); int solarPanels = Integer.parseInt(user.getExtraInputs().get("solar_panels"));
if (solar_panels >= 2) { if (solarPanels >= 2) {
userService.setAchievement(user.getName(), "Let it shine", true); userService.setAchievement(user.getName(), "Let it shine", true);
} }
} }

View File

@@ -110,6 +110,11 @@ public class CalculatorService {
user.setFootPrintInputs(inputs); user.setFootPrintInputs(inputs);
} }
/**
* Gets the result of the CO2-calculation from the CoolClimate website
* @param map results that the user filled in
* @return the results from the website.
*/
public Map<String, String> getResults(Map<String, String> map) { public Map<String, String> getResults(Map<String, String> map) {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("accept", MediaType.APPLICATION_JSON_VALUE); headers.set("accept", MediaType.APPLICATION_JSON_VALUE);