Package NTNU.IDATT1002.controllers
Class NavBarController
java.lang.Object
NTNU.IDATT1002.controllers.NavBarController
- Direct Known Subclasses:
CreateAlbum,Main,Map,PaginatedContent,Search,Upload,UploadImages,ViewAlbum,ViewImage
public class NavBarController
extends java.lang.Object
Class for controlling actions in the navigation bar
- Version:
- 1.0.1 24.04.2020
-
Field Summary
Fields Modifier and Type Field Description javafx.scene.control.ButtonnavBarAlbumsjavafx.scene.control.ButtonnavBarExplorejavafx.scene.image.ImageViewnavBarLogojavafx.scene.control.ButtonnavBarLogOutjavafx.scene.control.ButtonnavBarMapjavafx.scene.control.TextFieldnavBarSearchjavafx.scene.control.ButtonnavBarSearchBtnjavafx.scene.control.ButtonnavBarUploadjavafx.scene.control.ButtonreturnButton -
Constructor Summary
Constructors Constructor Description NavBarController() -
Method Summary
Modifier and Type Method Description voiddoBeforePageExit()Actions to perform when exiting the page.voidenterSearch(javafx.scene.input.KeyEvent keyEvent)Method that calls the search method when the Enter key is pressed while the search field is in focusvoidgoToPrevious(javafx.event.ActionEvent actionEvent)IfDataExchangehas a previous page it changes to it.voidlogOut(javafx.event.ActionEvent actionEvent)Method for logging out user.voidsearch()Method that changes scene to Search page.voidswitchToAlbums(javafx.event.ActionEvent actionEvent)Method that changes scene to Albums pagevoidswitchToExplore(javafx.event.ActionEvent actionEvent)Method that changes scene to Explore pagevoidswitchToMain(javafx.scene.input.MouseEvent mouseEvent)Method that changes scene to Main pagevoidswitchToMap(javafx.event.ActionEvent actionEvent)Method that changes scene to Map pagevoidswitchToSearch(javafx.event.ActionEvent actionEvent)Method that calls the search method when the search button is pressedvoidswitchToUpload(javafx.event.ActionEvent actionEvent)Method that changes scene to Upload page
-
Field Details
-
navBarLogo
public javafx.scene.image.ImageView navBarLogo -
navBarSearch
public javafx.scene.control.TextField navBarSearch -
navBarSearchBtn
public javafx.scene.control.Button navBarSearchBtn -
navBarExplore
public javafx.scene.control.Button navBarExplore -
navBarMap
public javafx.scene.control.Button navBarMap -
navBarUpload
public javafx.scene.control.Button navBarUpload -
navBarAlbums
public javafx.scene.control.Button navBarAlbums -
navBarLogOut
public javafx.scene.control.Button navBarLogOut -
returnButton
public javafx.scene.control.Button returnButton
-
-
Constructor Details
-
NavBarController
public NavBarController()
-
-
Method Details
-
switchToMain
public void switchToMain(javafx.scene.input.MouseEvent mouseEvent) throws java.io.IOExceptionMethod that changes scene to Main page- Parameters:
mouseEvent-- Throws:
java.io.IOException
-
goToPrevious
public void goToPrevious(javafx.event.ActionEvent actionEvent) throws java.io.IOExceptionIfDataExchangehas a previous page it changes to it.- Parameters:
actionEvent-- Throws:
java.io.IOException
-
search
public void search() throws java.io.IOExceptionMethod that changes scene to Search page. It reads the value of the search field and if not empty it is passed toDataExchange- Throws:
java.io.IOException
-
switchToSearch
public void switchToSearch(javafx.event.ActionEvent actionEvent) throws java.io.IOExceptionMethod that calls the search method when the search button is pressed- Parameters:
actionEvent-- Throws:
java.io.IOException
-
enterSearch
public void enterSearch(javafx.scene.input.KeyEvent keyEvent) throws java.io.IOExceptionMethod that calls the search method when the Enter key is pressed while the search field is in focus- Parameters:
keyEvent-- Throws:
java.io.IOException
-
switchToExplore
public void switchToExplore(javafx.event.ActionEvent actionEvent) throws java.io.IOExceptionMethod that changes scene to Explore page- Parameters:
actionEvent-- Throws:
java.io.IOException
-
switchToAlbums
public void switchToAlbums(javafx.event.ActionEvent actionEvent) throws java.io.IOExceptionMethod that changes scene to Albums page- Parameters:
actionEvent-- Throws:
java.io.IOException
-
switchToMap
public void switchToMap(javafx.event.ActionEvent actionEvent) throws java.io.IOExceptionMethod that changes scene to Map page- Parameters:
actionEvent-- Throws:
java.io.IOException
-
switchToUpload
public void switchToUpload(javafx.event.ActionEvent actionEvent) throws java.io.IOExceptionMethod that changes scene to Upload page- Parameters:
actionEvent-- Throws:
java.io.IOException
-
logOut
public void logOut(javafx.event.ActionEvent actionEvent) throws java.io.IOExceptionMethod for logging out user. Also empties the list of visited pages and chosen album inDataExchange.- Parameters:
actionEvent-- Throws:
java.io.IOException
-
doBeforePageExit
public void doBeforePageExit()Actions to perform when exiting the page. Can be implemented by subclasses to define custom actions on page exit.
-