Ejemplo n.º 1
0
  @FXML
  private void handlePrevImageAction(ActionEvent event) {
    System.out.println("PREV PRESSED");

    // Call the previous image
    imgMan.PreviousImage();
  }
Ejemplo n.º 2
0
  // Controllers
  @FXML
  private void handleNextImageAction(ActionEvent event) {
    System.out.println("NEXT PRESSED");

    // Call the next image
    imgMan.NextImage();
  }
Ejemplo n.º 3
0
 @FXML
 private void handleImportItemAction(ActionEvent event) {
   File fileLocation = new FileChooser().showOpenDialog(Main.stage);
   try (BufferedReader br = new BufferedReader(new FileReader(fileLocation))) {
     String line;
     while ((line = br.readLine()) != null) {
       final File folder = new File(line);
       if (folder.isDirectory()) {
         listFilesForFolder(folder);
       } else {
         Image img = new Image(folder.toURI().toString());
         imgMan.images.add(
             new ImageInformation(
                 img,
                 folder.toURI().toString(),
                 new ImageInformation.Type[] {
                   ImageInformation.Type.SAND, ImageInformation.Type.FISH,
                   ImageInformation.Type.ALGA, ImageInformation.Type.CORAL,
                   ImageInformation.Type.SAND
                 },
                 new Point[] {
                   new Point((int) (img.getWidth() * 0.25), (int) (img.getHeight() * 0.25)),
                   new Point((int) (img.getWidth() * 0.75), (int) (img.getHeight() * 0.25)),
                   new Point((int) (img.getWidth() * 0.5), (int) (img.getHeight() * 0.5)),
                   new Point((int) (img.getWidth() * 0.25), (int) (img.getHeight() * 0.75)),
                   new Point((int) (img.getWidth() * 0.75), (int) (img.getHeight() * 0.75))
                 },
                 new double[] {0.86, 0.76, 0.99, 0.65, 0.54}));
       }
     }
   } catch (FileNotFoundException e1) {
     e1.printStackTrace();
   } catch (IOException e1) {
     e1.printStackTrace();
   }
   imgMan.NextImage();
 }