Skip to content

Commit

Permalink
Version 1.4.0
Browse files Browse the repository at this point in the history
Facelift and major functioality improvements

Update dependencies and optimize image processing

Removed imgscalr-lib and added simple-png-javafx as a dependency to enhance image processing and remove dependency on AWT and Swing. Optimized the image resizing process in 'ProcessFile' by reusing the last resized image when the next image size is the same as the last one. Unnecessary print statements were removed, and project version was updated to 1.3.4.

Add window drag functionality and update JavaFX Maven plugin

The draggable area to move the application window has been implemented. Listeners for mouse drag and press events have been added for this purpose in Window.java. In pom.xml, the JavaFX Maven plugin version is updated. The plugin's groupId has been updated and unnecessary code commented out or removed.
  • Loading branch information
EasyG0ing1 committed Mar 5, 2024
1 parent bcbab9b commit 91a0a6b
Show file tree
Hide file tree
Showing 10 changed files with 213 additions and 30 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Then, try to process your image again but this time when it exits, it should kic
The program takes your 1024 x 1024 image file and it creates a folder where it then converts your image into the different sizes that are needed for the final `.icns` file. Then it calls `iconutil` to do the conversion. It will use the original name of your file but it will have `.icns` as the extension name and it will drop it into the same folder that your selected image file resides in.

## Updates
* 1.4.0
* Facelift - along with major functionality enhancements
* 1.3.2
* Now compiling with GraalVM so that program no longer depends on a Java runtime environment. Much more efficient!
* Fixed bug where spaces in path names were not generating the `.icns` file
Expand Down
126 changes: 126 additions & 0 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.simtechdata</groupId>
<artifactId>MacIcns</artifactId>
<version>1.3.4</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin}</version>
<executions>
<execution>
<goals>
<goal>display-dependency-updates</goal>
<goal>display-plugin-updates</goal>
<goal>property-updates-report</goal>
<goal>dependency-updates-report</goal>
<goal>plugin-updates-report</goal>
<goal>update-properties</goal>
<goal>use-latest-versions</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin}</version>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer>
<mainClass>your.main.Class</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin}</version>
<configuration>
<classpathDependencyExcludes>org.graalvm.nativeimage</classpathDependencyExcludes>
<argLine>-ea</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${javafx-maven-plugin}</version>
<configuration>
<mainClass>${mainClass}</mainClass>
<launcher>MacIcns</launcher>
</configuration>
</plugin>
<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>gluonfx-maven-plugin</artifactId>
<version>${gluonfx-maven-plugin}</version>
<configuration>
<mainClass>${mainClass}</mainClass>
<linkerArgs>
<arg>${system-linker-arg}</arg>
</linkerArgs>
<nativeImageArgs>
<arg>--enable-url-protocols=https</arg>
<arg>--enable-url-protocols=http</arg>
<arg>--no-fallback</arg>
<arg>--verbose</arg>
<arg>--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED</arg>
<arg>${system-native-image-arg}</arg>
<arg>${compatibility-arg}</arg>
<arg>-H:ReflectionConfigurationFiles=${project.basedir}/config/reflect-config.json</arg>
</nativeImageArgs>
<appIdentifier>${mainClass}</appIdentifier>
<releaseConfiguration>
<vendor>Syphon</vendor>
<description>MacIcns is a program that will take a single 1024x1024 png file and create a
correctly formatted icns file</description>
<packageType>${package.type}</packageType>
<bundleShortVersion>${project.version}</bundleShortVersion>
<bundleVersion>${project.version}</bundleVersion>
<skipSigning>true</skipSigning>
</releaseConfiguration>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>build-for-macos-latest</id>
<properties>
<system-linker-arg>${pom.basedir}/config/missing_symbols-macos-latest.o</system-linker-arg>
<mac.app.store>true</mac.app.store>
<system-native-image-arg>-Dsvm.platform=org.graalvm.nativeimage.Platform$MACOS_AMD64</system-native-image-arg>
<package.type>pkg</package.type>
</properties>
</profile>
</profiles>
<properties>
<maven.compiler.release>20</maven.compiler.release>
<versions-maven-plugin>2.16.2</versions-maven-plugin>
<mainClass>com.simtechdata.Main</mainClass>
<maven-surefire-plugin>3.2.2</maven-surefire-plugin>
<native-maven-plugin>0.9.28</native-maven-plugin>
<javapackager>1.7.2</javapackager>
<gluonfx-maven-plugin>1.0.21</gluonfx-maven-plugin>
<maven-assembly-plugin>3.3.0</maven-assembly-plugin>
<maven-jar-plugin>3.3.0</maven-jar-plugin>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javafx.version>21-ea+24</javafx.version>
<javafx-maven-plugin>0.0.8</javafx-maven-plugin>
<maven-compiler-plugin>3.11.0</maven-compiler-plugin>
</properties>
</project>
11 changes: 2 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.simtechdata</groupId>
<artifactId>MacIcns</artifactId>
<version>1.3.4</version>
<version>1.4.0</version>
<packaging>jar</packaging>

