Package NTNU.IDATT1002.controllers
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 Summary
Fields Modifier and Type Field Description javafx.scene.control.Button
createAlbumButton
Fields inherited from class NTNU.IDATT1002.controllers.NavBarController
navBarAlbums, navBarExplore, navBarLogo, navBarLogOut, navBarMap, navBarSearch, navBarSearchBtn, navBarUpload, returnButton
-
Constructor Summary
Constructors Constructor Description ExploreAlbums()
TellPaginatedContent
which fields to sortAlbum
s by. -
Method Summary
Modifier and Type Method Description java.util.List<javafx.scene.layout.HBox>
computeRootAlbumsContainerChildren(java.util.List<Album> albums)
Create aHBox
of albumHBox
children to add to a root container.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 needprotected PageableService<Album>
getService()
Return anAlbumService
to use inPaginatedContent
.void
switchToCreateAlbum(javafx.event.ActionEvent actionEvent)
Change scene to Create Album page.void
switchToViewAlbum(javafx.scene.input.MouseEvent mouseEvent)
Open specific albums.Methods inherited from class NTNU.IDATT1002.controllers.PaginatedContent
createAndShowResultsSelection, getPageFactory, getPageTaskFor, initialize, pageChanged, pageSizeSelectionChanged, scrollToTop, updatePage
Methods inherited from class NTNU.IDATT1002.controllers.NavBarController
doBeforePageExit, enterSearch, goToPrevious, logOut, search, switchToAlbums, switchToExplore, switchToMain, switchToMap, switchToSearch, switchToUpload
-
Field Details
-
createAlbumButton
public javafx.scene.control.Button createAlbumButton
-
-
Constructor Details
-
ExploreAlbums
public ExploreAlbums()TellPaginatedContent
which fields to sortAlbum
s by. TellDataExchange
that explore albums page is visited.
-
-
Method Details
-
getService
Return anAlbumService
to use inPaginatedContent
.- Specified by:
getService
in classPaginatedContent<Album>
-
getContentsFrom
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 classPaginatedContent<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 aHBox
of albumHBox
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.IOExceptionChange 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.IOExceptionOpen 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
-