How acmi/l2tool works
Main Components
• User Interface (UI) Layer:
– This includes the JavaFX components defined by the .fxml files (l2tool.fxml and textureview/view.fxml) found in src/main/resources.
– The UI interacts with the user, displaying textures and receiving replacement commands.
• Controller Layer:
– The Controller.java and TextureView.java files in the “l2tool” and “textureview” packages, respectively, are the entry points that handle UI events.
– They coordinate the flow between the front-end (UI) and the underlying business logic.
• Business Logic & Command Processing:
– The L2Tool.java and L2ToolCmd.java classes act as the core of the application’s logic, processing commands and powering key features.
– They likely parse user actions and delegate tasks to specific modules.
• Image Processing Module:
– Under the “img” package, classes such as DDS.java, TGA.java, Palette.java, etc., are dedicated to handling different image formats and texture properties.
– This component encapsulates the logic necessary for reading, processing, and possibly converting image files.
• Texture Conversion Module:
– The texconv/ConvertTool.java class is responsible for converting textures between different formats.
– It operates in coordination with the image processing module.
Interactions & Data Flow
• The UI layer (JavaFX FXML views) sends user actions (e.g., opening a texture, requesting a replacement) to their corresponding controllers.
• Controllers (Controller.java, TextureView.java) then call the business logic components (L2Tool.java, L2ToolCmd.java) to execute these commands.
• When conversion or processing is needed, the business logic interacts with the image processing module (the classes in the “img” package as well as ConvertTool.java).
• Processed image data or conversion results are sent back up to the UI for display or further interaction.
Architectural Patterns & Important Details
• Separation of Concerns:
– UI is clearly separated from business logic, as each set of responsibilities is isolated into different packages (e.g., clientmod/l2tool for UI/logic and clientmod/texconv for conversion).
• MVC-like Structure:
– Although not a formal MVC, the project naturally divides into view (FXMLs), controllers, and the underlying processing logic, simplifying maintenance and scalability.
• Modular Image Processing:
– The numerous classes in the img subpackage illustrate a modular approach to handling various image formats and properties, making the component extensible.
• Use of Gradle:
– The presence of build.gradle, gradle wrapper files, and accompanying batch/shell scripts signals that build and dependency management are handled by Gradle.
Summary of Detailed Components
• Clear labels for each architectural module:
– JavaFX UI (FXML: l2tool.fxml, view.fxml)
– Controllers (Controller.java, TextureView.java)
– Core Business Logic (L2Tool.java, L2ToolCmd.java)
– Image Processing (classes like DDS.java, TGA.java, Palette.java, etc.)
– Texture Conversion (ConvertTool.java)
– Data flow from UI to Controllers
– Command and process delegation from Controllers to Business Logic
– Processing requests to Image Modules and back
– Presentation layer, business logic, and processing modules