Class CanvasBuilder
java.lang.Object
com.nsdev.lettergenerator.builder.CanvasBuilder
Mutable, call-local authoring builder producing owned immutable canvas models.
-
Constructor Summary
ConstructorsConstructorDescriptionCanvasBuilder(double widthMm, double heightMm) Creates an empty canvas declaration; generation performs path-aware geometry validation. -
Method Summary
Modifier and TypeMethodDescriptionAppends bounded rich content using explicit physical coordinates.Appends bounded rich content with a stable identifier and inherited canvas typography.build()Returns an immutable snapshot; later builder mutations do not alter this model.element(PositionedContent element) Appends an already constructed immutable positioned element.Sets optional inherited canvas typography and outer spacing/pagination.Appends plain text converted through the ordinary letter paragraph rules.
-
Constructor Details
-
CanvasBuilder
public CanvasBuilder(double widthMm, double heightMm) Creates an empty canvas declaration; generation performs path-aware geometry validation.- Parameters:
widthMm- declared width in millimetersheightMm- declared height in millimeters
-
-
Method Details
-
at
Appends bounded rich content with a stable identifier and inherited canvas typography.- Parameters:
id- identifier unique within the resulting canvasbounds- local millimeter rectangleblocks- ordered rich content, snapshotted immediately- Returns:
- this builder
-
at
public CanvasBuilder at(String id, double xMm, double yMm, double width, double height, Block... blocks) Appends bounded rich content using explicit physical coordinates.- Parameters:
id- stable identifierxMm- left positionyMm- top positionwidth- declared element widthheight- declared element heightblocks- ordered rich content- Returns:
- this builder
-
text
Appends plain text converted through the ordinary letter paragraph rules.- Parameters:
id- stable identifierbounds- local millimeter rectangletext- literal text; markup is never interpreted- Returns:
- this builder
-
element
Appends an already constructed immutable positioned element.- Parameters:
element- positioned content, checked during generation- Returns:
- this builder
-
style
Sets optional inherited canvas typography and outer spacing/pagination.- Parameters:
value- nullable block overrides- Returns:
- this builder
-
build
Returns an immutable snapshot; later builder mutations do not alter this model.- Returns:
- canvas ready for ordinary block insertion
-