HexViewerState

io.worxbend.tui.widgets.HexViewerState
final class HexViewerState extends VersionedState

Caller-owned state of a HexViewer: the selected byte and the first row on screen.

The selection is a byte offset into the data; the scroll offset is a row index the viewer re-derives on every frame so the selection stays visible, the way a ListView's does. Render-thread-only; every mutation raises version (see io.worxbend.tui.core.Versioned), so a write made outside the event path is painted too.

Attributes

Graph
Supertypes
trait VersionedState
trait Versioned
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def moveBy(delta: Int, size: Int): Unit

Moves the selection delta bytes — a row is bytesPerRow of them — clamped to the data. With nothing selected yet, the first move selects the first byte.

Moves the selection delta bytes — a row is bytesPerRow of them — clamped to the data. With nothing selected yet, the first move selects the first byte.

Attributes

def offset: Int

The first row drawn; written back by the viewer on each frame.

The first row drawn; written back by the viewer on each frame.

Attributes

def offset_=(value: Int): Unit
def select(index: Int, size: Int): Unit

Selects the byte at index, clamped to 0 until size; an empty buffer clears the selection.

Selects the byte at index, clamped to 0 until size; an empty buffer clears the selection.

Attributes

def selected: Option[Int]

The selected byte's offset, or None before anything is selected.

The selected byte's offset, or None before anything is selected.

Attributes

def selected_=(value: Option[Int]): Unit

Inherited methods

final protected def touch(): Unit

Records one mutation. Call it from every public method or setter that changes what the state holds.

Records one mutation. Call it from every public method or setter that changes what the state holds.

Attributes

Inherited from:
VersionedState
final def version: Long

The number of mutations seen so far, or any monotone stand-in for it.

The number of mutations seen so far, or any monotone stand-in for it.

Attributes

Inherited from:
VersionedState