Compare commits
2 Commits
add/more_a
...
feature/ex
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3960efaad8 | ||
|
|
867eae66f4 |
@@ -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());
|
||||||
|
|||||||
@@ -24,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;
|
||||||
@@ -47,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;
|
||||||
@@ -160,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;
|
||||||
|
|
||||||
@@ -187,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
|
||||||
@@ -230,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);
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
BIN
src/Client/src/main/resources/icons/questionmark.png
Normal file
BIN
src/Client/src/main/resources/icons/questionmark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user