TerminalFrame
classin packageklyn.gui.terminal
public class TerminalFrame extends Object:
└ TerminalFrame
Logical terminal frame backed by styled cells. The frame is independent from ANSI escape sequences and can be inspected by tests before being flushed to the real terminal. Coordinates are 0-based. @since 1.0
Fields
Modifier and Type Member Description
public cursorCol
cursorCol as Int = 0
No summary.
public cursorRow
cursorRow as Int = 0
No summary.
public cursorVisible
cursorVisible as Boolean = false
No summary.
Properties
Modifier and Type Member Description
public readonly property height
height as Int:
No summary.
public readonly property width
width as Int:
No summary.
Properties inherited from Object: type
Constructors
Modifier and Type Member Description
public TerminalFrame
TerminalFrame(width as Int, height as Int, defaultStyle as RenderStyle = null):
Builds a frame filled with spaces using the provided default style.
Methods
Modifier and Type Member Description
public cell
cell(row as Int, col as Int) as RenderCell:
Returns the cell at the given coordinate.
public clear
clear() as Void:
Clears the frame with spaces and the default style.
public contains
contains(row as Int, col as Int) as Boolean:
Returns true when the coordinate belongs to the frame.
public copy
copy() as TerminalFrame:
Returns a deep copy of the frame.
public copyRegion
copyRegion(row as Int, col as Int, width as Int, height as Int) as TerminalFrame:
Returns a sub-frame copy.
public defaultStyle
defaultStyle() as RenderStyle:
Returns the default style of the frame.
public fillRect
fillRect(row as Int, col as Int, width as Int, height as Int, glyph as Char = ' ', style as RenderStyle = null) as Void:
Fills a rectangular region with the same glyph and style.
public toAnsiText
toAnsiText() as String:
Returns the frame as ANSI text for debug snapshots.
public toPlainText
toPlainText() as String:
Returns the frame as exact plain text, one line per row.
public writeCell
writeCell(row as Int, col as Int, glyph as Char, style as RenderStyle = null) as Void:
Writes one cell.
public writeStyledText
writeStyledText(row as Int, col as Int, text as String, style as RenderStyle = null, maxWidth as Int = -1) as Void:
Writes plain text using a fixed style, without ANSI parsing.
public writeText
writeText(row as Int, col as Int, text as String, maxWidth as Int = -1) as Void:
Writes ANSI-capable text into the frame.
Methods inherited from Object: fromJson, toDict, toJson, toString, toXml