Top Description Fields Constructors Methods
org.jabref.htmltonode

public final Class FxRenderer

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, .Locale, .Optional, javafx.geometry.Insets, .Pos, javafx.scene.Cursor, .Node, javafx.scene.image.Image, .ImageView, javafx.scene.input.MouseButton, javafx.scene.layout.GridPane, .HBox, .Priority, .Region, .VBox, javafx.scene.paint.Color, javafx.scene.text.Font, .FontPosture, .FontWeight, .Text, .TextFlow, org.jabref.htmltonode.internal.HighlightTextFlow, .RenderSupport, .TextSelection, org.jabref.htmltonode.model.Block, .CssLength, .Inline, .InlineStyle, org.jspecify.annotations.Nullable

Renders the block model into plain JavaFX nodes: paragraphs become TextFlows in a VBox, links become styled, clickable Text runs (they wrap mid-link like in a browser — no javafx.controls dependency), <mark>/background runs get real background shapes.

Style classes for theming: html-view (root), html-paragraph, html-pre, html-text, html-link, html-mark, html-heading/html-h1…h6, html-list, html-list-marker, html-blockquote, html-table, html-hr, html-image, plus all CSS classes carried over from the HTML (csl-entry, error, …).

Field Summary

Modifier and TypeField and Description
private final String
private final double
private final HtmlRenderOptions

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
appendBlocks(VBox parent, List<Block> blocks)

private static double
private Text
createText(String content, InlineStyle style, double sizeFactor)

private double
public static Region

Returns:

a VBox with style class html-view and the built-in stylesheet attached
render
(List<Block>
the blocks to render, typically from HtmlToNode#parse(String, String)
blocks
,
HtmlRenderOptions
rendering options
options
)

Renders the given blocks.

private Node
private Node
private TextFlow
renderFlow(List<Inline> inlines, String baseClass, List<String> cssClasses, double scale, int minWeight)

Renders inline content into a HighlightTextFlow.

private @Nullable Node
private Node
private Node
private static double
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseFamilyback to summary
private final String baseFamily
baseSizeback to summary
private final double baseSize
optionsback to summary
private final HtmlRenderOptions options

Constructor Detail

FxRendererback to summary
private FxRenderer(HtmlRenderOptions options)

Method Detail

appendBlocksback to summary
private void appendBlocks(VBox parent, List<Block> blocks)
bottomMarginEmback to summary
private static double bottomMarginEm(Block block)
createTextback to summary
private Text createText(String content, InlineStyle style, double sizeFactor)
leftIndentPxback to summary
private double leftIndentPx(Block block)
renderback to summary
public static Region render(List<Block> blocks, HtmlRenderOptions options)

Renders the given blocks. Must be called on the JavaFX application thread when the result is (or will be) part of a live scene.

Parameters
blocks:List<Block>

the blocks to render, typically from HtmlToNode#parse(String, String)

options:HtmlRenderOptions

rendering options

Returns:Region

a VBox with style class html-view and the built-in stylesheet attached

renderBlockback to summary
private Node renderBlock(Block block)
renderDefinitionListback to summary
private Node renderDefinitionList(List<Block.DefinitionItem> items)
renderFlowback to summary
private TextFlow renderFlow(List<Inline> inlines, String baseClass, List<String> cssClasses, double scale, int minWeight)

Renders inline content into a HighlightTextFlow. scale/minWeight implement heading sizing without touching the parsed model.

renderImageback to summary
private @Nullable Node renderImage(Inline.Image image)
renderListback to summary
private Node renderList(Block.ListBlock listBlock)
renderTableback to summary
private Node renderTable(List<Block.TableRow> rows)
topMarginEmback to summary
private static double topMarginEm(Block block)