Skip to content

Commit

Permalink
slightly better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
c-eg committed Apr 5, 2023
1 parent da5dcb9 commit 7bdc26f
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 87 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>uk.co.conoregan.showrenamer.JavaFxApplication</mainClass>
<mainClass>uk.co.conoregan.showrenamer.ShowRenamerApplication</mainClass>
</configuration>
</plugin>
</plugins>
Expand Down
77 changes: 0 additions & 77 deletions src/main/java/uk/co/conoregan/showrenamer/JavaFxApplication.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,61 @@

package uk.co.conoregan.showrenamer;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.URL;

/**
* This is a class to call the main function from a class that doesn't extend Application. It is needed in order to run the app without
* module-info. I don't want to add module info until all dependencies have it too, in order to generate a runtime image with jlink.
* For now, I will create a 'fat' jar and use jpackage to generate an installer.
* The starting point of the ShowRenamer application.
*/
public class ShowRenamerApplication {
public class ShowRenamerApplication extends Application {
/**
* The logger.
*/
private static final Logger LOGGER = LoggerFactory.getLogger(ShowRenamerApplication.class);

/**
* Start function.
*
* @param args the args.
* The screen width.
*/
private static final int WIDTH = 1280;

/**
* The screen height.
*/
private static final int HEIGHT = 720;

public static void main(String[] args) {
JavaFxApplication.main(args);
launch(args);
}
}

@Override
public void start(Stage primaryStage) throws Exception {
final String viewPath = "view/rename.fxml";
final URL startView = getClass().getClassLoader().getResource(viewPath);

if (startView == null) {
LOGGER.error(String.format("The resource: %s was not found.", viewPath));
System.exit(0);
}

final Parent root = FXMLLoader.load(startView);
final Scene scene = new Scene(root, WIDTH, HEIGHT);

primaryStage.setMinWidth(WIDTH);
primaryStage.setMinHeight(HEIGHT);
primaryStage.setTitle("Show Renamer");
primaryStage.setScene(scene);
// primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("images/icon.png")));

primaryStage.show();
LOGGER.info("Show Renamer successfully started.");
}
}


34 changes: 34 additions & 0 deletions src/main/java/uk/co/conoregan/showrenamer/ShowRenamerLauncher.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* This file is part of ShowRenamer.
*
* ShowRenamer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ShowRenamer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ShowRenamer. If not, see <https://www.gnu.org/licenses/>.
*/

package uk.co.conoregan.showrenamer;

/**
* This is a class to call the main function from a class that doesn't extend Application. It is needed in order to run the app without
* module-info. I don't want to add module info until all dependencies have it too, in order to generate a runtime image with jlink.
* For now, I will create a 'fat' jar and use jpackage to generate an installer.
*/
public class ShowRenamerLauncher {
/**
* Start function.
*
* @param args the args.
*/
public static void main(String[] args) {
ShowRenamerApplication.main(args);
}
}

0 comments on commit 7bdc26f

Please sign in to comment.