parent
edb222dbca
commit
3a2e2b1cdd
|
@ -15,9 +15,9 @@ import java.io.*;
|
||||||
|
|
||||||
|
|
||||||
public class Controller {
|
public class Controller {
|
||||||
private DirectoryChooser folderChooser = new DirectoryChooser(); // Selects a dir
|
private DirectoryChooser folderChooser = new DirectoryChooser(); // Selects a dir
|
||||||
private FileChooser fileChooser = new FileChooser(); // Selects a file
|
private FileChooser fileChooser = new FileChooser(); // Selects a file
|
||||||
private FileWriter fileWriter; // Writes to files
|
private FileWriter fileWriter; // Writes to files
|
||||||
private File directory, sveFileLoc; // Path to file or dir
|
private File directory, sveFileLoc; // Path to file or dir
|
||||||
private Image pth = new Image("."); // Path to image
|
private Image pth = new Image("."); // Path to image
|
||||||
private ImageView imgView = new ImageView(pth); // Image view area
|
private ImageView imgView = new ImageView(pth); // Image view area
|
||||||
|
@ -35,7 +35,7 @@ public class Controller {
|
||||||
@FXML private CheckBox lftScrn, rghtScrn, useXSvrn; // Check boxes
|
@FXML private CheckBox lftScrn, rghtScrn, useXSvrn; // Check boxes
|
||||||
@FXML private ChoiceBox<?> listLftRes, listRgthRes, listSaveLoc; // Choice box fields
|
@FXML private ChoiceBox<?> listLftRes, listRgthRes, listSaveLoc; // Choice box fields
|
||||||
@FXML private Button applyBttn, closeBttn, fileBttn, clear, // Buttons
|
@FXML private Button applyBttn, closeBttn, fileBttn, clear, // Buttons
|
||||||
killBttn, restartBttn, saveBttn;
|
killBttn, restartBttn, saveBttn;
|
||||||
|
|
||||||
// This method is called by the FXMLLoader when initialization is complete
|
// This method is called by the FXMLLoader when initialization is complete
|
||||||
@FXML void initialize() {
|
@FXML void initialize() {
|
||||||
|
@ -93,38 +93,38 @@ public class Controller {
|
||||||
} catch(Throwable imgIOErr) {
|
} catch(Throwable imgIOErr) {
|
||||||
System.out.println(imgIOErr);
|
System.out.println(imgIOErr);
|
||||||
}
|
}
|
||||||
imgView = new ImageView("file:///tmp/image.png");
|
imgView = new ImageView("file:///tmp/image.png");
|
||||||
imgView.setFitWidth(300); // Need these here to get grid properly.
|
imgView.setFitWidth(300); // Need these here to get grid properly.
|
||||||
imgView.setFitHeight(200);
|
imgView.setFitHeight(200);
|
||||||
tilePane.getChildren().add(imgView);
|
tilePane.getChildren().add(imgView);
|
||||||
imgView.setOnMouseClicked(mouse -> {
|
imgView.setOnMouseClicked(mouse -> {
|
||||||
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
|
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
|
||||||
mouse.consume();
|
mouse.consume();
|
||||||
try {
|
try {
|
||||||
pb = Runtime.getRuntime().exec(vExec);
|
pb = Runtime.getRuntime().exec(vExec);
|
||||||
} catch(IOException vidIOErr) {
|
} catch(IOException vidIOErr) {
|
||||||
throw new UncheckedIOException(vidIOErr);
|
throw new UncheckedIOException(vidIOErr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
filePathField.setText(path);
|
filePathField.setText(path);
|
||||||
});
|
});
|
||||||
} else if(fileList[i].getName().contains(".png") || fileList[i].getName().contains(".jpg")||
|
} else if(fileList[i].getName().contains(".png") || fileList[i].getName().contains(".jpg")||
|
||||||
fileList[i].getName().contains(".gif") || fileList[i].getName().contains(".jpeg")) {
|
fileList[i].getName().contains(".gif") || fileList[i].getName().contains(".jpeg")) {
|
||||||
imgView = new ImageView("file://" + fileList[i]);
|
imgView = new ImageView("file://" + fileList[i]);
|
||||||
String title = "" + fileList[i];
|
String title = "" + fileList[i];
|
||||||
imgView.setFitWidth(300); // Need these here to get grid properly.
|
imgView.setFitWidth(300); // Need these here to get grid properly.
|
||||||
imgView.setFitHeight(200);
|
imgView.setFitHeight(200);
|
||||||
tilePane.getChildren().add(imgView);
|
tilePane.getChildren().add(imgView);
|
||||||
final ImageView imgViewPoped = new ImageView("file://" + fileList[i]);
|
final ImageView imgViewPoped = new ImageView("file://" + fileList[i]);
|
||||||
// image click actions
|
// image click actions
|
||||||
imgView.setOnMouseClicked(mouse -> {
|
imgView.setOnMouseClicked(mouse -> {
|
||||||
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
|
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
|
||||||
mouse.consume();
|
mouse.consume();
|
||||||
displayImg(imgViewPoped, title);
|
displayImg(imgViewPoped, title);
|
||||||
}
|
}
|
||||||
filePathField.setText(path);
|
filePathField.setText(path);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Not a video or image file.");
|
System.out.println("Not a video or image file.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue