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 focus
    void goToPrevious​(javafx.event.ActionEvent actionEvent)
    If DataExchange 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 page
    void switchToExplore​(javafx.event.ActionEvent actionEvent)
    Method that changes scene to Explore page
    void switchToMain​(javafx.scene.input.MouseEvent mouseEvent)
    Method that changes scene to Main page
    void switchToMap​(javafx.event.ActionEvent actionEvent)
    Method that changes scene to Map page
    void switchToSearch​(javafx.event.ActionEvent actionEvent)
    Method that calls the search method when the search button is pressed
    void switchToUpload​(javafx.event.ActionEvent actionEvent)
    Method that changes scene to Upload page

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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

  • Method Details

    • switchToMain

      public void switchToMain​(javafx.scene.input.MouseEvent mouseEvent) throws java.io.IOException
      Method that changes scene to Main page
      Parameters:
      mouseEvent -
      Throws:
      java.io.IOException
    • goToPrevious

      public void goToPrevious​(javafx.event.ActionEvent actionEvent) throws java.io.IOException
      If DataExchange has a previous page it changes to it.
      Parameters:
      actionEvent -
      Throws:
      java.io.IOException
    • search

      public void search() throws java.io.IOException
      Method that changes scene to Search page. It reads the value of the search field and if not empty it is passed to DataExchange
      Throws:
      java.io.IOException
    • switchToSearch

      public void switchToSearch​(javafx.event.ActionEvent actionEvent) throws java.io.IOException
      Method 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.IOException
      Method 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.IOException
      Method that changes scene to Explore page
      Parameters:
      actionEvent -
      Throws:
      java.io.IOException
    • switchToAlbums

      public void switchToAlbums​(javafx.event.ActionEvent actionEvent) throws java.io.IOException
      Method that changes scene to Albums page
      Parameters:
      actionEvent -
      Throws:
      java.io.IOException
    • switchToMap

      public void switchToMap​(javafx.event.ActionEvent actionEvent) throws java.io.IOException
      Method that changes scene to Map page
      Parameters:
      actionEvent -
      Throws:
      java.io.IOException
    • switchToUpload

      public void switchToUpload​(javafx.event.ActionEvent actionEvent) throws java.io.IOException
      Method that changes scene to Upload page
      Parameters:
      actionEvent -
      Throws:
      java.io.IOException
    • logOut

      public void logOut​(javafx.event.ActionEvent actionEvent) throws java.io.IOException
      Method for logging out user. Also empties the list of visited pages and chosen album in DataExchange.
      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.