From 410897f4cc79eab16f0574de81b9ffb3609c5bb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolay=20Schi=C3=B8ll-Johansen?=
 <nicolayschiolljohansen@gmail.com>
Date: Sun, 22 Mar 2020 13:24:22 +0100
Subject: [PATCH] Created view album page and commented on what methods are
 needed

---
 .../controllers/CreateAlbumController.java    |   4 -
 .../controllers/ViewAlbumController.java      |  98 +++++++++++++
 .../resources/NTNU/IDATT1002/view_album.fxml  | 137 ++++++++++++++++++
 3 files changed, 235 insertions(+), 4 deletions(-)
 create mode 100644 src/main/java/NTNU/IDATT1002/controllers/ViewAlbumController.java
 create mode 100644 src/main/resources/NTNU/IDATT1002/view_album.fxml

diff --git a/src/main/java/NTNU/IDATT1002/controllers/CreateAlbumController.java b/src/main/java/NTNU/IDATT1002/controllers/CreateAlbumController.java
index b00260b3..c84fb963 100644
--- a/src/main/java/NTNU/IDATT1002/controllers/CreateAlbumController.java
+++ b/src/main/java/NTNU/IDATT1002/controllers/CreateAlbumController.java
@@ -41,8 +41,4 @@ public class CreateAlbumController {
 
     }
 
-    public void uploadPhoto(ActionEvent actionEvent) throws IOException {
-        //write method to accept and upload the photo with chosen settings, titles etc and then setRoot to logged-in page
-        App.setRoot("logged-in");
-    }
 }
