Back to Explore

tornadofx_epub

public
master

AI Architecture

Sign in to run a focused analysis on specific parts of this codebase.

Sign in

Trigger

User clicks 'Open File' button to select an EPUB file

1

Application Initialization

TriggerTornadoFX

Application Start

TornadoFX application launches and initializes the main application class, setting up the JavaFX runtime environment.

mainMyApp.start
tornadofx.App
src/main/kotlin/com/example/demo/app/MyApp.kt
2

Primary View Rendering

FrontendTornadoFX

Load Main View

The application instantiates and displays the MainView component, rendering the file selection interface with controls.

MainView.initMainView.root
tornadofx.View
src/main/kotlin/com/example/demo/view/MainView.kt
3

File Selection

FrontendJavaFX

Show File Chooser

User triggers file selection, opening a native file chooser dialog filtered for EPUB files.

chooseFile
tornadofx.chooseFilejavafx.stage.FileChooser
src/main/kotlin/com/example/demo/view/MainView.kt
4

EPUB Parsing

ProcessingEpublib

Parse EPUB File

The selected file is passed to epublib's EpubReader to parse the EPUB structure, extracting metadata, table of contents, and chapter resources.

EpubReader.readEpub
nl.siegmann.epublib.epub.EpubReader
src/main/kotlin/com/example/demo/view/MainView.kt
5

Extract Book Metadata

ProcessingEpublib

Retrieve Book Information

Extract title, author, and table of contents from the parsed EPUB book object for display and navigation purposes.

Book.getTitleBook.getMetadataBook.getTableOfContents
nl.siegmann.epublib.domain.Book
src/main/kotlin/com/example/demo/view/MainView.kt
6

View Transition

FrontendTornadoFX

Navigate to Reading View

The application transitions from MainView to ReadingView, passing the parsed book object and initializing the reading interface.

replaceWithReadingView.init
tornadofx.UIComponent.replaceWith
src/main/kotlin/com/example/demo/view/MainView.ktsrc/main/kotlin/com/example/demo/view/ReadingView.kt
7

Reading View Setup

FrontendJavaFX

Initialize WebView Component

Creates and configures a JavaFX WebView component for rendering HTML content, setting up the web engine and style properties.

webviewWebView.getEngine
javafx.scene.web.WebViewtornadofx.webview
src/main/kotlin/com/example/demo/view/ReadingView.kt
8

Load First Chapter

ProcessingEpublib

Retrieve Chapter Content

Fetches the first chapter's HTML content from the EPUB book object using the spine references.

Book.getSpineSpineReference.getResourceResource.getData
nl.siegmann.epublib.domain.Spinenl.siegmann.epublib.domain.Resource
src/main/kotlin/com/example/demo/view/ReadingView.kt
9

Apply Styling

FrontendJavaFX

Load CSS Stylesheet

Loads the webview.css stylesheet from resources to apply custom styling to the rendered EPUB content.

WebEngine.setUserStyleSheetLocationjavaClass.getResource
javafx.scene.web.WebEngine
src/main/kotlin/com/example/demo/view/ReadingView.ktsrc/main/resources/css/webview.css
10

Render Content

FrontendJavaFX

Display Chapter HTML

The WebView engine renders the chapter HTML content with applied CSS styling, displaying the text and images to the user.

WebEngine.loadContent
javafx.scene.web.WebEngine
src/main/kotlin/com/example/demo/view/ReadingView.kt
11

Navigation Setup

FrontendTornadoFX

Initialize Navigation Controls

Sets up previous/next chapter buttons and their event handlers for navigating through the book content.

button.actionsetOnAction
tornadofx.button
src/main/kotlin/com/example/demo/view/ReadingView.kt

Analyzed 2/18/2026, 9:41:25 PM

Sign in to analyze your own repositories.

Sign in