Update Controller.java

Fixed formatting
This commit is contained in:
Maxim 2016-11-07 02:12:36 -06:00 committed by GitHub
parent 95a280dd11
commit edb222dbca
1 changed files with 21 additions and 23 deletions

View File

@ -89,11 +89,11 @@ public class Controller {
thumbImgView.getChildren().clear(); // Clears children if any to setup for new images
dirPathField.setText("" + directory);
for (int i=0; i<size; i++) {
for (int i=0; i<size; i++) {
String path = "" + fileList[i];
imgView.setFitWidth(535);
imgView.setFitHeight(345);
imgView.setLayoutY(posY);
imgView.setFitWidth(535);
imgView.setFitHeight(345);
imgView.setLayoutY(posY);
// Video or image click actions
if (fileList[i].getName().contains(".mp4") || fileList[i].getName().contains(".mpeg") ||
@ -109,37 +109,35 @@ public class Controller {
} catch(Throwable imgIOErr) {
System.out.println(imgIOErr);
}
imgView = new ImageView("file:///tmp/image.png");
thumbImgView.getChildren().add(imgView);
imgView = new ImageView("file:///tmp/image.png");
thumbImgView.getChildren().add(imgView);
imgView.setOnMouseClicked(mouse -> {
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
mouse.consume();
try {
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
mouse.consume();
try {
pb = Runtime.getRuntime().exec(vExec);
} catch(IOException vidIOErr) {
throw new UncheckedIOException(vidIOErr);
}
}
} catch(IOException vidIOErr) {
throw new UncheckedIOException(vidIOErr);
}
}
filePathField.setText(path);
});
} else if(fileList[i].getName().contains(".png") || fileList[i].getName().contains(".jpg")||
fileList[i].getName().contains(".gif") || fileList[i].getName().contains(".jpeg")) {
imgView = new ImageView("file://" + fileList[i]);
thumbImgView.getChildren().add(imgView);
final ImageView imgViewPoped = new ImageView("file://" + fileList[i]);
imgView = new ImageView("file://" + fileList[i]);
thumbImgView.getChildren().add(imgView);
final ImageView imgViewPoped = new ImageView("file://" + fileList[i]);
imgView.setOnMouseClicked(mouse -> {
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
mouse.consume();
displayImg(imgViewPoped, path);
}
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
mouse.consume();
displayImg(imgViewPoped, path);
}
filePathField.setText(path);
});
} else {
System.out.println("Not a video or image file.");
}
posY = posY + 355.0;
}
posY = posY + 355.0; }
}
// View Image enlarged Note, sets up a seperate stage and scene with auto enlargment
public void displayImg(ImageView imgViewPoped, String path) {