diff --git a/ImageConverter/.idea/codeStyles/codeStyleConfig.xml b/ImageConverter/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 00000000..a55e7a17
--- /dev/null
+++ b/ImageConverter/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/ImageConverter/.idea/workspace.xml b/ImageConverter/.idea/workspace.xml
index d98e277b..2aa3f7b0 100644
--- a/ImageConverter/.idea/workspace.xml
+++ b/ImageConverter/.idea/workspace.xml
@@ -63,13 +63,27 @@
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -78,7 +92,7 @@
-
+
@@ -96,8 +110,6 @@
- нед
- размер
open
ocif
onTextFieldTextChanged
@@ -126,6 +138,8 @@
OCIF
loadImage(
onDithering
+ new
+ percen
sample
@@ -155,17 +169,17 @@
-
+
-
+
-
+
@@ -185,8 +199,6 @@
-
-
@@ -224,6 +236,8 @@
+
+
@@ -265,7 +279,15 @@
-
+
+
+
+
+
+
+
+
+
@@ -287,14 +309,6 @@
-
-
-
-
-
-
-
-
@@ -313,26 +327,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -348,17 +342,6 @@
-
-
-
-
-
-
-
-
-
-
-
@@ -371,6 +354,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -449,6 +443,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -507,15 +521,16 @@
-
+
+
-
+
@@ -535,7 +550,6 @@
-
@@ -576,7 +590,7 @@
-
+
@@ -612,6 +626,8 @@
+
+
@@ -635,7 +651,7 @@
-
+
@@ -671,6 +687,8 @@
+
+
@@ -694,7 +712,7 @@
-
+
@@ -719,6 +737,8 @@
+
+
@@ -728,13 +748,7 @@
-
-
-
-
-
-
-
+
@@ -749,13 +763,7 @@
-
-
-
-
-
-
-
+
@@ -816,41 +824,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
@@ -879,9 +857,19 @@
+
+
+
+
+
+
+
+
+
+
-
+
@@ -889,20 +877,12 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/ImageConverter/out/artifacts/ImageConverter_jar/ImageConverter.jar b/ImageConverter/out/artifacts/ImageConverter_jar/ImageConverter.jar
index 6841842a..ecec7c4b 100644
Binary files a/ImageConverter/out/artifacts/ImageConverter_jar/ImageConverter.jar and b/ImageConverter/out/artifacts/ImageConverter_jar/ImageConverter.jar differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Main$1.class b/ImageConverter/out/production/ImageConverter/sample/Main$1.class
index c03674c4..6dfacde8 100644
Binary files a/ImageConverter/out/production/ImageConverter/sample/Main$1.class and b/ImageConverter/out/production/ImageConverter/sample/Main$1.class differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Main$2$1.class b/ImageConverter/out/production/ImageConverter/sample/Main$2$1.class
index f70233b8..5ddc3376 100644
Binary files a/ImageConverter/out/production/ImageConverter/sample/Main$2$1.class and b/ImageConverter/out/production/ImageConverter/sample/Main$2$1.class differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Main$2.class b/ImageConverter/out/production/ImageConverter/sample/Main$2.class
index 966fcecc..232c7081 100644
Binary files a/ImageConverter/out/production/ImageConverter/sample/Main$2.class and b/ImageConverter/out/production/ImageConverter/sample/Main$2.class differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/Main.class b/ImageConverter/out/production/ImageConverter/sample/Main.class
index 6b34e38e..97b77dc0 100644
Binary files a/ImageConverter/out/production/ImageConverter/sample/Main.class and b/ImageConverter/out/production/ImageConverter/sample/Main.class differ
diff --git a/ImageConverter/out/production/ImageConverter/sample/OCIF.class b/ImageConverter/out/production/ImageConverter/sample/OCIF.class
index d7ef5c69..6031f4d4 100644
Binary files a/ImageConverter/out/production/ImageConverter/sample/OCIF.class and b/ImageConverter/out/production/ImageConverter/sample/OCIF.class differ
diff --git a/ImageConverter/src/sample/Main.java b/ImageConverter/src/sample/Main.java
index 61fe6283..d9d5c855 100644
--- a/ImageConverter/src/sample/Main.java
+++ b/ImageConverter/src/sample/Main.java
@@ -4,8 +4,6 @@ import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.application.Application;
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
@@ -18,7 +16,6 @@ import javafx.scene.image.ImageView;
import javafx.scene.input.*;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
@@ -271,12 +268,23 @@ public class Main extends Application {
}
public void onImageScroll(ScrollEvent scrollEvent) {
- double speed = 0.05;
+ double percentage = 0.15;
+ double newWidth = imageView.getFitWidth() * (1 + (scrollEvent.getDeltaY() > 0 ? percentage : -percentage));
+ double newHeight = newWidth * (imageView.getImage().getWidth() / imageView.getImage().getHeight());
- double newWidth = imageView.getFitWidth() * (1 + (scrollEvent.getDeltaY() > 0 ? speed : -speed));
+ Timeline timeline = newTimeLine(
+ 100,
+ new KeyValue[] {
+ new KeyValue(imageView.fitWidthProperty(), imageView.getFitWidth()),
+ new KeyValue(imageView.fitHeightProperty(), imageView.getFitHeight())
+ },
+ new KeyValue[] {
+ new KeyValue(imageView.fitWidthProperty(), newWidth),
+ new KeyValue(imageView.fitHeightProperty(), newHeight)
+ }
+ );
- imageView.setFitWidth(newWidth);
- imageView.setFitHeight(newWidth * (imageView.getImage().getWidth() / imageView.getImage().getHeight()));
+ timeline.play();
}
private void loadImage(File file) {
@@ -324,14 +332,14 @@ public class Main extends Application {
if (file != null) {
OCIF.convert(
- currentImagePath,
- file.getPath(),
- Integer.parseInt(widthTextField.getText()),
- Integer.parseInt(heightTextField.getText()),
- encodingMethodComboBox.getValue().contains("OCIF6") ? 6 : 5,
- brailleCheckBox.isSelected(),
- ditheringCheckBox.isSelected(),
- ditheringOpacitySlider.getValue() / 100.0d
+ currentImagePath,
+ file.getPath(),
+ Integer.parseInt(widthTextField.getText()),
+ Integer.parseInt(heightTextField.getText()),
+ encodingMethodComboBox.getValue().contains("OCIF6") ? 6 : 5,
+ brailleCheckBox.isSelected(),
+ ditheringCheckBox.isSelected(),
+ ditheringOpacitySlider.getValue() / 100.0d
);
}
}
diff --git a/ImageConverter/src/sample/OCIF.java b/ImageConverter/src/sample/OCIF.java
index 00c3f0d3..479400a7 100644
--- a/ImageConverter/src/sample/OCIF.java
+++ b/ImageConverter/src/sample/OCIF.java
@@ -6,7 +6,6 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
-
class OCIF {
private static void writePixelToFileAsOCIF5(FileOutputStream out, Pixel pixel) throws IOException {
out.write((byte) Palette.getClosestIndex(pixel.background));
@@ -16,7 +15,6 @@ class OCIF {
out.write(pixel.symbol.getBytes(StandardCharsets.UTF_8));
}
-
private static byte[] integerToByteArray(int number, int arraySize) {
byte[] array = new byte[arraySize];