Class CanvasBuilder

java.lang.Object
com.nsdev.lettergenerator.builder.CanvasBuilder

public final class CanvasBuilder extends Object
Mutable, call-local authoring builder producing owned immutable canvas models.
  • 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 millimeters
      heightMm - declared height in millimeters
  • Method Details

    • at

      public CanvasBuilder at(String id, Bounds bounds, Block... blocks)
      Appends bounded rich content with a stable identifier and inherited canvas typography.
      Parameters:
      id - identifier unique within the resulting canvas
      bounds - local millimeter rectangle
      blocks - 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 identifier
      xMm - left position
      yMm - top position
      width - declared element width
      height - declared element height
      blocks - ordered rich content
      Returns:
      this builder
    • text

      public CanvasBuilder text(String id, Bounds bounds, String text)
      Appends plain text converted through the ordinary letter paragraph rules.
      Parameters:
      id - stable identifier
      bounds - local millimeter rectangle
      text - literal text; markup is never interpreted
      Returns:
      this builder
    • element

      public CanvasBuilder element(PositionedContent element)
      Appends an already constructed immutable positioned element.
      Parameters:
      element - positioned content, checked during generation
      Returns:
      this builder
    • style

      public CanvasBuilder style(Style value)
      Sets optional inherited canvas typography and outer spacing/pagination.
      Parameters:
      value - nullable block overrides
      Returns:
      this builder
    • build

      public CanvasBlock build()
      Returns an immutable snapshot; later builder mutations do not alter this model.
      Returns:
      canvas ready for ordinary block insertion