Package-level declarations

Types

Link copied to clipboard
class SwingIdeApplication(application: GuiApplication, scope: CoroutineScope, featureRenderers: SwingFeatureRendererRegistry = SwingFeatureRendererRegistry(), templates: List<TheoryTemplate> = emptyList(), persistence: WorkspacePersistence? = null)

Owns the Swing frame, state/effect subscriptions, and frontend lifecycle.

Link copied to clipboard
class SwingIdeEffectHandler(controller: GuiController, scope: CoroutineScope, parent: () -> Component?, onExit: () -> Unit, ioDispatcher: CoroutineDispatcher = Dispatchers.IO)

Executes platform effects. The shared controller never imports AWT, Swing, java.io, or java.nio.

Link copied to clipboard
class SwingIdeFrame(controller: GuiController, scope: CoroutineScope, featureRenderers: SwingFeatureRendererRegistry = SwingFeatureRendererRegistry(), templates: List<TheoryTemplate> = emptyList(), initialFontSize: Int = 14, initialPageFontSizes: List<Int> = emptyList(), onDeletePersistedState: () -> Unit = {}) : JFrame

Swing view/adapter. It never creates or mutates solver objects: all behaviour goes through GuiController. The fixed query row is rebound atomically to the selected page and therefore remains semantically page-specific.

Link copied to clipboard
class WorkspacePersistence(appName: String, baseDir: File = File(System.getProperty("user.home"), ".2p-kt"))

Persists open documents (each with its own query, query history, resolution/Solutions-tree history, and editor zoom level), the active look-and-feel, and window bounds to a hidden per-app JSON file under the user's home directory, so a Swing IDE variant can restore as much of its last session as possible on startup. The PersistedWorkspace shape and the logic to capture/restore one are shared with other frontends (e.g. ide-web) via ui/gui's it.unibo.tuprolog.ui.gui.persistence package; only this file-based storage is ide-swing-specific.

Functions

Link copied to clipboard
fun applyLookAndFeel(name: String, windows: List<Window> = emptyList()): Boolean

Applies the look-and-feel named name (matched case-insensitively against installedLookAndFeels's display names, e.g. "Nimbus", "Metal", "System"), refreshing every window in windows so an already-visible IDE reflects the change immediately - not just windows created afterward. Returns whether a match was found and applied; never throws, since an invalid/unsupported name (e.g. from a stale persisted setting or a typo'd CLI flag) shouldn't crash startup or the menu action that triggered it.

Link copied to clipboard
fun capturePersistedWorkspace(state: GuiState, fontSize: Int, windowBounds: Rectangle?, pageFontSizes: Map<PageId, Int> = emptyMap()): PersistedWorkspace

ide-swing-specific wrapper around the shared capturePersistedWorkspace, adding window bounds and the active look-and-feel - the two pieces of workspace state only a windowed Swing frontend has.

Link copied to clipboard

Every Swing look-and-feel installed on this JVM, in the JDK's own display order.