Class Upload

java.lang.Object
NTNU.IDATT1002.controllers.NavBarController
NTNU.IDATT1002.controllers.Upload

public class Upload
extends NavBarController
Controls the buttons and changeable elements on upload.fxml, a page where you select images to upload
Version:
1.0 22.03.2020
  • Field Details

    • uploadBtn

      public javafx.scene.control.Button uploadBtn
    • drag_drop

      public javafx.scene.layout.Pane drag_drop
  • Constructor Details

  • Method Details

    • chooseFile

      public void chooseFile() throws java.io.IOException
      Method that opens file browser with an image filter. The user will choose what files to upload. If the size of one or more files exceeds 4.1 MB, an error is displayed.
      Throws:
      java.io.IOException
    • getExtension

      public java.lang.String getExtension​(java.lang.String fileName)
      Method that finds the extension of a file
      Parameters:
      fileName - the name of the file (img.jpg, img2.png ect.)
      Returns:
      file extension (jpg, png ect.)
    • acceptDrop

      public void acceptDrop​(javafx.scene.input.DragEvent event)
      Method that decides if something can be dropped The method is called whenever something is hoovered over the drag-drop pane
      Parameters:
      event - something is dragged over the container
    • droppedFiles

      public void droppedFiles​(javafx.scene.input.DragEvent event) throws java.io.IOException
      Method that stores the dropped files
      Parameters:
      event - something is dropped into the container
      Throws:
      java.io.IOException