Package Roots
Class PhotosRoot
- java.lang.Object
-
- Roots.SceneRoot
-
- Roots.PhotosRoot
-
final class PhotosRoot extends SceneRoot
Class for the Photos root
-
-
Field Summary
Fields Modifier and Type Field Description private javafx.scene.control.Button
ADD_PHOTO_BUTTON
private javafx.scene.control.Button
ADD_TO_ALBUM_BUTTON
private java.util.List<javafx.scene.control.CheckBox>
CHECKBOX_ARRAY_LIST
private javafx.scene.control.ChoiceBox<java.lang.String>
CHOICE_BOX
private javafx.scene.control.Button
DELETE_BUTTON
private javafx.scene.control.Label
FEEDBACK_LABEL
private java.util.List<PhotoContainer>
PHOTO_CONTAINER_LIST
private java.util.List<Photo>
PHOTO_LIST
private javafx.scene.control.ScrollPane
SCROLL_PANE
private javafx.scene.layout.VBox
SCROLL_PANE_VBOX
private javafx.scene.control.TextField
SEARCH_TEXT_FIELD
private javafx.scene.control.CheckBox
SELECT_ALL_CHECKBOX
private javafx.scene.layout.HBox
SELECT_ALL_HBOX
-
Constructor Summary
Constructors Constructor Description PhotosRoot()
Sets up the photos root and adds all the users photos to the photo list
-
Method Summary
Modifier and Type Method Description private void
createNewAlbumButtonPressed()
Method that creates the popup that can create albums and creates the action popup Used in setupAlbumButtonsprivate void
deleteSelectedPhotos()
Private method for deleting selected photos.private void
filter()
Method for the search functionality.private java.util.ArrayList<Photo>
getCheckedPhotos()
Helper method to get the checked photos in the photos root Used in updateUser Used in deleteSelectedPhotosprivate java.util.List<java.lang.String>
getPhotoTags(Photo photo)
Helping method to retrieve all the tags to a specific photo.(package private) void
setLayout()
Sets up the layout of the photos root overrides the setLayout method of SceneRoot Used in constructorprivate void
setupAlbumButtons()
Sets up the add to album button Used in setLayoutprivate void
setupChoiceBox()
Sets up the checkboxes and adds styling to it Used createNewAlbumButtonPressedprivate void
setupDeleteButton()
Sets up button for deleting photos Used in setLayoutprivate void
setupImagesInAScrollPane()
Sets up the scroll pane in the photos root with all the user's photos Used in setLayoutprivate void
setupSearchBar()
Sets up the search bar and its functionality Used in setLayoutprivate void
setupSelectAllHBox()
Sets up the select-all button Used in setLayoutprivate void
showNoPhotos()
Shows a message that tells the user that it has no photosprivate void
updateUser(java.lang.String albumName)
Method that updates the photos in the selected album Used in createNewAlbumButtonPressed-
Methods inherited from class Roots.SceneRoot
getBorderPane, getGridPane, setGridPane, setPageTitle
-
-
-
-
Field Detail
-
PHOTO_LIST
private final java.util.List<Photo> PHOTO_LIST
-
SCROLL_PANE
private final javafx.scene.control.ScrollPane SCROLL_PANE
-
SCROLL_PANE_VBOX
private final javafx.scene.layout.VBox SCROLL_PANE_VBOX
-
CHECKBOX_ARRAY_LIST
private final java.util.List<javafx.scene.control.CheckBox> CHECKBOX_ARRAY_LIST
-
PHOTO_CONTAINER_LIST
private final java.util.List<PhotoContainer> PHOTO_CONTAINER_LIST
-
SEARCH_TEXT_FIELD
private final javafx.scene.control.TextField SEARCH_TEXT_FIELD
-
SELECT_ALL_HBOX
private final javafx.scene.layout.HBox SELECT_ALL_HBOX
-
SELECT_ALL_CHECKBOX
private final javafx.scene.control.CheckBox SELECT_ALL_CHECKBOX
-
ADD_TO_ALBUM_BUTTON
private final javafx.scene.control.Button ADD_TO_ALBUM_BUTTON
-
CHOICE_BOX
private final javafx.scene.control.ChoiceBox<java.lang.String> CHOICE_BOX
-
DELETE_BUTTON
private final javafx.scene.control.Button DELETE_BUTTON
-
FEEDBACK_LABEL
private final javafx.scene.control.Label FEEDBACK_LABEL
-
ADD_PHOTO_BUTTON
private final javafx.scene.control.Button ADD_PHOTO_BUTTON
-
-
Method Detail
-
setLayout
void setLayout()
Sets up the layout of the photos root overrides the setLayout method of SceneRoot Used in constructor
-
setupImagesInAScrollPane
private void setupImagesInAScrollPane()
Sets up the scroll pane in the photos root with all the user's photos Used in setLayout
-
showNoPhotos
private void showNoPhotos()
Shows a message that tells the user that it has no photos
-
setupSearchBar
private void setupSearchBar()
Sets up the search bar and its functionality Used in setLayout
-
setupSelectAllHBox
private void setupSelectAllHBox()
Sets up the select-all button Used in setLayout
-
setupDeleteButton
private void setupDeleteButton()
Sets up button for deleting photos Used in setLayout
-
setupAlbumButtons
private void setupAlbumButtons()
Sets up the add to album button Used in setLayout
-
setupChoiceBox
private void setupChoiceBox()
Sets up the checkboxes and adds styling to it Used createNewAlbumButtonPressed
-
filter
private void filter()
Method for the search functionality. Filters the scroll panes photos, showing a photo if its title contains the search text or one if its tags are equal to the search text. Used in setupSearchBar
-
getPhotoTags
private java.util.List<java.lang.String> getPhotoTags(Photo photo)
Helping method to retrieve all the tags to a specific photo. Used in filter- Parameters:
photo
- gets the tags of the photo.- Returns:
- all the tags to the specific photo.
-
createNewAlbumButtonPressed
private void createNewAlbumButtonPressed()
Method that creates the popup that can create albums and creates the action popup Used in setupAlbumButtons
-
getCheckedPhotos
private java.util.ArrayList<Photo> getCheckedPhotos()
Helper method to get the checked photos in the photos root Used in updateUser Used in deleteSelectedPhotos- Returns:
- a list of checked photos
-
updateUser
private void updateUser(java.lang.String albumName)
Method that updates the photos in the selected album Used in createNewAlbumButtonPressed- Parameters:
albumName
- name of the selected album
-
deleteSelectedPhotos
private void deleteSelectedPhotos()
Private method for deleting selected photos. Used in setupDeleteButton
-
-