SwingScrollbarAdapter

Bridges a top-origin Swing scrollbar to the shared terminal viewport.

The scrollbar retains pixel-scale coordinates, allowing its thumb to move continuously during direct manipulation. Each thumb position maps to an integer top row, which is applied immediately with no easing lag. Terminal publications do not overwrite the host-owned thumb coordinate during a drag, and release is already row-aligned.

The scrollbar remains visible even when no history is retained so host layouts reserve its width before the first scrollback-producing command. Hiding it after session start would shrink the terminal component and can make PTY/core width synchronization lag by one cell.

Parameters

scrollbar

host-owned vertical scrollbar.

Constructors

Link copied to clipboard
constructor(scrollbar: JScrollBar)

Functions

Link copied to clipboard
fun attach(viewportScroller: SwingScrollbarScroller)

Attaches the terminal controlled by this adapter.

Link copied to clipboard
open override fun viewportChanged(historySize: Int, scrollbackOffset: Double, renderOffset: Int, visibleRows: Int, requestedRows: Int)

Reports the latest terminal-native viewport coordinates.

Link copied to clipboard

Reports the full viewport snapshot, including pixel scroll range.