Package org.jboss.elemento.svg


package org.jboss.elemento.svg
Provides classes and interfaces for creating and manipulating SVG (Scalable Vector Graphics) elements using a fluent builder API.

This package offers a type-safe, builder-based approach to working with SVG elements in GWT and J2CL applications. It provides factory methods, element wrappers, and builder interfaces for common SVG elements and containers.

Key Classes

SVG
Main entry point with static factory methods for creating SVG elements (svg, circle, rect, path, etc.)
SVGElement
Base interface for all SVG DOM elements, corresponding to the W3C SVGElement specification
SVGElementBuilder
Builder for simple SVG elements with methods for attributes, classes, events, and styling
SVGContainerBuilder
Builder for container-like SVG elements that can hold child elements

Use the static methods in SVG to create SVG elements:

svg().css("spinner", "large")
        .aria("label", "Loading...")
        .attr("role", "progressbar")
        .attr("viewBox", "0 0 100 100")
        .add(circle().css("spinner", "path")
                .attr("cx", 50)
                .attr("cy", 50)
                .attr("r", 45)
                .attr("fill", "none"));

Supported Elements

The package provides factory methods for the following SVG elements:

  • svg - Root SVG container
  • circle - Circle shape
  • ellipse - Ellipse shape
  • g - Group container
  • line - Line shape
  • path - Path shape with complex curves and lines
  • polygon - Polygon shape
  • rect - Rectangle shape
  • text - Text element
See Also:
  • Class
    Description
     
    The SVGCircleElement interface is an interface for the <circle> element.
    Builder for container-like SVG elements.
    All the SVG DOM interfaces that correspond directly to elements in the SVG language derive from the SVGElement interface.
    Builder for simple SVG elements.
    SVGElementDataMethods<E extends SVGElement, B extends TypedBuilder<E,B>>
    Provides methods and default implementations for modifying the data set of SVG elements.
    Provides methods and default implementations for modifying the style of SVG elements.
    The SVGEllipseElement interface provides access to the properties of <ellipse> elements.
    The SVGGElement interface corresponds to the <g> element.
    The SVGLineElement interface provides access to the properties of <line> elements, as well as methods to manipulate them.
    The SVGPathElement interface corresponds to the <path> element.
    The SVGPolygonElement interface provides access to the properties of <polygon> elements, as well as methods to manipulate them.
    The SVGRectElement interface provides access to the properties of <rect> elements, as well as methods to manipulate them.
    The SVGTextElement interface corresponds to the <text> elements.