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.Button
navBarAlbums
javafx.scene.control.Button
navBarExplore
javafx.scene.image.ImageView
navBarLogo
javafx.scene.control.Button
navBarLogOut
javafx.scene.control.Button
navBarMap
javafx.scene.control.TextField
navBarSearch
javafx.scene.control.Button
navBarSearchBtn
javafx.scene.control.Button
navBarUpload
javafx.scene.control.Button
returnButton
-
Constructor Summary
Constructors Constructor Description NavBarController()
-
Method Summary
Modifier and Type Method Description void
doBeforePageExit()
Actions to perform when exiting the page.void
enterSearch(javafx.scene.input.KeyEvent keyEvent)
Method that calls the search method when the Enter key is pressed while the search field is in focusvoid
goToPrevious(javafx.event.ActionEvent actionEvent)
IfDataExchange
has a previous page it changes to it.void
logOut(javafx.event.ActionEvent actionEvent)
Method for logging out user.void
search()
Method that changes scene to Search page.void
switchToAlbums(javafx.event.ActionEvent actionEvent)
Method that changes scene to Albums pagevoid
switchToExplore(javafx.event.ActionEvent actionEvent)
Method that changes scene to Explore pagevoid
switchToMain(javafx.scene.input.MouseEvent mouseEvent)
Method that changes scene to Main pagevoid
switchToMap(javafx.event.ActionEvent actionEvent)
Method that changes scene to Map pagevoid
switchToSearch(javafx.event.ActionEvent actionEvent)
Method that calls the search method when the search button is pressedvoid
switchToUpload(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.IOExceptionIfDataExchange
has 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.
-