ADD:: added image to add activity button

This commit is contained in:
Sem van der Hoeven
2019-03-16 14:20:40 +01:00
parent ad4e49f65c
commit 9ff1eb6b09
8 changed files with 99 additions and 16 deletions

View File

@@ -5,7 +5,6 @@ import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.effect.DropShadow;
import javafx.scene.layout.AnchorPane;
import org.springframework.beans.factory.annotation.Autowired;
@@ -26,8 +25,9 @@ public class DashBoardController {
public Button dashboardButton;
public Button activitiesButton;
public Button userButton;
public Label scoreField;
DropShadow shadow = new DropShadow();
// DropShadow shadow = new DropShadow();
/**
@@ -35,10 +35,13 @@ public class DashBoardController {
* @param event the event (clicking the button)
*/
public void displayDashboard(ActionEvent event) {
System.out.println("display dashboard");
dashboardPane.setVisible(true);
userPane.setVisible(false);
activitiesPane.setVisible(false);
// welcomebacktext.setText("Welcome back, " + UserController.getUsernameText() + "!");
}
@@ -63,6 +66,8 @@ public class DashBoardController {
userPane.setVisible(true);
activitiesPane.setVisible(false);
}
// public void addShadow(MouseEvent event) {
// userButton.setEffect(shadow);
// }

View File

@@ -91,10 +91,12 @@ public class UserController {
* @author sem
*/
public void openDashboard() throws IOException {
// Font.loadFont(getClass().getResourceAsStream("stylesheets/DesignioRegular.otf"), 21);
Parent dash = FXMLLoader.load(
this.getClass().getClassLoader().getResource("fxml/Dashboard.fxml")
);
Scene scene = new Scene(dash);
scene.getStylesheets().add(getClass().getClassLoader().getResource("stylesheets/dashboardStyle.css").toExternalForm());
Stage appStage = new Stage();
appStage.setScene(scene);
// app_stage.setFullScreen(true);

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.shape.*?>
<?import javafx.scene.image.*?>
<?import javafx.collections.*?>
<?import javafx.scene.text.*?>
<?import java.lang.*?>
@@ -11,37 +13,39 @@
<AnchorPane prefHeight="602.0" prefWidth="926.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="greenify.client.controller.DashBoardController">
<children>
<AnchorPane fx:id="menuBar" prefHeight="603.0" prefWidth="216.0" style="-fx-background-color: #545b4f;">
<AnchorPane fx:id="menuBar" prefHeight="603.0" prefWidth="216.0" style="-fx-background-color: #5a635c;">
<children>
<Label alignment="CENTER" contentDisplay="CENTER" layoutY="-2.0" prefHeight="90.0" prefWidth="216.0" text="Go Green" textAlignment="CENTER" textFill="#07a11c">
<Label alignment="CENTER" contentDisplay="CENTER" layoutY="-2.0" prefHeight="90.0" prefWidth="216.0" text="Go Green" textAlignment="CENTER" textFill="#71bc84">
<font>
<Font size="36.0" />
</font>
</Label>
<Button fx:id="dashboardButton" layoutY="88.0" mnemonicParsing="false" onAction="#displayDashboard" prefHeight="45.0" prefWidth="216.0" style="-fx-background-color: #5a635c;" text="dashboard">
<Button fx:id="dashboardButton" layoutY="88.0" mnemonicParsing="false" onAction="#displayDashboard" prefHeight="45.0" prefWidth="216.0" text="dashboard">
<font>
<Font size="21.0" />
</font>
</Button>
<Button fx:id="activitiesButton" layoutY="133.0" mnemonicParsing="false" onAction="#displayActivities" prefHeight="45.0" prefWidth="216.0" style="-fx-background-color: #5a635c;" text="activities">
<Button fx:id="activitiesButton" layoutY="133.0" mnemonicParsing="false" onAction="#displayActivities" prefHeight="45.0" prefWidth="216.0" text="activities">
<font>
<Font size="21.0" />
</font>
</Button>
<Button fx:id="userButton" layoutY="178.0" mnemonicParsing="false" onAction="#displayUser" prefHeight="45.0" prefWidth="216.0" style="-fx-background-color: #5a635c;" text="you">
<Button fx:id="userButton" layoutY="178.0" mnemonicParsing="false" onAction="#displayUser" prefHeight="45.0" prefWidth="216.0" text="you">
<font>
<Font size="21.0" />
</font>
</Button>
<Line endX="104.0" layoutX="102.0" layoutY="133.0" scaleY="0.7" startX="-100.0" stroke="#e3ffe8" AnchorPane.leftAnchor="5.0" AnchorPane.rightAnchor="5.0" />
<Line endX="104.0" layoutX="105.0" layoutY="178.0" scaleY="0.7" startX="-100.0" stroke="#e3ffe8" AnchorPane.leftAnchor="5.0" AnchorPane.rightAnchor="5.0" />
</children></AnchorPane>
<AnchorPane fx:id="activitiesPane" layoutX="214.0" prefHeight="603.0" prefWidth="711.0">
<AnchorPane fx:id="activitiesPane" layoutX="214.0" prefHeight="603.0" prefWidth="711.0" visible="false">
<children>
<Text layoutX="101.0" layoutY="74.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Available Activities" AnchorPane.leftAnchor="60.0" AnchorPane.topAnchor="40.0">
<font>
<Font size="30.0" />
</font>
</Text>
<Button layoutX="60.0" layoutY="173.0" mnemonicParsing="false" style="-fx-background-color: #009623; -fx-border-radius: 50%;" text="Add a vegetarian meal!" textFill="#cce4ca">
<Button layoutX="60.0" layoutY="116.0" mnemonicParsing="false" style="-fx-background-color: #009623; -fx-border-radius: 25px;" text="Add a vegetarian meal" textFill="#e0ffe1">
<font>
<Font size="14.0" />
</font>
@@ -54,8 +58,22 @@
<Font size="30.0" />
</font>
</Text>
<VBox layoutX="517.0" layoutY="28.0" prefHeight="53.0" prefWidth="100.0" style="-fx-background-color: #daefdf; -fx-border-radius: 20%;">
<children>
<Text fill="#004d11" strokeType="OUTSIDE" strokeWidth="0.0" text="Score" textAlignment="CENTER" wrappingWidth="100.79296875">
<font>
<Font size="24.0" />
</font>
</Text>
<Label fx:id="scoreField" alignment="CENTER" contentDisplay="CENTER" prefHeight="17.0" prefWidth="101.0" text="score" textAlignment="CENTER">
<font>
<Font size="18.0" />
</font>
</Label>
</children>
</VBox>
</children></AnchorPane>
<AnchorPane fx:id="dashboardPane" layoutX="215.0" prefHeight="603.0" prefWidth="711.0" visible="false">
<AnchorPane fx:id="dashboardPane" layoutX="215.0" prefHeight="603.0" prefWidth="711.0">
<children>
<HBox layoutX="97.0" layoutY="124.0" prefHeight="100.0" prefWidth="200.0" />
<Label fx:id="welcomebacktext" layoutX="69.0" layoutY="53.0" text="Welcome back user!" AnchorPane.leftAnchor="60.0" AnchorPane.topAnchor="40.0">
@@ -63,11 +81,19 @@
<Font size="30.0" />
</font>
</Label>
<Button layoutX="583.0" layoutY="41.0" mnemonicParsing="false" onAction="#displayActivities" style="-fx-background-color: #167526;" text="+" textFill="#e0fcdb">
<Button layoutX="567.0" layoutY="26.0" mnemonicParsing="false" onAction="#displayActivities" prefHeight="74.0" prefWidth="62.0" style="-fx-border-radius: 20px; -fx-padding: 0px 0px 0px 0px; -fx-background-color: transparent;" textFill="#e0fcdb">
<font>
<Font name="Eras Bold ITC" size="28.0" />
</font>
<graphic>
<ImageView fitHeight="81.0" fitWidth="74.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../addActivity1.png" />
</image>
</ImageView>
</graphic>
</Button>
<!--<ComboBox fx:id="addActivity" layoutX="532.0" layoutY="28.0" prefWidth="150.0" promptText="Add an Activity" style="-fx-background-color: #1f951f;">-->
<!--<items>-->
<!--<FXCollections fx:factory="observableArrayList">-->

View File

@@ -1,5 +1,55 @@
.button {
-fx-border-width: 0px 0px 1px 0px;
-fx-border-color: #f9f9f9;
-fx-border-radius: 0%;
}
/*.button {*/
/*-fx-border-width: 0px 0px 1px 0px;*/
/*-fx-border-color: #f9f9f9;*/
/*-fx-border-radius: 0%;*/
/*}*/
/*@font-face {*/
/*font-family: 'Nunito Sans';*/
/*src: url('https://fonts.googleapis.com/css?family=Nunito+Sans:200');*/
/*}*/
@font-face {
font-family: 'Designio Regular ';
src: url('stylesheets/DesignioRegular.otf');
}
/*@font-face {*/
/*font-family: 'Big Designer';*/
/*src: url('Big Designer.ttf');*/
/*}*/
/*test if fonts work*/
/*@font-face {*/
/*font-family: 'ConcertOne';*/
/*src: url('https://fonts.googleapis.com/css?family=Concert+One');*/
/*}*/
.root {
-fx-background-color: #f9fffb;
-fx-font-family: "Big Designer";
/*-fx-font-family: Designio;*/
/*-fx-font-family: "Nunito Sans";*/
/*-fx-font-family: "Concert One";*/
}
#dashboardButton {
-fx-background-color: #5a635c;
}
#dashboardButton:pressed {
-fx-background-color: #b7e2c2;
}
#userButton {
-fx-background-color: #5a635c;
}
#userButton:pressed {
-fx-background-color: #b7e2c2;
}
#activitiesButton {
-fx-background-color: #5a635c;
}
#activitiesButton:pressed {
-fx-background-color: #b7e2c2;
}