ValidatedRenderingContext

class ValidatedRenderingContext(attrs: StyleAttributes, palette: Palette) : RenderingContext

A ValidatedRenderingContext has complete StyleAttributes and has been successfully validated against the palette used to construct it. It is therefore ready to render itself onto StyledDocuments.

Author

Todd L Smith

Parameters

attrs

The complete StyleAttributes.

palette

The Palette, for interpreting the foreground and background colors for text rendition.

Constructors

Link copied to clipboard
constructor(attrs: StyleAttributes, palette: Palette)

Construct a ValidatedRenderingContext from the specified StyleAttributes and Palette. The context remains valid so long as the system color mode does not change.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val attributes: StyleAttributes

The partial StyleAttributes. Any missing aspects will be defaulted by Swing.

Link copied to clipboard

The document attributes to use when compute a style for a StyledDocument. Its attributes are sourced from attributes.

Functions

Link copied to clipboard
fun encloseHtml(builder: StringBuilder, action: StringBuilder.() -> Unit)

Write the open tags, run the action on the builder, then write the close tags. Do not write the outer "html" open/close tags. The resulting HTML should present a reasonable facsimile of the corresponding document styling.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Combine the receiver with the argument to produce a new context in which attributes of the receiver are overridden by corresponding non-null attributes of the argument.

Link copied to clipboard
fun renderTo(document: StyledDocument, classifiers: String, start: Int, pastEnd: Int, replace: Boolean = true)

Apply the receiver to the specified range of the target StyledDocument.

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