Setup jar configuration. New version number too.
This commit is contained in:
@@ -25,8 +25,8 @@ import javafx.beans.value.ObservableValue;
|
||||
|
||||
|
||||
public class Controller {
|
||||
private DirectoryChooser folderChooser = new DirectoryChooser(); // Selects a dir
|
||||
private FileWriter fileWriter; // Writes to files
|
||||
private DirectoryChooser folderChooser = new DirectoryChooser(); // Selects a dir
|
||||
private FileWriter fileWriter; // Writes to files
|
||||
private File directory, sveFileLoc; // Path to file or dir
|
||||
private File[] fileList;
|
||||
private Image pth = new Image("."); // Path to image
|
||||
@@ -64,7 +64,7 @@ public class Controller {
|
||||
textAreaPth = dirPathField.getText();
|
||||
System.out.println(textAreaPth);
|
||||
newDir();
|
||||
} else {}
|
||||
} else {}
|
||||
}
|
||||
|
||||
// Scan selected dir
|
||||
@@ -84,25 +84,25 @@ public class Controller {
|
||||
fileList = directory.listFiles();
|
||||
dirPathField.setText("" + directory);
|
||||
|
||||
for (int i=0; i<fileList.length; i++) {
|
||||
for (int i=0; i<fileList.length; i++) {
|
||||
String path = "" + fileList[i];
|
||||
if (path.toLowerCase().matches("^.*?(mp4|mpeg|mpg|wmv|mkv|flv|webm|avi|png|jpg|jpeg|gif).*$")) {
|
||||
imgView = new ImageView();
|
||||
imgView.setFitWidth(300); // Need these here to get grid properly.
|
||||
imgView.setFitHeight(200);
|
||||
tilePane.getChildren().add(imgView);
|
||||
imgView = new ImageView();
|
||||
imgView.setFitWidth(300); // Need these here to get grid properly.
|
||||
imgView.setFitHeight(200);
|
||||
tilePane.getChildren().add(imgView);
|
||||
}
|
||||
}
|
||||
|
||||
Task getDir = new Task<Void>() {
|
||||
@Override public Void call() {
|
||||
newDir2();
|
||||
return null;
|
||||
newDir2();
|
||||
return null;
|
||||
}};
|
||||
new Thread(getDir).start();
|
||||
}
|
||||
public void newDir2() {
|
||||
for (int i=0; i<fileList.length; i++) {
|
||||
for (int i=0; i<fileList.length; i++) {
|
||||
String path = "" + fileList[i], tmpP = "" + fileList[i];
|
||||
if (tmpP.toLowerCase().matches("^.*?(mp4|mpeg|mpg|wmv|mkv|flv|webm|avi).*$")) {
|
||||
String movieImg = "ffmpegthumbnailer -w -t='00:30:00' -c png -i " +
|
||||
@@ -122,35 +122,35 @@ public class Controller {
|
||||
});
|
||||
|
||||
view.setOnMouseClicked(mouse -> {
|
||||
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
|
||||
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
|
||||
mouse.consume();
|
||||
try {
|
||||
pb = Runtime.getRuntime().exec(vExec);
|
||||
} catch(IOException vidIOErr) {
|
||||
throw new UncheckedIOException(vidIOErr);
|
||||
}
|
||||
}
|
||||
filePathField.setText(path);
|
||||
try {
|
||||
pb = Runtime.getRuntime().exec(vExec);
|
||||
} catch(IOException vidIOErr) {
|
||||
throw new UncheckedIOException(vidIOErr);
|
||||
}
|
||||
}
|
||||
filePathField.setText(path);
|
||||
});
|
||||
} else if(tmpP.toLowerCase().matches("^.*?(png|jpg|jpeg|gif).*$")) {
|
||||
ImageView view = (ImageView) (tilePane.getChildren().get(i));
|
||||
String title = "file://" + fileList[i];
|
||||
String title = "file://" + fileList[i];
|
||||
pth = new Image(title);
|
||||
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override public void run() { view.setImage(pth); }
|
||||
});
|
||||
|
||||
final ImageView imgViewPoped = new ImageView(title);
|
||||
// image click actions
|
||||
final ImageView imgViewPoped = new ImageView(title);
|
||||
// image click actions
|
||||
view.setOnMouseClicked(mouse -> {
|
||||
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
|
||||
mouse.consume();
|
||||
displayImg(imgViewPoped, title);
|
||||
}
|
||||
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
|
||||
mouse.consume();
|
||||
displayImg(imgViewPoped, title);
|
||||
}
|
||||
filePathField.setText(path);
|
||||
});
|
||||
} else { System.out.println("Not a video or image file."); }
|
||||
});
|
||||
} else { System.out.println("Not a video or image file."); }
|
||||
}
|
||||
}
|
||||
// Open image in new window
|
||||
@@ -187,7 +187,6 @@ public class Controller {
|
||||
}
|
||||
// Preliminary setup to save settings to files
|
||||
@FXML void saveToFile(ActionEvent saveEvent) throws Exception {
|
||||
|
||||
// Saves to file with selected and needed settings
|
||||
if(filePathField.getText().toLowerCase().matches("^.*?(png|jpg|jpeg|gif).*$"))
|
||||
sveFileLoc = new File(System.getProperty("user.home") + "/" + ".config/nitrogen/bg-saved.cfg");
|
||||
|
||||
Reference in New Issue
Block a user