src/main/java/chalmers/pimp/controller/components/ImageChooser.java
public IRasterData openDialog(Window window) throws IOException {
    Objects.requireNonNull(window);

    File file = fileChooser.showOpenDialog(window);
    if (file == null) {
      System.out.println("No image file was selected!");
      return null;
    }
    setMostRecentFileName(file);

    Image image = ImageImportService.importImage(file);
    return RasterDataService.createPixelDataCopy(image);
  }
/**
   * Attempts to let the user choose an existing image and subsequently import it.
   *
   * @param window the parent window that will contain the dialog.
   * @return a pixel data instance, that represents the existing image; {@code null} if no file was
   * selected.
   * @throws IOException          if an image cannot be loaded.
   * @throws NullPointerException if the supplied window is {@code null}.
   */
Attempts to let the user choose an existing image and subsequently import it.
@param window the parent window that will contain the dialog.
@return a pixel data instance, that represents the existing image;  null if no file was
selected.
@throws IOException          if an image cannot be loaded.
@throws NullPointerException if the supplied window is  null.
Attempts to let the user choose an existing image and subsequently import it . @param window the parent window that will contain the dialog . @return a pixel data instance that represents the existing image ; null if no file was selected . @throws IOException if an image cannot be loaded . @throws NullPointerException if the supplied window is null .
public IRasterData openDialog(Window window) throws IOException {
    Objects.requireNonNull(window);
    File file = fileChooser.showOpenDialog(window);
    if (file == null) {
      System.out.println("No image file was selected!");
      return null;
    }
    setMostRecentFileName(file);
    Image image = ImageImportService.importImage(file);
    return RasterDataService.createPixelDataCopy(image);
  }
public IRasterData openDialog ( Window window ) throws IOException { Objects . requireNonNull ( window ) ; File file = fileChooser . showOpenDialog ( window ) ; if ( file == null ) { System . out . println ( "No image file was selected!" ) ; return null ; } setMostRecentFileName ( file ) ; Image image = ImageImportService . importImage ( file ) ; return RasterDataService . createPixelDataCopy ( image ) ; }
Attempts to let the user choose an existing image and subsequently import it.
Attempts to let the user choose an existing image and subsequently import it .