<properties>
Expand All @@ -20,9 +20,8 @@
<versions-maven-plugin>2.15.0</versions-maven-plugin>
<native-maven-plugin>0.9.28</native-maven-plugin>
<versions-maven-plugin>2.16.2</versions-maven-plugin>
<!--<javafx-maven-plugin>8.8.3</javafx-maven-plugin>-->
<javafx-maven-plugin>0.0.8</javafx-maven-plugin>
<maven-surefire-plugin>3.2.2</maven-surefire-plugin>
<javafx-maven-plugin>0.0.8</javafx-maven-plugin>
<gluonfx-maven-plugin>1.0.21</gluonfx-maven-plugin>
<maven-compiler-plugin>3.11.0</maven-compiler-plugin>
<maven-assembly-plugin>3.3.0</maven-assembly-plugin>
Expand All @@ -38,11 +37,6 @@
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down Expand Up @@ -99,7 +93,6 @@
</plugin>
<!-- JavaFX Maven Plugin -->
<plugin>
<!--<groupId>com.zenjava</groupId>-->
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${javafx-maven-plugin}</version>
Expand Down
28 changes: 28 additions & 0 deletions src/main/java/com/simtechdata/Dialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,52 @@ public Dialog(String message) {
private final double width = 471;
private final double height = 231;
private AnchorPane ap;
private static final URL DialogFrame = Window.class.getResource("/Dialog.png");
private static final URL OKUp = Window.class.getResource("/buttons/OkUP.png");
private static final URL OKDown = Window.class.getResource("/buttons/OkDOWN.png");
private static final Image imgFrame = new Image(DialogFrame.toExternalForm());
private static final Image imgOKUp = new Image(OKUp.toExternalForm());
private static final Image imgOKDown = new Image(OKDown.toExternalForm());

private double xx , yy;

private void mouseDragged(MouseEvent event, double topAreaRatio) {
if(yy <= height * topAreaRatio) {
Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
stage.setX(event.getScreenX() - xx);
stage.setY(event.getScreenY() - yy);
}
}

private void mousePressed(MouseEvent event) {
xx = event.getSceneX();
yy = event.getSceneY();
}


private ImageView ivOK;
private Text textMessage;


private void makeControls() {
ap = new AnchorPane();
ap.setPrefWidth(width);
ap.setMinWidth(width);
ap.setMaxWidth(width);
ap.setPrefHeight(height);
ap.setMinHeight(height);
ap.setMaxHeight(height);
ImageView ivBack = new ImageView(imgFrame);
ivBack.setPreserveRatio(true);
ivBack.setFitWidth(width);
addNode(ivBack,0,0,0,0);
textMessage = newText(message, Fonts.Lato_Black(19), Color.YELLOW, 1.0, true);
textMessage.setWrappingWidth(395);
ivOK = newImageView(imgOKUp, imgOKDown, 180, e-> Platform.runLater(this::close));
VBox vbox = newVBox(55, Pos.CENTER, new Insets(0), textMessage, ivOK);
addNode(vbox, 10, 10, 10, 10);
ap.setOnMouseDragged(e -> mouseDragged(e, .15));
ap.setOnMousePressed(this::mousePressed);
}

private Text newText(String msg, Font font, Color color, double lineSpacing, boolean bold) {
Expand Down
Loading

0 comments on commit 91a0a6b

Please # to comment.