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
StyleSheetobjects.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.