ADD::added button to display/hide explaination

EDIT::moved explaination to the center
This commit is contained in:
Sem van der Hoeven
2019-04-10 22:07:31 +02:00
parent 867eae66f4
commit 3960efaad8
4 changed files with 43 additions and 2 deletions

View File

@@ -144,6 +144,7 @@ public class CalculatorController {
@FXML
private Label servicesLabel;
//extra pane
@FXML
private AnchorPane extraPane;

View File

@@ -24,6 +24,7 @@ import javafx.scene.control.ScrollPane;
import javafx.scene.control.Slider;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.stage.Window;
@@ -47,6 +48,10 @@ public class RegisterWindowController {
@Autowired
ExtraActivityController extraActivityController;
@FXML
private Text explainText;
//navigation panes
@FXML
private AnchorPane getStartedPane;
@@ -160,6 +165,9 @@ public class RegisterWindowController {
private PasswordField passwordField2;
@FXML
private Button signUpButton;
//@FXML
//private Line uNamePathLine;
@@ -187,6 +195,18 @@ public class RegisterWindowController {
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.
* @param event the click of the sign up button

View File

@@ -1,5 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.shape.*?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?>
@@ -15,7 +22,7 @@
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane prefHeight="703.0" prefWidth="820.0" xmlns="http://javafx.com/javafx/8.0.172-ea" 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>
<AnchorPane fx:id="calculatorTabs" prefHeight="92.0" prefWidth="820.0" style="-fx-background-color: #677069;">
<children>
@@ -159,7 +166,20 @@
<Font name="System Bold" size="22.0" />
</font>
</Text>
<Text layoutX="15.0" layoutY="459.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" wrappingWidth="714.0" />
<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>
<AnchorPane fx:id="travelPane" layoutY="85.0" prefHeight="618.0" prefWidth="820.0" visible="false">
<children>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB