Class UiDiagramShape

java.lang.Object
ai.mindconnect.ui.ext.diagram.UiDiagramShape

public final class UiDiagramShape extends Object
Built-in shape identifiers known to the diagram renderer. These are the geometric primitives the extension ships handlers for — kept deliberately narrow and domain-agnostic so the extension stays reusable.

Why constants, not an enum

UiDiagramNode.shape is a plain String, not an enum, so consumers can register their own shape names at runtime via the front-end registry (registerShape() in extension.ts). Closing the type over a Java enum here would force every new shape into a JAR rebuild even though the rendering side is already plug-able.

Domain-specific shapes

Workflow-flavoured concepts like "decision", "fork", "event-start" are not primitives — they're domain concepts that map onto a primitive plus styling. Those live in mc-workflow-ui-diagram's WorkflowShapes helper, not here.

To render with one of these constants:


   var n = new UiDiagramNode();
   n.setShape(UiDiagramShape.ROUNDED_RECT);
   n.setShapeClass("wf-action");
 
  • Field Details

    • ROUNDED_RECT

      public static final String ROUNDED_RECT
      Rectangle with rounded corners. Generic "block" / "action" look.
      See Also:
    • RECT

      public static final String RECT
      Sharp-cornered rectangle. Use for tables, raw containers, etc.
      See Also:
    • CIRCLE

      public static final String CIRCLE
      Circle inscribed in the node's bounding box (uses min(w, h)/2 as radius).
      See Also:
    • DIAMOND

      public static final String DIAMOND
      Diamond / rhombus — used for decisions, merges, choice points.
      See Also:
    • BAR

      public static final String BAR
      Thin horizontal (or vertical, depending on aspect ratio) bar. Used for fork / join markers in process notations.
      See Also:
    • CONTAINER_WITH_HEADER

      public static final String CONTAINER_WITH_HEADER
      Rounded-rect container with the label anchored to its top edge (header band) instead of the centre. Use when the node wraps child nodes — the centre is where the children draw, so a centred label would overlap them. Used for if-branch and foreach-loop containers.
      See Also: