Class KonceptSvgRenderer

java.lang.Object
network.ike.docs.koncept.KonceptSvgRenderer

public final class KonceptSvgRenderer extends Object
Generates inline SVG badge markup for Koncept references.

The badge renders as a compact, clickable pill that links to the glossary anchor for the referenced Koncept. The component-kind sigil (ike-issues#638) leads the badge: a coloured letter (D/S/P/?) for description/semantic/pattern/unknown, the locked StampSigilGeometry pentagon for a stamp — whose compact provenance text stands in place of a name — and nothing for a bare Koncept.

SVG is used rather than HTML/CSS to ensure consistent rendering across HTML and PDF backends.

  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    render(String target, String label, KonceptKind kind)
    Render an inline SVG badge for a Koncept reference, honest about its kind.
    static String
    render(String target, String label, KonceptKind kind, boolean inactive)
    Render an inline SVG badge for a Koncept reference — the no-computable-identity fallback, converged to the identicon-pill look (ike-issues#864): the spec's light pill, the small-caps IKE-blue label (struck through in the retired colour when inactive), and the leading kind sigil — no more solid-blue box, white text, or K prefix.
    static String
    Render a component-kind sigil on its own at natural badge scale — see renderSigil(KonceptKind, double).
    static String
    renderSigil(KonceptKind kind, double scale)
    Render a component-kind sigil on its own — no badge, no anchor, no name — as standalone inline SVG from the same locked constants the badge renderers use (KonceptKind's glyph/colour data and the StampSigilGeometry pentagon), so a sigil shown in prose can never drift from the sigil shown in a badge.
    static String
    renderStampSigil(String target, String label)
    Render a STAMP badge without an identicon — the no-computable-identity fallback (the identicon-bearing stamp chip is KonceptInlineMacro#renderHtmlStampChip): the locked gray pentagon (computed from the shared StampSigilGeometry) as inline SVG — five asymmetric reading dots and a centre hub — beside the compact provenance text that stands in place of a name.
    static String
    Render a stamp chip as a specimen — the pentagon and compact provenance text, exactly as renderStampSigil(String, String) draws them, but with no anchor: for prose that shows what a stamp badge looks like (a "How to Read This Guide" front matter) rather than referencing a glossary-curated component.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • render

      public static String render(String target, String label, KonceptKind kind)
      Render an inline SVG badge for a Koncept reference, honest about its kind.
      Parameters:
      target - the CamelCase koncept identifier (used for the anchor link)
      label - the human-readable display label
      kind - the component kind; null is treated as KonceptKind.CONCEPT
      Returns:
      complete SVG+anchor HTML string suitable for inline passthrough
    • render

      public static String render(String target, String label, KonceptKind kind, boolean inactive)
      Render an inline SVG badge for a Koncept reference — the no-computable-identity fallback, converged to the identicon-pill look (ike-issues#864): the spec's light pill, the small-caps IKE-blue label (struck through in the retired colour when inactive), and the leading kind sigil — no more solid-blue box, white text, or K prefix. Identicon-less by definition: this path only renders when no PublicId resolves, so there is nothing to draw an identicon from.
      Parameters:
      target - the CamelCase koncept identifier (used for the anchor link)
      label - the human-readable display label
      kind - the component kind; null is treated as KonceptKind.CONCEPT
      inactive - whether the referent's latest version is inactive (retired parity, #742)
      Returns:
      complete SVG+anchor HTML string suitable for inline passthrough
    • renderStampSigil

      public static String renderStampSigil(String target, String label)
      Render a STAMP badge without an identicon — the no-computable-identity fallback (the identicon-bearing stamp chip is KonceptInlineMacro#renderHtmlStampChip): the locked gray pentagon (computed from the shared StampSigilGeometry) as inline SVG — five asymmetric reading dots and a centre hub — beside the compact provenance text that stands in place of a name. The geometry is the same numbers the JavaFX node and the Java2D PNG use, so the pentagon is identical in every medium.

      The label is the caller-formatted, verbatim provenance string; this renderer only HTML-escapes it and never reformats or re-spells it. In particular the status token within label must already be the verbatim closed-vocabulary value (render closed vocabularies verbatim).

      Parameters:
      target - the CamelCase koncept identifier (used for the anchor link)
      label - the compact stamp text (status · date-time · author) shown beside the pentagon — provenance, in place of a name
      Returns:
      complete SVG+anchor HTML string for the stamp pentagon + compact text
    • renderStampSpecimen

      public static String renderStampSpecimen(String label)
      Render a stamp chip as a specimen — the pentagon and compact provenance text, exactly as renderStampSigil(String, String) draws them, but with no anchor: for prose that shows what a stamp badge looks like (a "How to Read This Guide" front matter) rather than referencing a glossary-curated component.
      Parameters:
      label - the compact stamp text (status · date-time · author), verbatim
      Returns:
      the stamp chip SVG, unlinked
    • renderSigil

      public static String renderSigil(KonceptKind kind)
      Render a component-kind sigil on its own at natural badge scale — see renderSigil(KonceptKind, double).
      Parameters:
      kind - the component kind; null is treated as KonceptKind.CONCEPT
      Returns:
      the sigil SVG, or an empty string for the bare KonceptKind.CONCEPT
    • renderSigil

      public static String renderSigil(KonceptKind kind, double scale)
      Render a component-kind sigil on its own — no badge, no anchor, no name — as standalone inline SVG from the same locked constants the badge renderers use (KonceptKind's glyph/colour data and the StampSigilGeometry pentagon), so a sigil shown in prose can never drift from the sigil shown in a badge. Carries the kind's KonceptKind.accessibleName() as the SVG <title> for assistive technology. The geometry lives in the SVG viewBox; scale only enlarges the rendered box (legend and teaching contexts want the mark bigger than badge scale without redrawing it).
      Parameters:
      kind - the component kind; null is treated as KonceptKind.CONCEPT
      scale - the display scale, 1.0 being natural badge scale
      Returns:
      the sigil SVG, or an empty string for the bare KonceptKind.CONCEPT, which by design shows no sigil