Class AddImagePageController

  • All Implemented Interfaces:
    javafx.fxml.Initializable

    public class AddImagePageController
    extends java.lang.Object
    implements javafx.fxml.Initializable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.Integer,​java.io.File> chosenImages  
      private javafx.scene.layout.VBox entryContainer  
      private org.slf4j.Logger logger  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void btnAddToGallery​(javafx.event.ActionEvent actionEvent)
      Method for adding all images in chosenImages to HashMap and changing scene to galleryPage.
      private void btnEntryRemove​(javafx.event.ActionEvent event)
      Method for removing image entries from both view and chosenImages HashMap.
      private void btnGallery​(javafx.event.ActionEvent event)
      This method handles what happens when the gallery button is pressed.
      private void btnHome​(javafx.event.ActionEvent event)
      This method handles what happens when the home button is pressed.
      private javafx.scene.layout.HBox createListEntry​(java.lang.String imagePath, int identifier)
      Method for creating an HBox that represents the entries of chosen images.
      void initialize​(java.net.URL url, java.util.ResourceBundle resourceBundle)  
      • Methods inherited from class java.lang.Object

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

      • chosenImages

        private java.util.Map<java.lang.Integer,​java.io.File> chosenImages
      • logger

        private org.slf4j.Logger logger
      • entryContainer

        private javafx.scene.layout.VBox entryContainer
    • Constructor Detail

      • AddImagePageController

        public AddImagePageController()
    • Method Detail

      • initialize

        public void initialize​(java.net.URL url,
                               java.util.ResourceBundle resourceBundle)
        Specified by:
        initialize in interface javafx.fxml.Initializable
      • createListEntry

        private javafx.scene.layout.HBox createListEntry​(java.lang.String imagePath,
                                                         int identifier)
        Method for creating an HBox that represents the entries of chosen images. The method changes node fx:id to associate entry with and image and it's identifier, and configures image for the preview.
        Parameters:
        imagePath - The filepath of the image
        identifier - The identifier for keeping track of images and entries
        Returns:
        Generated HBox
      • btnEntryRemove

        private void btnEntryRemove​(javafx.event.ActionEvent event)
        Method for removing image entries from both view and chosenImages HashMap.
        Parameters:
        event - Event from button click
      • btnHome

        private void btnHome​(javafx.event.ActionEvent event)
        This method handles what happens when the home button is pressed. The button sets a new scene by using the MetIma_HomePage.fxml file.
        Parameters:
        event - Represents the action when the button is pressed
      • btnGallery

        private void btnGallery​(javafx.event.ActionEvent event)
        This method handles what happens when the gallery button is pressed. The button sets a new scene by using the MetIma_GalleryPage.fxml file.
        Parameters:
        event - Represents the action when the button is pressed
      • btnAddToGallery

        public void btnAddToGallery​(javafx.event.ActionEvent actionEvent)
        Method for adding all images in chosenImages to HashMap and changing scene to galleryPage.
        Parameters:
        actionEvent - Event from button click