diff --git a/src/main/java/NTNU/IDATT1002/controllers/CreateAlbum.java b/src/main/java/NTNU/IDATT1002/controllers/CreateAlbum.java index 99c28cf82df83c3a4864142fdfb4991e8a4e6629..4f0b733a3d1f0ce2a27aa06b7af5409e5c2ae0ee 100644 --- a/src/main/java/NTNU/IDATT1002/controllers/CreateAlbum.java +++ b/src/main/java/NTNU/IDATT1002/controllers/CreateAlbum.java @@ -19,8 +19,6 @@ import javafx.scene.control.CheckBox; import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.image.ImageView; -import javafx.scene.input.MouseEvent; -import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; @@ -40,21 +38,13 @@ import java.util.stream.Collectors; * * @version 1.0 22.03.2020 */ -public class CreateAlbum implements Initializable { - public TextField tbar_search; - public ImageView tbar_logo; - public Button tbar_explore; - public Button tbar_map; - public Button tbar_upload; +public class CreateAlbum extends NavBarController implements Initializable { + public TextField album_title_field; public TextField album_tag_field; public TextArea album_desc_field; public Pane metadata_pane; - public GridPane image_grid; - public Button add_images_button; public Button create_album_button; - public Button tbar_albums; - public Button tbar_searchBtn; public VBox fileContainer; private AlbumService albumService; @@ -87,70 +77,6 @@ public class CreateAlbum implements Initializable { } } - /** - * Method that changes stage to Main page - * - * @param mouseEvent - * @throws IOException - */ - public void switchToMain(MouseEvent mouseEvent) throws IOException { - App.setRoot("main"); - } - - /** - * Method that changes stage to Search page. It reads the value of the search - * field and if not empty it is passed to dataexchange - * - * @param actionEvent - * @throws IOException - */ - public void switchToSearch(ActionEvent actionEvent) throws IOException { - if (!tbar_search.getText().isEmpty()) { - App.ex.setSearchField(tbar_search.getText()); - } - App.setRoot("search"); - } - - /** - * Method that changes stage to Explore page - * - * @param actionEvent - * @throws IOException - */ - public void switchToExplore(ActionEvent actionEvent) throws IOException { - App.setRoot("explore"); - } - - /** - * Method that changes stage to Albums page - * - * @param actionEvent - * @throws IOException - */ - public void switchToAlbums(ActionEvent actionEvent) throws IOException { - App.setRoot("explore_albums"); - } - - /** - * Method that changes stage to Map page - * - * @param actionEvent - * @throws IOException - */ - public void switchToMap(ActionEvent actionEvent) throws IOException { - App.setRoot("map"); - } - - /** - * Method that changes stage to Upload page - * - * @param actionEvent the mouse has done something - * @throws IOException this page does not exist - */ - public void switchToUpload(ActionEvent actionEvent) throws IOException { - App.setRoot("upload"); - } - /** * Method that creates album based on the user input and checked images * diff --git a/src/main/java/NTNU/IDATT1002/controllers/Explore.java b/src/main/java/NTNU/IDATT1002/controllers/Explore.java index 97964726c3062f5fd88369ad2b0ad1281fd71f17..b52d118311ca8c1ae016a5e47b8a493a314b0901 100644 --- a/src/main/java/NTNU/IDATT1002/controllers/Explore.java +++ b/src/main/java/NTNU/IDATT1002/controllers/Explore.java @@ -9,10 +9,8 @@ import javafx.event.EventHandler; import javafx.fxml.Initializable; import javafx.geometry.Pos; import javafx.scene.Node; -import javafx.scene.Parent; import javafx.scene.control.Button; import javafx.scene.control.ScrollPane; -import javafx.scene.control.TextField; import javafx.scene.image.ImageView; import javafx.scene.input.MouseEvent; import javafx.scene.layout.GridPane; @@ -30,15 +28,8 @@ import java.util.ResourceBundle; * a page where you explore images * @version 1.0 22.03.2020 */ -public class Explore implements Initializable { - - public ImageView tbar_logo; - public TextField tbar_search; - public Button tbar_searchBtn; - public Button tbar_explore; - public Button tbar_map; - public Button tbar_upload; - public Button tbar_albums; +public class Explore extends NavBarController implements Initializable { + public ScrollPane scrollPane; public GridPane gridPane; public Button footer_previousBtn; @@ -114,64 +105,6 @@ public class Explore implements Initializable { } } - /** - * Method that changes scene to Main page - * @param mouseEvent - * @throws IOException - */ - public void switchToMain(MouseEvent mouseEvent) throws IOException { - App.setRoot("main"); - } - - /** - * Method that changes scene to Search page. It reads the value of the search - * field and if not empty it is passed to dataexchange - * @param actionEvent - * @throws IOException - */ - public void switchToSearch(ActionEvent actionEvent) throws IOException { - if (!tbar_search.getText().isEmpty()){ - App.ex.setSearchField(tbar_search.getText()); - } - App.setRoot("search"); - } - - /** - * Method that changes scene to Explore page - * @param actionEvent - * @throws IOException - */ - public void switchToExplore(ActionEvent actionEvent) throws IOException { - App.setRoot("explore"); - } - - /** - * Method that changes scene to Albums page - * @param actionEvent - * @throws IOException - */ - public void switchToAlbums(ActionEvent actionEvent) throws IOException { - App.setRoot("explore_albums"); - } - - /** - * Method that changes scene to Map page - * @param actionEvent - * @throws IOException - */ - public void switchToMap(ActionEvent actionEvent) throws IOException { - App.setRoot("map"); - } - - /** - * Method that changes scene to Upload page - * @param actionEvent the mouse has done something - * @throws IOException this page does not exist - */ - public void switchToUpload(ActionEvent actionEvent) throws IOException { - App.setRoot("upload"); - } - /** * Method that changes scene to View Picture page for the image that was clicked * @param mouseEvent diff --git a/src/main/java/NTNU/IDATT1002/controllers/ExploreAlbums.java b/src/main/java/NTNU/IDATT1002/controllers/ExploreAlbums.java index f32a2cead01308d35abd1823d86c9efb39e64eab..0f97536b21e2ed14b849cd3ba5a5e23b7dad14f3 100644 --- a/src/main/java/NTNU/IDATT1002/controllers/ExploreAlbums.java +++ b/src/main/java/NTNU/IDATT1002/controllers/ExploreAlbums.java @@ -42,19 +42,9 @@ import java.util.concurrent.Executors; * a page where you explore albums * @version 1.1 04.04.2020 */ -public class ExploreAlbums implements Initializable { - public ImageView tbar_logo; - public TextField tbar_search; - public Button tbar_map; - public Button tbar_upload; - public Button tbar_albums; - public Button tbar_searchBtn; - public Button tbar_explore; +public class ExploreAlbums extends NavBarController implements Initializable { public ScrollPane scrollpane; - //public Button footer_previous_page; - //public Button footer_next_page; - public Text albumAmount; public ChoiceBox sortedByChoicebox; public Button createAlbumButton; @@ -349,70 +339,6 @@ public class ExploreAlbums implements Initializable { return content; } - /** - * Change scene to Main page. - * - * @param mouseEvent - * @throws IOException - */ - public void switchToMain(MouseEvent mouseEvent) throws IOException { - App.setRoot("main"); - } - - /** - * Change scene to Search page. Reads the value of the search - * field and if not empty it is passed to DataExchange. - * - * @param actionEvent - * @throws IOException - */ - public void switchToSearch(ActionEvent actionEvent) throws IOException { - if (!tbar_search.getText().isEmpty()){ - App.ex.setSearchField(tbar_search.getText()); - } - App.setRoot("search"); - } - - /** - * Change scene to Explore page. - * - * @param actionEvent - * @throws IOException - */ - public void switchToExplore(ActionEvent actionEvent) throws IOException { - App.setRoot("explore"); - } - - /** - * Change scene to Albums page. - * - * @param actionEvent - * @throws IOException - */ - public void switchToAlbums(ActionEvent actionEvent) throws IOException { - App.setRoot("explore_albums"); - } - - /** - * Change scene to Map page. - * - * @param actionEvent - * @throws IOException - */ - public void switchToMap(ActionEvent actionEvent) throws IOException { - App.setRoot("map"); - } - - /** - * Change scene to Upload page. - * - * @param actionEvent the mouse has done something - * @throws IOException this page does not exist - */ - public void switchToUpload(ActionEvent actionEvent) throws IOException { - App.setRoot("upload"); - } - /** * Change scene to Create Album page. * diff --git a/src/main/java/NTNU/IDATT1002/controllers/Main.java b/src/main/java/NTNU/IDATT1002/controllers/Main.java index 958e34b16c4908132e296de6856b11be4d094a42..5dcaf6789ba7069deb409475c88cf4053c32d724 100644 --- a/src/main/java/NTNU/IDATT1002/controllers/Main.java +++ b/src/main/java/NTNU/IDATT1002/controllers/Main.java @@ -1,86 +1,14 @@ package NTNU.IDATT1002.controllers; -import NTNU.IDATT1002.App; -import javafx.event.ActionEvent; import javafx.scene.control.Button; -import javafx.scene.control.TextField; -import javafx.scene.image.ImageView; -import javafx.scene.input.MouseEvent; - -import java.io.IOException; /** * Controls the buttons and changeable elements on main.fxml, * a page where you explore albums * @version 1.0 22.03.2020 */ -public class Main { - - public ImageView tbar_logo; - public TextField tbar_search; - public Button tbar_searchBtn; - public Button tbar_explore; - public Button tbar_map; - public Button tbar_upload; +public class Main extends NavBarController { public Button uploadBtn; - public Button tbar_albums; - - /** - * Method that changes scene to Main page - * @param mouseEvent - * @throws IOException - */ - public void switchToMain(MouseEvent mouseEvent) throws IOException { - App.setRoot("main"); - } - - /** - * Method that changes scene to Search page. It reads the value of the search - * field and if not empty it is passed to dataexchange - * @param actionEvent - * @throws IOException - */ - public void switchToSearch(ActionEvent actionEvent) throws IOException { - if (!tbar_search.getText().isEmpty()){ - App.ex.setSearchField(tbar_search.getText()); - } - App.setRoot("search"); - } - - /** - * Method that changes scene to Explore page - * @param actionEvent - * @throws IOException - */ - public void switchToExplore(ActionEvent actionEvent) throws IOException { - App.setRoot("explore"); - } - - /** - * Method that changes scene to Albums page - * @param actionEvent - * @throws IOException - */ - public void switchToAlbums(ActionEvent actionEvent) throws IOException { - App.setRoot("explore_albums"); - } - - /** - * Method that changes scene to Map page - * @param actionEvent - * @throws IOException - */ - public void switchToMap(ActionEvent actionEvent) throws IOException { - App.setRoot("map"); - } - /** - * Method that changes scene to Upload page - * @param actionEvent the mouse has done something - * @throws IOException this page does not exist - */ - public void switchToUpload(ActionEvent actionEvent) throws IOException { - App.setRoot("upload"); - } } \ No newline at end of file diff --git a/src/main/java/NTNU/IDATT1002/controllers/Map.java b/src/main/java/NTNU/IDATT1002/controllers/Map.java index a0cc06fa5686c09e1c2657045131316a03df4970..f5057ae473335f78e13ead88b48907be845a2081 100644 --- a/src/main/java/NTNU/IDATT1002/controllers/Map.java +++ b/src/main/java/NTNU/IDATT1002/controllers/Map.java @@ -24,15 +24,12 @@ import javafx.fxml.Initializable; import javafx.scene.control.Alert; import javafx.scene.control.Button; import javafx.scene.control.TextField; -import javafx.scene.image.ImageView; import javafx.scene.input.KeyEvent; -import javafx.scene.input.MouseEvent; import org.controlsfx.control.textfield.TextFields; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.persistence.EntityManager; -import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.List; @@ -49,17 +46,11 @@ import java.util.stream.Stream; * a page where you can find images by location * @version 1.0 22.03.2020 */ -public class Map implements Initializable, MapComponentInitializedListener { - public ImageView tbar_logo; - public TextField tbar_search; - public Button tbar_searchBtn; - public Button tbar_explore; - public Button tbar_map; - public Button tbar_upload; +public class Map extends NavBarController implements Initializable, MapComponentInitializedListener { public TextField search; + public Button searchBtn; - public Button tbar_albums; @FXML private GoogleMapView mapView; @@ -76,7 +67,9 @@ public class Map implements Initializable, MapComponentInitializedListener { private StringProperty address = new SimpleStringProperty(); private ImageService imageService; + private AlbumService albumService; + private ExecutorService executorService = Executors.newCachedThreadPool(); private static Logger logger = LoggerFactory.getLogger(Map.class); @@ -242,75 +235,5 @@ public class Map implements Initializable, MapComponentInitializedListener { Alert alert = new Alert(Alert.AlertType.INFORMATION, message); alert.show(); } - - /** - * Change scene to Main page. - * - * @param mouseEvent - * @throws IOException - */ - public void switchToMain(MouseEvent mouseEvent) throws IOException { - App.ex.setChosenAlbumId(null); - App.setRoot("main"); - } - - /** - * Change scene to Search page. It reads the value of the search - * field and if not empty it is passed to dataexchange. - * - * @param actionEvent - * @throws IOException - */ - public void switchToSearch(ActionEvent actionEvent) throws IOException { - if (!tbar_search.getText().isEmpty()){ - App.ex.setSearchField(tbar_search.getText()); - } - App.ex.setChosenAlbumId(null); - App.setRoot("search"); - } - - /** - * Change scene to Explore page - * - * @param actionEvent - * @throws IOException - */ - public void switchToExplore(ActionEvent actionEvent) throws IOException { - App.ex.setChosenAlbumId(null); - App.setRoot("explore"); - } - - /** - * Change scene to Albums page - * @param actionEvent - * @throws IOException - */ - public void switchToAlbums(ActionEvent actionEvent) throws IOException { - App.ex.setChosenAlbumId(null); - App.setRoot("explore_albums"); - } - - /** - * Change scene to Map page. - * - * @param actionEvent - * @throws IOException - */ - public void switchToMap(ActionEvent actionEvent) throws IOException { - App.ex.setChosenAlbumId(null); - App.setRoot("map"); - } - - /** - * Change scene to Upload page. - * - * @param actionEvent the mouse has done something - * @throws IOException this page does not exist - */ - public void switchToUpload(ActionEvent actionEvent) throws IOException { - App.ex.setChosenAlbumId(null); - App.setRoot("upload"); - } - } diff --git a/src/main/java/NTNU/IDATT1002/controllers/NavBarController.java b/src/main/java/NTNU/IDATT1002/controllers/NavBarController.java new file mode 100644 index 0000000000000000000000000000000000000000..e1911aec2f75eba8a77f956de3bb8962fce5a773 --- /dev/null +++ b/src/main/java/NTNU/IDATT1002/controllers/NavBarController.java @@ -0,0 +1,79 @@ +package NTNU.IDATT1002.controllers; + +import NTNU.IDATT1002.App; +import javafx.event.ActionEvent; +import javafx.scene.control.Button; +import javafx.scene.control.TextField; +import javafx.scene.image.ImageView; +import javafx.scene.input.MouseEvent; + +import java.io.IOException; + +public class NavBarController { + + public ImageView navBarLogo; + public TextField navBarSearch; + public Button navBarSearchBtn; + public Button navBarExplore; + public Button navBarMap; + public Button navBarUpload; + public Button navBarAlbums; + + /** + * Method that changes scene to Main page + * @param mouseEvent + * @throws IOException + */ + public void switchToMain(MouseEvent mouseEvent) throws IOException { + App.setRoot("main"); + } + + /** + * Method that changes scene to Search page. It reads the value of the search + * field and if not empty it is passed to dataexchange + * @param actionEvent + * @throws IOException + */ + public void switchToSearch(ActionEvent actionEvent) throws IOException { + if (!navBarSearch.getText().isEmpty()){ + App.ex.setSearchField(navBarSearch.getText()); + } + App.setRoot("search"); + } + + /** + * Method that changes scene to Explore page + * @param actionEvent + * @throws IOException + */ + public void switchToExplore(ActionEvent actionEvent) throws IOException { + App.setRoot("explore"); + } + + /** + * Method that changes scene to Albums page + * @param actionEvent + * @throws IOException + */ + public void switchToAlbums(ActionEvent actionEvent) throws IOException { + App.setRoot("explore_albums"); + } + + /** + * Method that changes scene to Map page + * @param actionEvent + * @throws IOException + */ + public void switchToMap(ActionEvent actionEvent) throws IOException { + App.setRoot("map"); + } + + /** + * Method that changes scene to Upload page + * @param actionEvent the mouse has done something + * @throws IOException this page does not exist + */ + public void switchToUpload(ActionEvent actionEvent) throws IOException { + App.setRoot("upload"); + } +} diff --git a/src/main/java/NTNU/IDATT1002/controllers/Search.java b/src/main/java/NTNU/IDATT1002/controllers/Search.java index fc54d59d54f819098babcf0cb6dc751d86d287e9..be650cf02bc2570f2bb701c69bef2509a4dc4f38 100644 --- a/src/main/java/NTNU/IDATT1002/controllers/Search.java +++ b/src/main/java/NTNU/IDATT1002/controllers/Search.java @@ -9,10 +9,7 @@ import javafx.event.EventHandler; import javafx.fxml.Initializable; import javafx.geometry.Pos; import javafx.scene.Node; -import javafx.scene.control.Button; -import javafx.scene.control.ChoiceBox; import javafx.scene.control.ScrollPane; -import javafx.scene.control.TextField; import javafx.scene.image.ImageView; import javafx.scene.input.MouseEvent; import javafx.scene.layout.HBox; @@ -32,19 +29,10 @@ import java.util.ResourceBundle; * a page where you can search for images and sort them * @version 1.0 22.03.2020 */ -public class Search implements Initializable { - - public ImageView tbar_logo; - public TextField tbar_search; - public Button tbar_searchBtn; - public Button tbar_explore; - public Button tbar_map; - public Button tbar_upload; - public Button tbar_albums; +public class Search extends NavBarController implements Initializable { public Text search_result; public ScrollPane scrollpane; - public ChoiceBox sorted_by_choicebox; public VBox vBox; public Text amount; @@ -154,63 +142,6 @@ public class Search implements Initializable { return text; } - /** - * Method that changes scene to Main page - * @param mouseEvent - * @throws IOException - */ - public void switchToMain(MouseEvent mouseEvent) throws IOException { - App.setRoot("main"); - } - - /** - * Method that changes scene to Search page. It reads the value of the search - * field and if not empty it is passed to dataexchange - * @param actionEvent - * @throws IOException - */ - public void switchToSearch(ActionEvent actionEvent) throws IOException { - if (!tbar_search.getText().isEmpty()){ - App.ex.setSearchField(tbar_search.getText()); - } - App.setRoot("search"); - } - - /** - * Method that changes scene to Explore page - * @param actionEvent - * @throws IOException - */ - public void switchToExplore(ActionEvent actionEvent) throws IOException { - App.setRoot("explore"); - } - - /** - * Method that changes scene to Albums page - * @param actionEvent - * @throws IOException - */ - public void switchToAlbums(ActionEvent actionEvent) throws IOException { - App.setRoot("explore_albums"); - } - - /** - * Method that changes scene to Map page - * @param actionEvent - * @throws IOException - */ - public void switchToMap(ActionEvent actionEvent) throws IOException { - App.setRoot("map"); - } - - /** - * Method that changes scene to Upload page - * @param actionEvent the mouse has done something - * @throws IOException this page does not exist - */ - public void switchToUpload(ActionEvent actionEvent) throws IOException { - App.setRoot("upload"); - } /** * Method that updates content to previous "page" diff --git a/src/main/java/NTNU/IDATT1002/controllers/SearchResults.java b/src/main/java/NTNU/IDATT1002/controllers/SearchResults.java index 63f64c768e91d9ef06d2a749e0ffb5566f52a238..e3f92fa09c5d0b6752aadeca92a6478b0714bf6d 100644 --- a/src/main/java/NTNU/IDATT1002/controllers/SearchResults.java +++ b/src/main/java/NTNU/IDATT1002/controllers/SearchResults.java @@ -1,6 +1,6 @@ package NTNU.IDATT1002.controllers; -public class SearchResults { +public class SearchResults extends NavBarController { } diff --git a/src/main/java/NTNU/IDATT1002/controllers/Upload.java b/src/main/java/NTNU/IDATT1002/controllers/Upload.java index 8f51a6595baeee5cbc143e264f83d72bea58b095..5b80584857109ee3ad1a8ac6ffb1e2e2600d4a8a 100644 --- a/src/main/java/NTNU/IDATT1002/controllers/Upload.java +++ b/src/main/java/NTNU/IDATT1002/controllers/Upload.java @@ -7,12 +7,8 @@ package NTNU.IDATT1002.controllers; import NTNU.IDATT1002.App; -import javafx.event.ActionEvent; import javafx.scene.control.Button; -import javafx.scene.control.TextField; -import javafx.scene.image.ImageView; import javafx.scene.input.DragEvent; -import javafx.scene.input.MouseEvent; import javafx.scene.input.TransferMode; import javafx.scene.layout.Pane; import javafx.stage.FileChooser; @@ -28,75 +24,10 @@ import java.util.stream.Collectors; * a page where you select images to upload * @version 1.0 22.03.2020 */ -public class Upload { - public ImageView tbar_logo; - public TextField tbar_search; - public Button tbar_searchBtn; - public Button tbar_explore; - public Button tbar_map; - public Button tbar_upload; +public class Upload extends NavBarController { public Button uploadBtn; public Pane drag_drop; - public Button tbar_albums; - - /** - * Method that changes scene to Main page - * @param mouseEvent - * @throws IOException - */ - public void switchToMain(MouseEvent mouseEvent) throws IOException { - App.setRoot("main"); - } - - /** - * Method that changes scene to Search page. It reads the value of the search - * field and if not empty it is passed to dataexchange - * @param actionEvent - * @throws IOException - */ - public void switchToSearch(ActionEvent actionEvent) throws IOException { - if (!tbar_search.getText().isEmpty()){ - App.ex.setSearchField(tbar_search.getText()); - } - App.setRoot("search"); - } - - /** - * Method that changes scene to Explore page - * @param actionEvent - * @throws IOException - */ - public void switchToExplore(ActionEvent actionEvent) throws IOException { - App.setRoot("explore"); - } - - /** - * Method that changes scene to Albums page - * @param actionEvent - * @throws IOException - */ - public void switchToAlbums(ActionEvent actionEvent) throws IOException { - App.setRoot("explore_albums"); - } - - /** - * Method that changes scene to Map page - * @param actionEvent - * @throws IOException - */ - public void switchToMap(ActionEvent actionEvent) throws IOException { - App.setRoot("map"); - } - - /** - * Method that changes scene to Upload page - * @param actionEvent the mouse has done something - * @throws IOException this page does not exist - */ - public void switchToUpload(ActionEvent actionEvent) throws IOException { - App.setRoot("upload"); - } /** * Method that changs scene to Uploaded Single page diff --git a/src/main/java/NTNU/IDATT1002/controllers/UploadImages.java b/src/main/java/NTNU/IDATT1002/controllers/UploadImages.java index 459d20837f8b51aab14f402a3ea045d963df8bb5..8f26e9def2a737fa0c78078eac47490335e77881 100644 --- a/src/main/java/NTNU/IDATT1002/controllers/UploadImages.java +++ b/src/main/java/NTNU/IDATT1002/controllers/UploadImages.java @@ -10,7 +10,6 @@ import NTNU.IDATT1002.service.TagService; import NTNU.IDATT1002.utils.MetaDataExtractor; import javafx.collections.FXCollections; import javafx.collections.ObservableList; -import javafx.event.ActionEvent; import javafx.fxml.Initializable; import javafx.geometry.Insets; import javafx.geometry.Pos; @@ -22,7 +21,6 @@ import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.image.Image; import javafx.scene.image.ImageView; -import javafx.scene.input.MouseEvent; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.scene.text.Font; @@ -49,17 +47,7 @@ import java.util.stream.Collectors; public class UploadImages implements Initializable { public VBox uploadContainer; - - public ImageView tbar_logo; - public TextField tbar_search; - public Button tbar_searchBtn; - public Button tbar_explore; - public Button tbar_map; - public Button tbar_upload; - - public Button tbar_albums; public VBox root; - private AlbumService albumService; private ImageService imageService; @@ -232,70 +220,6 @@ public class UploadImages implements Initializable { textContainer.getChildren().add(checkComboBox); } - /** - * Method that changes stage to Main page - * - * @param mouseEvent - * @throws IOException - */ - public void switchToMain(MouseEvent mouseEvent) throws IOException { - App.setRoot("main"); - } - - /** - * Method that changes stage to Search page. It reads the value of the search - * field and if not empty it is passed to dataexchange - * - * @param actionEvent - * @throws IOException - */ - public void switchToSearch(ActionEvent actionEvent) throws IOException { - if (!tbar_search.getText().isEmpty()) { - App.ex.setSearchField(tbar_search.getText()); - } - App.setRoot("search"); - } - - /** - * Method that changes stage to Explore page - * - * @param actionEvent - * @throws IOException - */ - public void switchToExplore(ActionEvent actionEvent) throws IOException { - App.setRoot("explore"); - } - - /** - * Method that changes stage to Albums page - * - * @param actionEvent - * @throws IOException - */ - public void switchToAlbums(ActionEvent actionEvent) throws IOException { - App.setRoot("explore_albums"); - } - - /** - * Method that changes stage to Map page - * - * @param actionEvent - * @throws IOException - */ - public void switchToMap(ActionEvent actionEvent) throws IOException { - App.setRoot("map"); - } - - /** - * Method that changes stage to Upload page - * - * @param actionEvent - * @throws IOException - */ - public void switchToUpload(ActionEvent actionEvent) throws IOException { - App.setRoot("upload"); - } - /** * Method for uploading image to database with tags * Image itself is not stored but URL is diff --git a/src/main/java/NTNU/IDATT1002/controllers/ViewAlbum.java b/src/main/java/NTNU/IDATT1002/controllers/ViewAlbum.java index b947f21fe292c2ac4fd934f5fc1fb9471f1ccba3..75a63ead0fa62265c4db7b7d26a25286ec137dcc 100644 --- a/src/main/java/NTNU/IDATT1002/controllers/ViewAlbum.java +++ b/src/main/java/NTNU/IDATT1002/controllers/ViewAlbum.java @@ -16,7 +16,6 @@ import javafx.geometry.Insets; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Button; -import javafx.scene.control.TextField; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.input.MouseEvent; @@ -27,10 +26,7 @@ import javafx.scene.layout.VBox; import javafx.scene.text.Font; import javafx.scene.text.FontWeight; import javafx.scene.text.Text; -import javax.persistence.EntityManager; - import javafx.stage.Stage; -import org.slf4j.LoggerFactory; import javax.persistence.EntityManager; import java.io.File; @@ -47,13 +43,7 @@ import java.util.stream.Collectors; * @version 1.0 22.03.2020 */ public class ViewAlbum implements Initializable { - public TextField tbar_search; - public ImageView tbar_logo; - public Button tbar_explore; - public Button tbar_map; - public Button tbar_upload; - public Button tbar_searchBtn; - public Button tbar_albums; + public Pane metadataPane; public Button createAlbumPdf; public ImageView mainImageContainer; @@ -68,8 +58,6 @@ public class ViewAlbum implements Initializable { private AlbumService albumService; private Album currentAlbum; - - /** * Initialize view with real album data. * @@ -226,70 +214,6 @@ public class ViewAlbum implements Initializable { textContainer.getChildren().addAll(descriptionLabel, description); } - /** - * Method that changes scene to Main page - * @param mouseEvent - * @throws IOException - */ - public void switchToMain(MouseEvent mouseEvent) throws IOException { - App.ex.setChosenAlbumId(null); - App.setRoot("main"); - } - - /** - * Method that changes scene to Search page. It reads the value of the search - * field and if not empty it is passed to dataexchange - * @param actionEvent - * @throws IOException - */ - public void switchToSearch(ActionEvent actionEvent) throws IOException { - if (!tbar_search.getText().isEmpty()){ - App.ex.setSearchField(tbar_search.getText()); - } - App.ex.setChosenAlbumId(null); - App.setRoot("search"); - } - - /** - * Method that changes scene to Explore page - * @param actionEvent - * @throws IOException - */ - public void switchToExplore(ActionEvent actionEvent) throws IOException { - App.ex.setChosenAlbumId(null); - App.setRoot("explore"); - } - - /** - * Method that changes scene to Albums page - * @param actionEvent - * @throws IOException - */ - public void switchToAlbums(ActionEvent actionEvent) throws IOException { - App.ex.setChosenAlbumId(null); - App.setRoot("explore_albums"); - } - - /** - * Method that changes scene to Map page - * @param actionEvent - * @throws IOException - */ - public void switchToMap(ActionEvent actionEvent) throws IOException { - App.ex.setChosenAlbumId(null); - App.setRoot("map"); - } - - /** - * Method that changes scene to Upload page - * @param actionEvent the mouse has done something - * @throws IOException this page does not exist - */ - public void switchToUpload(ActionEvent actionEvent) throws IOException { - App.ex.setChosenAlbumId(null); - App.setRoot("upload"); - } - /** * Makes a new stage and display the clicked image in max size * @param mouseEvent @@ -308,7 +232,6 @@ public class ViewAlbum implements Initializable { imageView.setImage(((ImageView) clickedObject).getImage()); pane.setCenter(imageView); - Scene scene = new Scene(pane); stage.setMaximized(true); stage.setScene(scene); @@ -350,6 +273,6 @@ public class ViewAlbum implements Initializable { } public void viewOnMap(ActionEvent actionEvent) throws IOException { - App.setRoot("map"); + App.setRoot("map"); // TODO: 15.04.2020 Set App.ex.chosenAlbumId? } } diff --git a/src/main/java/NTNU/IDATT1002/controllers/ViewImage.java b/src/main/java/NTNU/IDATT1002/controllers/ViewImage.java index ba4488f5f75cc5b904b1f3030fc32d97394d8521..de5211c55b0ebe76c0d1451617b9a665eebdf8a1 100644 --- a/src/main/java/NTNU/IDATT1002/controllers/ViewImage.java +++ b/src/main/java/NTNU/IDATT1002/controllers/ViewImage.java @@ -4,23 +4,17 @@ import NTNU.IDATT1002.App; import NTNU.IDATT1002.service.ImageService; import NTNU.IDATT1002.service.TagService; import NTNU.IDATT1002.utils.ImageUtil; -import NTNU.IDATT1002.utils.MetaDataExtractor; -import javafx.event.ActionEvent; import javafx.fxml.Initializable; import javafx.scene.Node; import javafx.scene.Scene; -import javafx.scene.control.Button; -import javafx.scene.control.TextField; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.input.MouseEvent; import javafx.scene.layout.BorderPane; -import javafx.scene.layout.Pane; import javafx.scene.text.Text; import javafx.stage.Stage; import javax.persistence.EntityManager; -import java.io.IOException; import java.net.URL; import java.util.Optional; import java.util.ResourceBundle; @@ -32,25 +26,16 @@ import java.util.ResourceBundle; * @version 1.0 22.03.2020 */ public class ViewImage implements Initializable{ - public ImageView tbar_logo; - public TextField tbar_search; - public Button tbar_explore; - public Button tbar_map; - public Button tbar_upload; - public Button tbar_searchBtn; - public Button tbar_albums; public ImageView imageContainer; public Text imageTagsField; public Text imageTitleField; public Text imageMetadataField; - private ImageService imageService; - @Override public void initialize(URL url, ResourceBundle resourceBundle) { EntityManager entityManager = App.ex.getEntityManager(); - imageService = new ImageService(entityManager); + ImageService imageService = new ImageService(entityManager); Long currentImageId = App.ex.getChosenImg(); Optional<NTNU.IDATT1002.models.Image> foundImage = imageService.findById(currentImageId); imageContainer.setFitHeight(540); @@ -64,64 +49,6 @@ public class ViewImage implements Initializable{ }); } - /** - * Method that changes scene to Main page - * @param mouseEvent - * @throws IOException - */ - public void switchToMain(MouseEvent mouseEvent) throws IOException { - App.setRoot("main"); - } - - /** - * Method that changes scene to Search page. It reads the value of the search - * field and if not empty it is passed to dataexchange - * @param actionEvent - * @throws IOException - */ - public void switchToSearch(ActionEvent actionEvent) throws IOException { - if (!tbar_search.getText().isEmpty()){ - App.ex.setSearchField(tbar_search.getText()); - } - App.setRoot("search"); - } - - /** - * Method that changes scene to Explore page - * @param actionEvent - * @throws IOException - */ - public void switchToExplore(ActionEvent actionEvent) throws IOException { - App.setRoot("explore"); - } - - /** - * Method that changes scene to Albums page - * @param actionEvent - * @throws IOException - */ - public void switchToAlbums(ActionEvent actionEvent) throws IOException { - App.setRoot("explore_albums"); - } - - /** - * Method that changes scene to Map page - * @param actionEvent - * @throws IOException - */ - public void switchToMap(ActionEvent actionEvent) throws IOException { - App.setRoot("map"); - } - - /** - * Method that changes scene to Upload page - * @param actionEvent the mouse has done something - * @throws IOException this page does not exist - */ - public void switchToUpload(ActionEvent actionEvent) throws IOException { - App.setRoot("upload"); - } - /** * Makes a new stage and display the clicked image in max size * @param mouseEvent diff --git a/src/main/resources/NTNU/IDATT1002/create_album.fxml b/src/main/resources/NTNU/IDATT1002/create_album.fxml index 6ab9cf5f3120c7582a4342623bbae8c5921c2cc4..fe0324608a27d7577bb53b01c296ffa426a7a8a5 100644 --- a/src/main/resources/NTNU/IDATT1002/create_album.fxml +++ b/src/main/resources/NTNU/IDATT1002/create_album.fxml @@ -10,19 +10,19 @@ <children> <HBox alignment="CENTER" minHeight="100.0" prefHeight="100.0" prefWidth="1920.0" spacing="20.0" style="-fx-background-color: #0c0c0c;"> <children> - <ImageView fx:id="tbar_logo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="navBarLogo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../../Images/PlaceholderLogo.png" /> </image> </ImageView> <Pane prefHeight="100.0" prefWidth="343.0" /> - <TextField fx:id="tbar_search" prefHeight="25.0" prefWidth="358.0" promptText="Search: Tags, Albums, Metadata, etc..." /> - <Button fx:id="tbar_searchBtn" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" /> - <Button fx:id="tbar_explore" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" /> - <Button fx:id="tbar_albums" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" /> - <Button fx:id="tbar_map" mnemonicParsing="false" onAction="#switchToMap" text="MAP" /> + <TextField fx:id="navBarSearch" prefHeight="25.0" prefWidth="358.0" promptText="Search: Tags, Albums, Metadata, etc..." /> + <Button fx:id="navBarSearchBtn" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" /> + <Button fx:id="navBarExplore" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" /> + <Button fx:id="navBarAlbums" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" /> + <Button fx:id="navBarMap" 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" /> + <Button fx:id="navBarUpload" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" /> </children> </HBox> <HBox prefHeight="981.0" prefWidth="1920.0" VBox.vgrow="ALWAYS"> diff --git a/src/main/resources/NTNU/IDATT1002/explore.fxml b/src/main/resources/NTNU/IDATT1002/explore.fxml index 68de69b744aadb8653cc95e5940d804b4a7ca2e1..4dac2119a131c6da61a78ffe94910b0969704540 100644 --- a/src/main/resources/NTNU/IDATT1002/explore.fxml +++ b/src/main/resources/NTNU/IDATT1002/explore.fxml @@ -23,7 +23,7 @@ <children> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="250.0"> <children> - <ImageView fx:id="tbar_logo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="navBarLogo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../../Images/PlaceholderLogo.png" /> </image> @@ -36,18 +36,18 @@ <Insets /> </opaqueInsets> </HBox> - <TextField fx:id="tbar_search" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> + <TextField fx:id="navBarSearch" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> <HBox.margin> <Insets /> </HBox.margin> </TextField> - <Button fx:id="tbar_searchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> - <Button fx:id="tbar_explore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> - <Button fx:id="tbar_albums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> - <Button fx:id="tbar_map" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> + <Button fx:id="navBarSearchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> + <Button fx:id="navBarExplore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> + <Button fx:id="navBarAlbums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> + <Button fx:id="navBarMap" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> <HBox alignment="CENTER_RIGHT" prefHeight="100.0" prefWidth="250.0"> <children> - <Button fx:id="tbar_upload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> + <Button fx:id="navBarUpload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> </children> </HBox> </children> diff --git a/src/main/resources/NTNU/IDATT1002/explore_albums.fxml b/src/main/resources/NTNU/IDATT1002/explore_albums.fxml index a3de8ca9acf8f67d21fbe0f77003c22ad0e623aa..e559384ed78b00e1511d346fdf0db25ed60f324b 100644 --- a/src/main/resources/NTNU/IDATT1002/explore_albums.fxml +++ b/src/main/resources/NTNU/IDATT1002/explore_albums.fxml @@ -31,7 +31,7 @@ <children> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="250.0"> <children> - <ImageView fx:id="tbar_logo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="navBarLogo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../../Images/PlaceholderLogo.png" /> </image> @@ -44,18 +44,18 @@ <Insets /> </opaqueInsets> </HBox> - <TextField fx:id="tbar_search" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> + <TextField fx:id="navBarSearch" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> <HBox.margin> <Insets /> </HBox.margin> </TextField> - <Button fx:id="tbar_searchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> - <Button fx:id="tbar_explore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> - <Button fx:id="tbar_albums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> - <Button fx:id="tbar_map" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> + <Button fx:id="navBarSearchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> + <Button fx:id="navBarExplore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> + <Button fx:id="navBarAlbums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> + <Button fx:id="navBarMap" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> <HBox alignment="CENTER_RIGHT" prefHeight="100.0" prefWidth="250.0"> <children> - <Button fx:id="tbar_upload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> + <Button fx:id="navBarUpload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> </children> </HBox> </children> diff --git a/src/main/resources/NTNU/IDATT1002/main.fxml b/src/main/resources/NTNU/IDATT1002/main.fxml index 5d256edfc0469c31704c7116644ff9b388205a18..40cf6a248dc17add3b9a7be2111c3532fc9f7fda 100644 --- a/src/main/resources/NTNU/IDATT1002/main.fxml +++ b/src/main/resources/NTNU/IDATT1002/main.fxml @@ -17,7 +17,7 @@ <children> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="250.0"> <children> - <ImageView fx:id="tbar_logo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="navBarLogo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../../Images/PlaceholderLogo.png" /> </image> @@ -30,18 +30,18 @@ <Insets /> </opaqueInsets> </HBox> - <TextField fx:id="tbar_search" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> + <TextField fx:id="navBarSearch" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> <HBox.margin> <Insets /> </HBox.margin> </TextField> - <Button fx:id="tbar_searchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> - <Button fx:id="tbar_explore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> - <Button fx:id="tbar_albums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> - <Button fx:id="tbar_map" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> + <Button fx:id="navBarSearchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> + <Button fx:id="navBarExplore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> + <Button fx:id="navBarAlbums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> + <Button fx:id="navBarMap" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> <HBox alignment="CENTER_RIGHT" prefHeight="100.0" prefWidth="250.0"> <children> - <Button fx:id="tbar_upload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> + <Button fx:id="navBarUpload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> </children> </HBox> </children> diff --git a/src/main/resources/NTNU/IDATT1002/map.fxml b/src/main/resources/NTNU/IDATT1002/map.fxml index 994b816e731d40dab7670ac5f579cc373c926c54..9c352273a7df656dbcf8ceef0f566ad97b5ce616 100644 --- a/src/main/resources/NTNU/IDATT1002/map.fxml +++ b/src/main/resources/NTNU/IDATT1002/map.fxml @@ -23,7 +23,7 @@ <children> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="250.0"> <children> - <ImageView fx:id="tbar_logo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="navBarLogo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../../Images/PlaceholderLogo.png" /> </image> @@ -36,18 +36,18 @@ <Insets /> </opaqueInsets> </HBox> - <TextField fx:id="tbar_search" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> + <TextField fx:id="navBarSearch" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> <HBox.margin> <Insets /> </HBox.margin> </TextField> - <Button fx:id="tbar_searchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> - <Button fx:id="tbar_explore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> - <Button fx:id="tbar_albums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> - <Button fx:id="tbar_map" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> + <Button fx:id="navBarSearchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> + <Button fx:id="navBarExplore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> + <Button fx:id="navBarAlbums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> + <Button fx:id="navBarMap" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> <HBox alignment="CENTER_RIGHT" prefHeight="100.0" prefWidth="250.0"> <children> - <Button fx:id="tbar_upload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> + <Button fx:id="navBarUpload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> </children> </HBox> </children> diff --git a/src/main/resources/NTNU/IDATT1002/search.fxml b/src/main/resources/NTNU/IDATT1002/search.fxml index a6ad0e69424a2584a28f54d27ed4084b63a02269..ee2904f1d66801527889d3b97ba8328b649330e3 100644 --- a/src/main/resources/NTNU/IDATT1002/search.fxml +++ b/src/main/resources/NTNU/IDATT1002/search.fxml @@ -19,7 +19,7 @@ <children> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="250.0"> <children> - <ImageView fx:id="tbar_logo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="navBarLogo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../../Images/PlaceholderLogo.png" /> </image> @@ -32,18 +32,18 @@ <Insets /> </opaqueInsets> </HBox> - <TextField fx:id="tbar_search" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> + <TextField fx:id="navBarSearch" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> <HBox.margin> <Insets /> </HBox.margin> </TextField> - <Button fx:id="tbar_searchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> - <Button fx:id="tbar_explore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> - <Button fx:id="tbar_albums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> - <Button fx:id="tbar_map" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> + <Button fx:id="navBarSearchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> + <Button fx:id="navBarExplore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> + <Button fx:id="navBarAlbums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> + <Button fx:id="navBarMap" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> <HBox alignment="CENTER_RIGHT" prefHeight="100.0" prefWidth="250.0"> <children> - <Button fx:id="tbar_upload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> + <Button fx:id="navBarUpload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> </children> </HBox> </children> diff --git a/src/main/resources/NTNU/IDATT1002/search_results.fxml b/src/main/resources/NTNU/IDATT1002/search_results.fxml index 41d3b66acca1e24cb239fc131856b024892b556f..7d48be4ccc658809abf0bc3efe2639967c283b8c 100644 --- a/src/main/resources/NTNU/IDATT1002/search_results.fxml +++ b/src/main/resources/NTNU/IDATT1002/search_results.fxml @@ -21,7 +21,7 @@ <children> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="250.0"> <children> - <ImageView fx:id="tbar_logo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="navBarLogo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../../Images/PlaceholderLogo.png" /> </image> @@ -34,18 +34,18 @@ <Insets /> </opaqueInsets> </HBox> - <TextField fx:id="tbar_search" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> + <TextField fx:id="navBarSearch" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> <HBox.margin> <Insets /> </HBox.margin> </TextField> - <Button fx:id="tbar_searchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> - <Button fx:id="tbar_explore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> - <Button fx:id="tbar_albums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> - <Button fx:id="tbar_map" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> + <Button fx:id="navBarSearchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> + <Button fx:id="navBarExplore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> + <Button fx:id="navBarAlbums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> + <Button fx:id="navBarMap" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> <HBox alignment="CENTER_RIGHT" prefHeight="100.0" prefWidth="250.0"> <children> - <Button fx:id="tbar_upload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> + <Button fx:id="navBarUpload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> </children> </HBox> </children> diff --git a/src/main/resources/NTNU/IDATT1002/upload.fxml b/src/main/resources/NTNU/IDATT1002/upload.fxml index f7c73bebb4c7703fb45ae7d0e9b6d5c64273d40d..6220872fea91bed01b037664e06d3b8100a94a70 100644 --- a/src/main/resources/NTNU/IDATT1002/upload.fxml +++ b/src/main/resources/NTNU/IDATT1002/upload.fxml @@ -19,7 +19,7 @@ <children> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="250.0"> <children> - <ImageView fx:id="tbar_logo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="navBarLogo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../../Images/PlaceholderLogo.png" /> </image> @@ -32,18 +32,18 @@ <Insets /> </opaqueInsets> </HBox> - <TextField fx:id="tbar_search" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> + <TextField fx:id="navBarSearch" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> <HBox.margin> <Insets /> </HBox.margin> </TextField> - <Button fx:id="tbar_searchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> - <Button fx:id="tbar_explore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> - <Button fx:id="tbar_albums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> - <Button fx:id="tbar_map" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> + <Button fx:id="navBarSearchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> + <Button fx:id="navBarExplore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> + <Button fx:id="navBarAlbums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> + <Button fx:id="navBarMap" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> <HBox alignment="CENTER_RIGHT" prefHeight="100.0" prefWidth="250.0"> <children> - <Button fx:id="tbar_upload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> + <Button fx:id="navBarUpload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> </children> </HBox> </children> diff --git a/src/main/resources/NTNU/IDATT1002/upload_images.fxml b/src/main/resources/NTNU/IDATT1002/upload_images.fxml index 6e8ceafec8bf0a5c4fe24ed676bcfb7659091e3a..a880032383a2645ef94906edbd3dbf1d6c7ca67c 100644 --- a/src/main/resources/NTNU/IDATT1002/upload_images.fxml +++ b/src/main/resources/NTNU/IDATT1002/upload_images.fxml @@ -15,19 +15,19 @@ <children> <HBox alignment="CENTER" minHeight="100.0" prefHeight="100.0" prefWidth="1920.0" spacing="20.0" style="-fx-background-color: #0c0c0c;"> <children> - <ImageView fx:id="tbar_logo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="navBarLogo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../../Images/PlaceholderLogo.png" /> </image> </ImageView> <Pane prefHeight="100.0" prefWidth="343.0" /> - <TextField fx:id="tbar_search" prefHeight="25.0" prefWidth="358.0" promptText="Search: Tags, Albums, Metadata, etc..." /> - <Button fx:id="tbar_searchBtn" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" /> - <Button fx:id="tbar_explore" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" /> - <Button fx:id="tbar_albums" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" /> - <Button fx:id="tbar_map" mnemonicParsing="false" onAction="#switchToMap" text="MAP" /> + <TextField fx:id="navBarSearch" prefHeight="25.0" prefWidth="358.0" promptText="Search: Tags, Albums, Metadata, etc..." /> + <Button fx:id="navBarSearchBtn" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" /> + <Button fx:id="navBarExplore" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" /> + <Button fx:id="navBarAlbums" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" /> + <Button fx:id="navBarMap" 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" /> + <Button fx:id="navBarUpload" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" /> </children> </HBox> <HBox alignment="CENTER" prefHeight="982.0" prefWidth="1920.0"> diff --git a/src/main/resources/NTNU/IDATT1002/view_album.fxml b/src/main/resources/NTNU/IDATT1002/view_album.fxml index dfb00fecd1acc11285d0e586bab5cdb7179244a6..b375cd2ef23108ba92b4ea0504b9d5c0825a0fe6 100644 --- a/src/main/resources/NTNU/IDATT1002/view_album.fxml +++ b/src/main/resources/NTNU/IDATT1002/view_album.fxml @@ -20,7 +20,7 @@ <children> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="250.0"> <children> - <ImageView fx:id="tbar_logo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="navBarLogo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../../Images/PlaceholderLogo.png" /> </image> @@ -33,18 +33,18 @@ <Insets /> </opaqueInsets> </HBox> - <TextField fx:id="tbar_search" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> + <TextField fx:id="navBarSearch" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> <HBox.margin> <Insets /> </HBox.margin> </TextField> - <Button fx:id="tbar_searchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> - <Button fx:id="tbar_explore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> - <Button fx:id="tbar_albums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> - <Button fx:id="tbar_map" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> + <Button fx:id="navBarSearchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> + <Button fx:id="navBarExplore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> + <Button fx:id="navBarAlbums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> + <Button fx:id="navBarMap" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> <HBox alignment="CENTER_RIGHT" prefHeight="100.0" prefWidth="250.0"> <children> - <Button fx:id="tbar_upload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> + <Button fx:id="navBarUpload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> </children> </HBox> </children> diff --git a/src/main/resources/NTNU/IDATT1002/view_image.fxml b/src/main/resources/NTNU/IDATT1002/view_image.fxml index 9eebb690cb2a9cddeeae04a65bfe91b72cd36ed4..0a6d0b4b096be7d23e32525b6e08f31ab8ebfbbe 100644 --- a/src/main/resources/NTNU/IDATT1002/view_image.fxml +++ b/src/main/resources/NTNU/IDATT1002/view_image.fxml @@ -19,7 +19,7 @@ <children> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="250.0"> <children> - <ImageView fx:id="tbar_logo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> + <ImageView fx:id="navBarLogo" fitHeight="69.0" fitWidth="153.0" onMouseClicked="#switchToMain" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../../Images/PlaceholderLogo.png" /> </image> @@ -32,18 +32,18 @@ <Insets /> </opaqueInsets> </HBox> - <TextField fx:id="tbar_search" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> + <TextField fx:id="navBarSearch" focusTraversable="false" minWidth="200.0" prefHeight="35.0" prefWidth="400.0" promptText="Search: Tags, Albums, Metadata, etc..."> <HBox.margin> <Insets /> </HBox.margin> </TextField> - <Button fx:id="tbar_searchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> - <Button fx:id="tbar_explore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> - <Button fx:id="tbar_albums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> - <Button fx:id="tbar_map" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> + <Button fx:id="navBarSearchBtn" minWidth="70" mnemonicParsing="false" onAction="#switchToSearch" text="SEARCH" textFill="white" /> + <Button fx:id="navBarExplore" minWidth="70" mnemonicParsing="false" onAction="#switchToExplore" text="EXPLORE" textFill="white" /> + <Button fx:id="navBarAlbums" minWidth="70" mnemonicParsing="false" onAction="#switchToAlbums" text="ALBUMS" textFill="white" /> + <Button fx:id="navBarMap" minWidth="50" mnemonicParsing="false" onAction="#switchToMap" text="MAP" textFill="white" /> <HBox alignment="CENTER_RIGHT" prefHeight="100.0" prefWidth="250.0"> <children> - <Button fx:id="tbar_upload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> + <Button fx:id="navBarUpload" minWidth="70" mnemonicParsing="false" onAction="#switchToUpload" prefHeight="25.0" prefWidth="114.0" text="UPLOAD" textFill="white" /> </children> </HBox> </children>