Document

Represents a document with a hierarchical structure of elements, styles, and layout capabilities. The Document class manages the layout and styling system by utilizing a Layouter and an observable list of stylesheets.

Features include:

  • The ability to manage styles through a list of StyleSheet objects.

  • Automatic tracking of changes to stylesheets to ensure layout updates are performed when necessary.

  • Support for laying out the document body based on computed styles from the provided stylesheets.

  • A controllable lifecycle to clean up resources when the document is no longer in use.

Implements AutoCloseable to ensure that resources such as controlManager, styleSheets, and body are cleaned up appropriately.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
var body: Body
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun Document.body(init: Body.() -> Unit): Body
Link copied to clipboard
open override fun close()
Link copied to clipboard
fun layout()