Package Roots
Class AlbumDetailsRoot
- java.lang.Object
-
- Roots.SceneRoot
-
- Roots.AlbumDetailsRoot
-
final class AlbumDetailsRoot extends SceneRoot
Class for the album details root, which shows all the pictures in an album.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringalbumNameprivate java.util.Set<Photo>albumPhotoListprivate java.util.List<PhotoContainer>CONTAINERSprivate javafx.scene.control.ButtonDELETE_ALBUM_BUTTONprivate javafx.scene.control.ButtonDELETE_PHOTOS_BUTTONprivate javafx.scene.control.LabelDIALOG_FEEDBACK_LABELprivate javafx.scene.control.ButtonPDF_BUTTONprivate javafx.scene.control.TextFieldSAVE_LOCATIONprivate javafx.scene.control.ScrollPaneSCROLL_PANEprivate javafx.scene.layout.VBoxSCROLL_PANE_VBOX
-
Constructor Summary
Constructors Constructor Description AlbumDetailsRoot(Album album)Album details root constructor, uses SceneRoot constructor to create an object of the album details root class Calls the setLayout method
-
Method Summary
Modifier and Type Method Description private voiddeleteSelectedPhotos(Album album)Method which deletes the selected photos from the album and updates the root Used in setupprivate voidgeneratePDF(java.lang.String saveLocation)Method to generate PDF and is ran when clicking download in generatePDF window Used in generatePDFPressedprivate voidgeneratePDFPressed()Method that is ran when clicking the generate pdf button Sets up the action popup Used in setLayoutprivate java.util.ArrayList<Photo>getSelectedPhotos()Helping method to retrieve the photos that are selected by the user.(package private) voidsetLayout()Sets up the layout of the album details scene, overrides the setLayout() method of SceneRoot Used in constructorprivate voidsetSaveLocation(java.lang.String startDirectory, javafx.stage.Stage stage)Sets the save location of generated pdf Used in generatePdfPressedprivate voidsetup(Album album)Sets up the album scene with a page title and the album's photos in the scroll pane Used in constructorprivate voidsetupScrollPane()Sets up the scroll pane which will contain photos.private voidshowAlbumIsEmpty()Tells user that the selected album does not contain any photos Used in deleteSelectedPhotos Used in setup-
Methods inherited from class Roots.SceneRoot
getBorderPane, getGridPane, setGridPane, setPageTitle
-
-
-
-
Field Detail
-
SCROLL_PANE_VBOX
private final javafx.scene.layout.VBox SCROLL_PANE_VBOX
-
SCROLL_PANE
private final javafx.scene.control.ScrollPane SCROLL_PANE
-
PDF_BUTTON
private final javafx.scene.control.Button PDF_BUTTON
-
DELETE_ALBUM_BUTTON
private final javafx.scene.control.Button DELETE_ALBUM_BUTTON
-
DELETE_PHOTOS_BUTTON
private final javafx.scene.control.Button DELETE_PHOTOS_BUTTON
-
SAVE_LOCATION
private final javafx.scene.control.TextField SAVE_LOCATION
-
DIALOG_FEEDBACK_LABEL
private final javafx.scene.control.Label DIALOG_FEEDBACK_LABEL
-
CONTAINERS
private final java.util.List<PhotoContainer> CONTAINERS
-
albumPhotoList
private java.util.Set<Photo> albumPhotoList
-
albumName
private java.lang.String albumName
-
-
Constructor Detail
-
AlbumDetailsRoot
AlbumDetailsRoot(Album album)
Album details root constructor, uses SceneRoot constructor to create an object of the album details root class Calls the setLayout method
-
-
Method Detail
-
setLayout
void setLayout()
Sets up the layout of the album details scene, overrides the setLayout() method of SceneRoot Used in constructor
-
setupScrollPane
private void setupScrollPane()
Sets up the scroll pane which will contain photos. The scroll pane will be the center layout of the scene. Used in setLayout
-
setup
private void setup(Album album)
Sets up the album scene with a page title and the album's photos in the scroll pane Used in constructor- Parameters:
album- the album which will be shown with all the pictures in the album. If the album contains no pictures, a text will be shown in the scene to inform the user.
-
generatePDFPressed
private void generatePDFPressed()
Method that is ran when clicking the generate pdf button Sets up the action popup Used in setLayout
-
showAlbumIsEmpty
private void showAlbumIsEmpty()
Tells user that the selected album does not contain any photos Used in deleteSelectedPhotos Used in setup
-
deleteSelectedPhotos
private void deleteSelectedPhotos(Album album)
Method which deletes the selected photos from the album and updates the root Used in setup- Parameters:
album- the album that the selected photos will be removed from
-
getSelectedPhotos
private java.util.ArrayList<Photo> getSelectedPhotos()
Helping method to retrieve the photos that are selected by the user. These photos are collected in a list. Used in deleteSelectedPhotos- Returns:
- photos which is a list of the photos that are selected.
-
setSaveLocation
private void setSaveLocation(java.lang.String startDirectory, javafx.stage.Stage stage)Sets the save location of generated pdf Used in generatePdfPressed- Parameters:
startDirectory- where the user starts in the directory chooserstage- the stage that owns the directory chooser used in the method
-
generatePDF
private void generatePDF(java.lang.String saveLocation)
Method to generate PDF and is ran when clicking download in generatePDF window Used in generatePDFPressed- Parameters:
saveLocation- is the location that the user wanted the PDF saved to
-
-