Class UMLDocument

java.lang.Object
org.tquadrat.foundation.javadoc.umlgraph.UMLDocument

@ClassVersion(sourceVersion="$Id: UMLDocument.java 1282 2026-09-08 23:52:53Z tquadrat $") @API(status=INTERNAL, since="0.0.5") public final class UMLDocument extends Object
The container for a UML diagram.
Author:
Thomas Thrien - thomas.thrien@tquadrat.org
Version:
$Id: UMLDocument.java 1282 2026-09-08 23:52:53Z tquadrat $
Since:
0.0.5
  • Field Details

  • Constructor Details

    • UMLDocument

      public UMLDocument()
      Creates a new UMLDocument instance.
  • Method Details

    • addClippath

      public final String addClippath(SVGRectangle clipRectangle)
      Creates an SVG <clipPath> element from the given rectangle and adds it to the SVG root element for this UML document.
      Parameters:
      clipRectangle - The rectangle that defines the clip path.
      Returns:
      The id of the new SVG <clipPath> element.
    • addConnector

      public final void addConnector(UMLConnector connector)
      Adds a UML connector for two type elements to this UML document.
      Parameters:
      connector - The connector.
    • addSymbol

      public final boolean addSymbol(TypeSymbol symbol)
      Adds the symbol for a type element to the UML document
      Parameters:
      symbol - The symbol to add.
      Returns:
      true if the symbol was added, false if not.
    • addUse

      public final void addUse(SVGUse use)
      Places a symbol in the output diagram.
      Parameters:
      use - The reference to the <symbol> element represent a type.
    • createId

      public final String createId()
      Creates a new id that is unique inside the current UML document instance.
      Returns:
      The new id.
    • getSVGRoot

      public final SVG getSVGRoot()
      Returns the SVG root element for this UML document.
      Returns:
      The SVG root element.
    • getSymbol

      public final Optional<TypeSymbol> getSymbol(Name name)
      Returns the symbol with for the type element with the given name from this UML document.
      Parameters:
      name - The name of the type element.
      Returns:
      An instance of Optional that contains the symbol.
    • loadCSS

      private static final String[] loadCSS() throws IOException
      Loads the CSS from the resources.
      Returns:
      The CSS styles.
      Throws:
      IOException - There is a problem on reading the resource with the CSS.
    • setDimension

      public final void setDimension(double width, double height)
      Sets the width and height for the UML diagram.
      Parameters:
      width - The width.
      height - The height.
    • toString

      public final String toString()
      Overrides:
      toString in class Object