AnsiGridStringBuilder

class AnsiGridStringBuilder(var leftBoundary: Char = '|', var rightBoundary: Char = '|', var horizontalDivider: Char = '-', var lineTerminator: String = NEWLINE)

Provides a class for building strings as part of a grid.

Constructors

Link copied to clipboard
constructor(leftBoundary: Char = '|', rightBoundary: Char = '|', horizontalDivider: Char = '-', lineTerminator: String = NEWLINE)

Properties

Link copied to clipboard

Get the size of the display area.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Draw a boundary with a specified color.

Link copied to clipboard
fun drawCentralisedWrapped(value: String, startY: Int, maxWidth: Int, color: AnsiColor): FramePosition

Draw a centralised wrapped string at a specified startY position with a maxWidth. The end position will be returned.

Link copied to clipboard

Draw a horizontal divider at a specified y position in a specified color.

Link copied to clipboard
fun drawUnderline(x: Int, y: Int, length: Int, color: AnsiColor)

Draw an underline at a specified x and y location for a specified length in a specified color.

Link copied to clipboard
fun drawWrapped(value: String, startX: Int, startY: Int, maxWidth: Int, color: AnsiColor): FramePosition

Draw a wrapped string at a specified startX and startY position with a maxWidth. The end position will be returned.

Link copied to clipboard
fun flush()

Flush the buffer.

Link copied to clipboard

Get a cell AnsiColor at a specified x and y location.

Link copied to clipboard
fun getCharacter(x: Int, y: Int): Char

Get a character from the buffer at a specified x and y location.

Link copied to clipboard
fun getNumberOfLines(value: String, startY: Int, maxWidth: Int): Int

Get the number of lines that a string will take up in a given area.

Link copied to clipboard
fun resize(displaySize: Size)

Resize the display area.

Link copied to clipboard
fun setCell(x: Int, y: Int, character: Char, color: AnsiColor)

Set the cell at a specified x and y position to a specified character and color.

Link copied to clipboard
open override fun toString(): String