Skip to content

Commit

Permalink
version number increment; nullpointerexception-related fixes in image…
Browse files Browse the repository at this point in the history
…copyfinder; css changes
  • Loading branch information
kamil-sita committed Feb 1, 2019
1 parent 2c0185b commit 2c53ab8
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/main/java/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) {
public void start(Stage stage) throws Exception{
var res = getClass().getResource("sections/main/mainView.fxml");
Parent root = FXMLLoader.load(res);
stage.setTitle("XIS 0.2.1");
stage.setTitle("XIS 0.2.2");
stage.setScene(new Scene (root, 1280, 800));
stage.setMinHeight(480);
stage.setMinWidth(800);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/sections/highpassfilter/highPassFilter.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Button layoutX="82.0" layoutY="40.0" mnemonicParsing="false" onAction="#saveFilePress" text="save file" AnchorPane.leftAnchor="82.0" AnchorPane.topAnchor="40.0" />
<TextField fx:id="blur" layoutX="14.0" layoutY="25.0" text="blur strength" AnchorPane.leftAnchor="7.0" AnchorPane.topAnchor="7.0" />
<Button layoutX="156.0" layoutY="40.0" mnemonicParsing="false" onAction="#runButton" text="run" AnchorPane.leftAnchor="156.0" AnchorPane.topAnchor="40.0" />
<ImageView fx:id="imagePreview" fitHeight="158.0" fitWidth="189.0" layoutX="7.0" layoutY="136.0" pickOnBounds="true" preserveRatio="true" AnchorPane.leftAnchor="7.0" AnchorPane.rightAnchor="1004.0" AnchorPane.topAnchor="80.0" />
<ImageView fx:id="imagePreview" fitHeight="367.0" fitWidth="782.0" layoutX="7.0" layoutY="136.0" pickOnBounds="true" preserveRatio="true" AnchorPane.leftAnchor="7.0" AnchorPane.topAnchor="80.0" />
<Separator layoutX="12.0" layoutY="73.0" prefWidth="200.0" AnchorPane.leftAnchor="12.0" AnchorPane.rightAnchor="12.0" AnchorPane.topAnchor="73.0" />
<CheckBox fx:id="scaleBrightness" layoutX="173.0" layoutY="11.0" mnemonicParsing="false" selected="true" text="correct brightness" />
<CheckBox fx:id="higherQualityPreview" layoutX="198.0" layoutY="44.0" mnemonicParsing="false" selected="true" text="higher quality preview" />
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/sections/imagecopyfinder/FolderImageComparator.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package sections.imagecopyfinder;

import sections.Interruptible;
import sections.UserFeedback;
import toolset.io.MultipleFileIO;

import java.util.Arrays;
Expand All @@ -22,7 +23,16 @@ public ImageComparator compare(Interruptible interruptible) {

var folderList = Arrays.asList(fileFolders);
removeDuplicateStrings(folderList);
if (folderList.size() == 0) {
UserFeedback.popup("No input given");
return null;
}
var folders = MultipleFileIO.getFoldersFromStrings(folderList);
if (folders == null || folders.length == 0) {
UserFeedback.popup("No folders found");
return null;
}


boolean status = imageComparator.initialize(folders, geometricalMode, interruptible);
if (interruptible.isInterrupted()) return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Runnable getRunnable() {

@Override
public Runnable onUninterruptedFinish() {
return () -> onFinish(imageComparator);
return () -> {if (imageComparator != null) onFinish(imageComparator);};
}
});

Expand Down
13 changes: 7 additions & 6 deletions src/main/java/sections/main/mainView.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
*/

.button:focused {
-fx-focus-color: transparent;
-fx-faint-focus-color: transparent;
-fx-background-insets: -1.4, 0, 1, 2;
-fx-background-radius: 5, 4, 3;
-fx-underline: true;
}

.root {
-fx-faint-focus-color: transparent;
-fx-focus-color: #9DE093;
-fx-focus-color: #9c9496;
}


Expand All @@ -20,8 +18,11 @@
*/

.button {
-fx-border-radius: 0 0 0 0;
-fx-background-radius: 0 0 0 0;
-fx-border-radius: 0;
-fx-background-radius: 0;

-fx-background-color: #f0f0f0;
-fx-border-color: #a5a5a5;
}

.text-field {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/sections/main/mainView.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
<TilePane fx:id="tilePane" maxWidth="200.0" minWidth="0.0" prefHeight="574.0" prefWidth="232.0" styleClass="tile-pane">
<children>
<Button mnemonicParsing="false" onAction="#mainPress" prefHeight="42.0" prefWidth="200.0" text="Default page" />
<Button mnemonicParsing="false" onAction="#imageCopyFinderPress" prefHeight="42.0" prefWidth="200.0" text="Image copy finder [Alpha]" />
<Button mnemonicParsing="false" onAction="#imageCopyFinderPress" prefHeight="42.0" prefWidth="200.0" text="Image copy finder" />
<Button mnemonicParsing="false" onAction="#scannerToNotePress" prefHeight="42.0" prefWidth="200.0" text="Scanner to note" />
<Button mnemonicParsing="false" onAction="#highPassFilterPress" prefHeight="42.0" prefWidth="200.0" text="High pass filter" />
<Button mnemonicParsing="false" onAction="#automatedFilteringPress" prefHeight="42.0" prefWidth="200.0" text="Automated filtering" />
<Button disable="true" mnemonicParsing="false" prefHeight="42.0" prefWidth="200.0" text="Images competition [WIP]" />
<Button disable="true" mnemonicParsing="false" prefHeight="42.0" prefWidth="200.0" text="Images competition [WIP]" />
<Button disable="true" mnemonicParsing="false" prefHeight="42.0" prefWidth="200.0" text="Image compression" />
<Button disable="true" mnemonicParsing="false" prefHeight="42.0" prefWidth="200.0" text="Spritesheet builder" />
</children>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/sections/scannertonote/scannerToNote.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Button layoutX="82.0" layoutY="82.0" mnemonicParsing="false" onAction="#saveFilePress" text="save file" AnchorPane.leftAnchor="82.0" AnchorPane.topAnchor="82.0" />
<TextField fx:id="colors" layoutX="14.0" layoutY="25.0" text="colors" AnchorPane.leftAnchor="7.0" AnchorPane.topAnchor="7.0" />
<Button layoutX="156.0" layoutY="82.0" mnemonicParsing="false" onAction="#runButton" text="run" AnchorPane.leftAnchor="156.0" AnchorPane.topAnchor="82.0" />
<ImageView fx:id="imagePreview" fitHeight="175.0" fitWidth="225.0" layoutX="7.0" layoutY="136.0" pickOnBounds="true" preserveRatio="true" AnchorPane.leftAnchor="7.0" AnchorPane.rightAnchor="968.0" AnchorPane.topAnchor="115.0" />
<ImageView fx:id="imagePreview" fitHeight="195.0" fitWidth="1152.0" layoutX="7.0" layoutY="136.0" pickOnBounds="true" preserveRatio="true" AnchorPane.leftAnchor="7.0" AnchorPane.rightAnchor="41.0" AnchorPane.topAnchor="115.0" />
<CheckBox fx:id="isolateBackground" layoutX="166.0" layoutY="11.0" mnemonicParsing="false" onAction="#isolateBackgroundAction" selected="true" text="isolate background" />
<CheckBox fx:id="correctBrightness" layoutX="303.0" layoutY="11.0" mnemonicParsing="false" selected="true" text="correct brightness" />
<Slider fx:id="brightnessDiffSlider" layoutX="139.0" layoutY="43.0" showTickLabels="true" showTickMarks="true" value="15.0" AnchorPane.leftAnchor="139.0" AnchorPane.topAnchor="43.0" />
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/toolset/io/MultipleFileIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ public static List<File> loadFilesFromFolders(File[] folders) {

private static ArrayList<File> getFiles(File[] folders) {
ArrayList<File> files = new ArrayList<>();
for (int i = 0; i < folders.length; i++) {
File[] filesToAdd = folders[i].listFiles();
for (File folder : folders) {
File[] filesToAdd = folder.listFiles();
if (filesToAdd == null) continue;
files.addAll(Arrays.asList(filesToAdd));
}
return files;
Expand Down

0 comments on commit 2c53ab8

Please sign in to comment.