diff --git a/src/main/java/NTNU/IDATT1002/controllers/ViewAlbumController.java b/src/main/java/NTNU/IDATT1002/controllers/ViewAlbumController.java
new file mode 100644
index 00000000..36b24cdb
--- /dev/null
+++ b/src/main/java/NTNU/IDATT1002/controllers/ViewAlbumController.java
@@ -0,0 +1,98 @@
+package NTNU.IDATT1002.controllers;
+
+import NTNU.IDATT1002.App;
+import javafx.event.ActionEvent;
+import javafx.scene.control.Button;
+import javafx.scene.control.TextArea;
+import javafx.scene.control.TextField;
+import javafx.scene.image.ImageView;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.Pane;
+import javafx.scene.text.Text;
+
+import java.io.IOException;
+
+public class ViewAlbumController {
+    public TextField tbar_search;
+    public ImageView tbar_logo;
+    public Button tbar_explore;
+    public Button tbar_map;
+    public Button tbar_upload;
+    public Button create_album_pdf;
+    public Pane metadata_pane;
+    public Text desc_textField;
+    public Text album_tagsField;
+    public Text album_titleField;
+    public Button scroll_button_next;
+    public Button scroll_button_previous;
+    public ImageView scroll_picture6;
+    public ImageView scroll_picture5;
+    public ImageView scroll_picture4;
+    public ImageView scroll_picture3;
+    public ImageView scroll_picture2;
+    public ImageView scroll_picture1;
+    public Text picture_title_field;
+    public Text picture_tagsField;
+    public ImageView main_picture;
+    public Button tbar_searchButton;
+
+    public void switchToSearch(ActionEvent actionEvent) throws IOException {
+        App.setRoot("search_page");
+    }
+
+    public void switchToUpload(ActionEvent actionEvent) throws IOException {
+        App.setRoot("upload_page");
+    }
+
+    public void switchToMap(ActionEvent actionEvent) throws IOException {
+        App.setRoot("map_page");
+    }
+
+    public void switchToExplore(ActionEvent actionEvent) throws IOException {
+        App.setRoot("explore_page");
+    }
+
+    public void uploadPhoto(ActionEvent actionEvent) throws IOException {
+        App.setRoot("logged-in");
+    }
+
+    public void openPopUpPicture(MouseEvent mouseEvent) {
+        //write method that opens a pop-up view of the main picture
+    }
+
+    public void changeMainPicture1(MouseEvent mouseEvent) {
+        //write method that switches to main picture to be picture 1 in the scrollbar-view
+    }
+
+    public void changeMainPicture2(MouseEvent mouseEvent) {
+        //write method that switches to main picture to be picture 2 in the scrollbar-view
+    }
+
+    public void changeMainPicture3(MouseEvent mouseEvent) {
+        //write method that switches to main picture to be picture 3 in the scrollbar-view
+    }
+
+    public void changeMainPicture4(MouseEvent mouseEvent) {
+        //write method that switches to main picture to be picture 4 in the scrollbar-view
+    }
+
+    public void changeMainPicture5(MouseEvent mouseEvent) {
+        //write method that switches to main picture to be picture 5 in the scrollbar-view
+    }
+
+    public void changeMainPicture6(MouseEvent mouseEvent) {
+        //write method that switches to main picture to be picture 6 in the scrollbar-view
+    }
+
+    public void loadPreviousScrollbarView(ActionEvent actionEvent) {
+        //write method that loads the previous 6 images in the album into the scrollbar-view
+    }
+
+    public void loadNextScrollbarView(ActionEvent actionEvent) {
+        //write method that loads the next 6 images in the album into the scrollbar-view
+    }
+
+    public void createPdf(ActionEvent actionEvent) {
+        //write method that generates and downloads a PDF version of the album
+    }
+}
diff --git a/src/main/resources/NTNU/IDATT1002/view_album.fxml b/src/main/resources/NTNU/IDATT1002/view_album.fxml
new file mode 100644
index 00000000..627d3ae9
--- /dev/null
+++ b/src/main/resources/NTNU/IDATT1002/view_album.fxml
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.control.Button?>
+<?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.layout.Pane?>
+<?import javafx.scene.layout.VBox?>
+<?import javafx.scene.text.Font?>
+<?import javafx.scene.text.Text?>
+
+<AnchorPane prefHeight="1080.0" prefWidth="1920.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="NTNU.IDATT1002.controllers.ViewAlbumController">
+    <children>
+        <VBox prefHeight="1080.0" prefWidth="1920.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
+            <children>
+                <HBox alignment="CENTER" minHeight="100.0" prefHeight="100.0" prefWidth="200.0" spacing="20.0" style="-fx-background-color: #0c0c0c;">
+                    <children>
+                        <ImageView fx:id="tbar_logo" fitHeight="69.0" fitWidth="153.0" pickOnBounds="true" preserveRatio="true">
+                            <image>
+                                <Image url="@../../Images/PlaceholderLogo.png" />
+                            </image>
+                        </ImageView>
+                        <Pane prefHeight="100.0" prefWidth="343.0" />
+                        <TextField fx:id="tbar_search" onAction="#switchToSearch" prefHeight="25.0" prefWidth="358.0" promptText="Search: Tags, Albums, Metadata, etc..." />
+                  <Button fx:id="tbar_searchButton" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" />
+                        <Button fx:id="tbar_explore" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" />
+                        <Button fx:id="tbar_map" mnemonicParsing="false" onAction="#switchToMap" text="MAP" />
+                        <Pane prefHeight="100.0" prefWidth="174.0" />
+                        <Button fx:id="tbar_upload" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" />
+                    </children>
+                </HBox>
+                <HBox alignment="CENTER" prefHeight="982.0" prefWidth="1920.0">
+                    <children>
+                        <Pane prefHeight="981.0" prefWidth="949.0" style="-fx-background-color: #777777;">
+                            <children>
+                                <ImageView fx:id="main_picture" fitHeight="455.0" fitWidth="952.0" layoutX="69.0" layoutY="272.0" onMouseClicked="#openPopUpPicture" pickOnBounds="true" preserveRatio="true">
+                                    <image>
+                                        <Image url="@../../Images/placeholder-1920x1080.png" /> <!-- This is the URL to the image in question, needs to change in accordance with the current uploaded picture-->
+                                    </image>
+                                </ImageView>
+                        <Text fx:id="picture_tagsField" layoutX="69.0" layoutY="775.0" strokeType="OUTSIDE" strokeWidth="0.0" text="#tags">
+                           <font>
+                              <Font size="18.0" />
+                           </font>
+                        </Text>
+                        <Text fx:id="picture_title_field" layoutX="69.0" layoutY="753.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Picturetitle">
+                           <font>
+                              <Font size="24.0" />
+                           </font>
+                        </Text>
+                        <ImageView fx:id="scroll_picture1" fitHeight="64.0" fitWidth="114.0" layoutX="112.0" layoutY="201.0" onMouseClicked="#changeMainPicture1" pickOnBounds="true" preserveRatio="true">
+                           <image>
+                              <Image url="@../../Images/placeholder-1920x1080.png" />
+                           </image>
+                        </ImageView>
+                        <ImageView fx:id="scroll_picture2" fitHeight="64.0" fitWidth="114.0" layoutX="234.0" layoutY="201.0" onMouseClicked="#changeMainPicture2" pickOnBounds="true" preserveRatio="true">
+                           <image>
+                              <Image url="@../../Images/placeholder-1920x1080.png" />
+                           </image>
+                        </ImageView>
+                        <ImageView fx:id="scroll_picture3" fitHeight="64.0" fitWidth="114.0" layoutX="356.0" layoutY="201.0" onMouseClicked="#changeMainPicture3" pickOnBounds="true" preserveRatio="true">
+                           <image>
+                              <Image url="@../../Images/placeholder-1920x1080.png" />
+                           </image>
+                        </ImageView>
+                        <ImageView fx:id="scroll_picture4" fitHeight="64.0" fitWidth="114.0" layoutX="478.0" layoutY="201.0" onMouseClicked="#changeMainPicture4" pickOnBounds="true" preserveRatio="true">
+                           <image>
+                              <Image url="@../../Images/placeholder-1920x1080.png" />
+                           </image>
+                        </ImageView>
+                        <ImageView fx:id="scroll_picture5" fitHeight="64.0" fitWidth="114.0" layoutX="599.0" layoutY="201.0" onMouseClicked="#changeMainPicture5" pickOnBounds="true" preserveRatio="true">
+                           <image>
+                              <Image url="@../../Images/placeholder-1920x1080.png" />
+                           </image>
+                        </ImageView>
+                        <ImageView fx:id="scroll_picture6" fitHeight="64.0" fitWidth="114.0" layoutX="721.0" layoutY="201.0" onMouseClicked="#changeMainPicture6" pickOnBounds="true" preserveRatio="true">
+                           <image>
+                              <Image url="@../../Images/placeholder-1920x1080.png" />
+                           </image>
+                        </ImageView>
+                        <Button fx:id="scroll_button_previous" layoutX="72.0" layoutY="221.0" mnemonicParsing="false" onAction="#loadPreviousScrollbarView" text="Prev" />
+                        <Button fx:id="scroll_button_next" layoutX="835.0" layoutY="221.0" mnemonicParsing="false" onAction="#loadNextScrollbarView" text="Next" />
+                            </children>
+                        </Pane>
+                        <Pane prefHeight="981.0" prefWidth="975.0" style="-fx-background-color: #999999;">
+                            <children>
+                                <Text layoutX="76.0" layoutY="170.0" strokeType="OUTSIDE" strokeWidth="0.0" text="TITLE:">
+                                    <font>
+                                        <Font name="System Bold" size="36.0" />
+                                    </font>
+                                </Text>
+                        <Text fx:id="album_titleField" layoutX="190.0" layoutY="170.0" strokeType="OUTSIDE" strokeWidth="0.0" text="title">
+                           <font>
+                              <Font size="36.0" />
+                           </font>
+                        </Text>
+                                <Text layoutX="76.0" layoutY="206.0" strokeType="OUTSIDE" strokeWidth="0.0" text="TAGS:">
+                                    <font>
+                                        <Font name="System Bold" size="24.0" />
+                                    </font>
+                                </Text>
+                        <Text fx:id="album_tagsField" layoutX="156.0" layoutY="206.0" strokeType="OUTSIDE" strokeWidth="0.0" text="#tags">
+                           <font>
+                              <Font size="24.0" />
+                           </font>
+                        </Text>
+                                <Text layoutX="76.0" layoutY="239.0" strokeType="OUTSIDE" strokeWidth="0.0" text="DESCRIPTION:" wrappingWidth="164.24609375">
+                                    <font>
+                                        <Font name="System Bold" size="24.0" />
+                                    </font>
+                                </Text>
+                        <Text fx:id="desc_textField" layoutX="76.0" layoutY="261.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." wrappingWidth="822.0">
+                           <font>
+                              <Font size="14.0" />
+                           </font>
+                        </Text>
+                                <Text layoutX="76.0" layoutY="357.0" strokeType="OUTSIDE" strokeWidth="0.0" text="PICTURE METADATA:">
+                                    <font>
+                                        <Font name="System Bold" size="24.0" />
+                                    </font>
+                                </Text>
+                                <Pane fx:id="metadata_pane" layoutX="76.0" layoutY="371.0" prefHeight="391.0" prefWidth="822.0" style="-fx-background-color: #ffffff;" />
+                                <Button fx:id="create_album_pdf" layoutX="394.0" layoutY="810.0" mnemonicParsing="false" onAction="#createPdf" text="CREATE ALBUM PDF">
+                                    <font>
+                                        <Font size="18.0" />
+                                    </font>
+                                </Button>
+                            </children>
+                        </Pane>
+                    </children>
+                </HBox>
+            </children>
+        </VBox>
+    </children>
+</AnchorPane>
-- 
GitLab