Class ExploreAlbums

java.lang.Object
All Implemented Interfaces:
javafx.fxml.Initializable

public class ExploreAlbums
extends PaginatedContent<Album>
Controls the buttons and changeable elements on explore_albums.fxml, a page where you explore albums.
Version:
1.1 04.04.2020
  • Field Details

  • Constructor Details

  • Method Details

    • getService

      protected PageableService<Album> getService()
      Return an AlbumService to use in PaginatedContent.
      Specified by:
      getService in class PaginatedContent<Album>
    • getContentsFrom

      public java.util.List<javafx.scene.layout.HBox> getContentsFrom​(Page<Album> page)
      Uses computeRooAlbumsContainer to return a list og Hboxes with Page as parameter the getContent() gives us the specific content for the page we need
      Specified by:
      getContentsFrom in class PaginatedContent<Album>
      Parameters:
      page -
      Returns:
      a list of Hboxes with the Album content for the specific page
    • computeRootAlbumsContainerChildren

      public java.util.List<javafx.scene.layout.HBox> computeRootAlbumsContainerChildren​(java.util.List<Album> albums)
      Create a HBox of album HBox children to add to a root container. The limit is defined by the users choice from the list of amounts in PaginatedContent Load each corresponding preview images in a separate background task and add them when ready.
      Parameters:
      albums - the albums to add
      Returns:
      the list of HBoxes containing album contents
    • switchToCreateAlbum

      public void switchToCreateAlbum​(javafx.event.ActionEvent actionEvent) throws java.io.IOException
      Change scene to Create Album page.
      Parameters:
      actionEvent - the mouse has done something
      Throws:
      java.io.IOException - this page does not exist
    • switchToViewAlbum

      public void switchToViewAlbum​(javafx.scene.input.MouseEvent mouseEvent) throws java.io.IOException
      Open specific albums. It takes a clicked element within an album container and finds the fx:id of the main parent, (who's id is the same as the album in the database), and passes the value to Data Exchange so that Image View will know which album was clicked.
      Parameters:
      mouseEvent -
      Throws:
      java.io.IOException