Skip to content

Commit

Permalink
update javadocs to take up less space, and add missing properties (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-eg authored Jan 26, 2025
1 parent 7ab7f2d commit d13b907
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,17 @@
* The starting point of the ShowRenamer application.
*/
public class ShowRenamerApplication extends Application {
/**
* The logger.
*/
/** The logger. */
private static final Logger LOGGER = LoggerFactory.getLogger(ShowRenamerApplication.class);

/**
* The screen width.
*/
private static final int WIDTH = 1280;
/** The screen width. */
private static final int DEFAULT_WIDTH = 1280;

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

/** The application title. */
private static final String APPLICATION_TITLE = "Show Renamer";

/**
* Main application function. Starts the JavaFX Application.
Expand All @@ -57,20 +54,20 @@ public static void main(final String[] args) {

@Override
public void start(final Stage primaryStage) throws Exception {
primaryStage.setMinWidth(WIDTH);
primaryStage.setMinHeight(HEIGHT);
primaryStage.setTitle("Show Renamer");

final FXMLLoader fxmlLoader = new FXMLLoader(ShowRenamerApplication.class.getResource("/view/rename.fxml"));
final Scene scene = new Scene(fxmlLoader.load());
primaryStage.setScene(scene);
primaryStage.setMinWidth(DEFAULT_WIDTH);
primaryStage.setMinHeight(DEFAULT_HEIGHT);
primaryStage.setTitle(APPLICATION_TITLE);

final InputStream appIconStream = ShowRenamerApplication.class.getResourceAsStream("/images/show-renamer-icon.png");
if (appIconStream != null) {
final Image appIcon = new Image(appIconStream);
primaryStage.getIcons().add(appIcon);
}

final FXMLLoader fxmlLoader = new FXMLLoader(ShowRenamerApplication.class.getResource("/view/rename.fxml"));
final Scene scene = new Scene(fxmlLoader.load());
primaryStage.setScene(scene);

primaryStage.show();
LOGGER.info("Show Renamer successfully started.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,21 @@
* The Movie Database api show provider.
*/
public class TMDBResultProvider implements ShowResultProvider {
/**
* The logger.
*/
/** The logger. */
private static final Logger LOGGER = LoggerFactory.getLogger(TMDBResultProvider.class);

/**
* The movie database api wrapper object.
*/
/** The movie database api wrapper object. */
private final TmdbApi tmdbApi;

/**
* Should not use, only for testing.
*/
/** Should not use, only for testing. */
protected TMDBResultProvider(final TmdbApi tmdbApi) {
this.tmdbApi = tmdbApi;
}

/**
* Constructor.
*
* @param apikey the TMDB api key.
*/
public TMDBResultProvider(final String apikey) {
tmdbApi = new TmdbApi(apikey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,10 @@
* This class should be used for settings that can be modified while the application is running.
*/
public class PreferenceService {
/**
* The logger.
*/
/** The logger. */
private static final Logger LOGGER = LoggerFactory.getLogger(PreferenceService.class);

/**
* The user preferences.
*/
/** The user preferences. */
private static final Preferences USER_PREFERENCES = Preferences.userNodeForPackage(PreferenceService.class);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,28 @@
* Wrapper class for the Preferences API, for Show Renamer preferences.
*/
public enum ShowRenamerPreference {
/**
* Rename format for movies.
*/
/** Rename format for movies. */
RENAME_FORMAT_MOVIE("rename.format.movie", "{title} ({year})"),

/**
* Rename format for tv shows.
*/
/** Rename format for tv shows. */
RENAME_FORMAT_TV_SHOW("rename.format.tv.show", "{title} ({year})"),

/**
* Rename format for tv show episodes.
*/
/** Rename format for tv show episodes. */
RENAME_FORMAT_TV_SHOW_EPISODE("rename.format.tv.show.episode", "{title} ({year}) - S{season}E{episode} - {episodeName}"),

/**
* Allowed file types.
*/
/** Allowed file types. */
ALLOWED_FILE_TYPES("allowed.file.types", "mp4,mkv"),

/**
* Whether include sub-folders should be checked.
*/
/** Whether include sub-folders should be checked. */
CHECKBOX_CHECKED_INCLUDE_SUB_FOLDERS("checkbox.checked.include.sub.folders", "false"),

/**
* Whether filter file types should be checked.
*/
/** Whether filter file types should be checked. */
CHECKBOX_CHECKED_FILTER_FILE_TYPES("checkbox.checked.filter.file.types", "false");

/**
* Preference name.
*/
/** Preference name. */
private final String name;

/**
* Preference default value.
*/
/** Preference default value. */
private final String defaultValue;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
* This class should be used for settings that should not be modified while the application is running.
*/
public class PropertyService {
/**
* The path to the properties file.
*/
/** The path to the properties file. */
private static final String PROPERTIES_PATH = "/properties/show-renamer.properties";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@
* If you add an entry in show-renamer.properties, you should add an entry to this enum.
*/
public enum ShowRenamerProperty {
/**
* The movie database api key, version 3.
*/
/** The movie database api key, version 3. */
TMDB_API_KEY("tmdb.api.key.v3");

/**
* Property name.
*/
/** Property name. */
private final String name;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
* The navigation controller, to be extended by JavaFX controllers to navigate to other scenes (pages).
*/
public abstract class NavigationController {
/**
* The scene mapping cache.
*/
/** The scene mapping cache. */
private static final Map<View, Scene> SCENE_MAP = new HashMap<>();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,81 +58,53 @@
* The JavaFX controller for the rename.fxml file.
*/
public class RenameController extends NavigationController implements Initializable {
/**
* The logger.
*/
/** The logger. */
private static final Logger LOGGER = LoggerFactory.getLogger(RenameController.class);

/**
* The Properties service.
*/
/** The Properties service. */
private static final PropertyService PROPERTY_SERVICE = new PropertyService();

/**
* The preference service.
*/
/** The preference service. */
private static final PreferenceService PREFERENCE_SERVICE = new PreferenceService();

/**
* The directory chooser.
*/
/** The directory chooser. */
private static final DirectoryChooser DIRECTORY_CHOOSER = new DirectoryChooser();

/**
* File mapping. Current name --> Suggested name.
*/
/** File mapping. Current name --> Suggested name. */
private final TreeMap<File, File> fileRenameMapping = new TreeMap<>(Comparator.comparing(File::getName));

/**
* The file renamer.
*/
/** The file renamer. */
private FileSuggestionProvider fileSuggestionProvider;

/**
* List view to show original file names.
*/
/** List view to show original file names. */
@FXML
private ListView<File> listViewCurrentTitles;

/**
* List view to suggested file names.
*/
/** List view to suggested file names. */
@FXML
private ListView<File> listViewSuggestedTitles;

/**
* Checkbox to include sub-folders.
*/
/** Checkbox to include sub-folders. */
@FXML
private CheckBox checkboxIncludeSubFolder;

/**
* Checkbox to filter file types.
*/
/** Checkbox to filter file types. */
@FXML
private CheckBox checkboxFilterFileTypes;

/**
* Button to get suggested file names.
*/
/** Button to get suggested file names. */
@FXML
private Button buttonGetSuggestions;

/**
* Button to save suggested file names.
*/
/** Button to save suggested file names. */
@FXML
private Button buttonSaveAll;

/**
* VBox parent node for current titles section.
*/
/** VBox parent node for current titles section. */
@FXML
private VBox vboxCurrentTitles;

/**
* VBox parent node for suggested titles section.
*/
/** VBox parent node for suggested titles section. */
@FXML
private VBox vboxSuggestedTitles;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,89 +48,59 @@
* The JavaFX controller for the settings.fxml file.
*/
public class SettingsController extends NavigationController implements Initializable {
/**
* The logger.
*/
/** The logger. */
private static final Logger LOGGER = LoggerFactory.getLogger(SettingsController.class);

/**
* The preference service.
*/
/** The preference service. */
private static final PreferenceService PREFERENCE_SERVICE = new PreferenceService();

/**
* The class to mark the card as active.
*/
/** The class to mark the card as active. */
private static final String CSS_CLASS_CARD_ACTIVE = "card-active";

/**
* VBox node containing the settings navigation button for rename format.
*/
/** VBox node containing the settings navigation button for rename format. */
@FXML
private VBox vboxRenameFormat;

/**
* VBox node containing the settings navigation button for allowed files types.
*/
/** VBox node containing the settings navigation button for allowed files types. */
@FXML
private VBox vboxAllowedFileTypes;

/**
* VBox node containing the settings navigation button for about.
*/
/** VBox node containing the settings navigation button for about. */
@FXML
private VBox vboxAbout;

/**
* Button for settings navigation to change to rename format section.
*/
/** Button for settings navigation to change to rename format section. */
@FXML
private Button buttonSettingsNavRenameFormat;

/**
* Button for settings navigation to change to allowed files types section.
*/
/** Button for settings navigation to change to allowed files types section. */
@FXML
private Button buttonSettingsNavFileTypeFilter;

/**
* Button for settings navigation to change to about section.
*/
/** Button for settings navigation to change to about section. */
@FXML
private Button buttonSettingsNavAbout;

/**
* The settings navigation button currently active.
*/
/** The settings navigation button currently active. */
private Button buttonActiveSettingsNav;

/**
* Text field for movie rename format.
*/
/** Text field for movie rename format. */
@FXML
private TextField textFieldMovieRenameFormat;

/**
* Text field for tv show rename format.
*/
/** Text field for tv show rename format. */
@FXML
private TextField textFieldTvShowRenameFormat;

/**
* Text field for tv show episode rename format.
*/
/** Text field for tv show episode rename format. */
@FXML
private TextField textFieldTvShowEpisodeRenameFormat;

/**
* Text field for adding allowed file types.
*/
/** Text field for adding allowed file types. */
@FXML
private TextField textFieldAddAllowedFileType;

/**
* HBox containing allowed file types.
*/
/** HBox containing allowed file types. */
@FXML
private HBox hboxAllowedFileTypes;

Expand Down
Loading

0 comments on commit d13b907

Please sign in to comment.