Class UiDiagramNode

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

public class UiDiagramNode extends Object
One vertex of a UiDiagram. Note that UiDiagramNode is not a UiNode subtype: it is an internal piece of a diagram and never rendered at the top level of the SUI tree.

Shape vs. styling

shape picks the geometry (rectangle, circle, diamond) and is constrained to identifiers the front-end renderer knows about (see UiDiagramShape for the built-in primitives, or any name a consumer registered via the JS registerShape() API). Everything domain-specific — colour, marker, "double border" — is layered on top via shapeClass, marker, and borderWidth.

Two flavours coexist in the same list, distinguished by synthetic:

  • Source nodes (synthetic = false) — back a real domain object. stepRef (or the equivalent in non-workflow domains) carries the unique reference so editors can resolve clicks.
  • Synthetic nodes (synthetic = true) — render-time scaffolding (start, end, merge, fork, join). Editors must treat these as non-deletable.
  • Constructor Details

    • UiDiagramNode

      public UiDiagramNode()
  • Method Details

    • put

      public UiDiagramNode put(String key, String value)
    • withShapeClass

      public UiDiagramNode withShapeClass(String cls)
      Sets shapeClass and returns this for fluent chaining.
    • withMarker

      public UiDiagramNode withMarker(String marker)
      Sets marker and returns this for fluent chaining.
    • withBorderWidth

      public UiDiagramNode withBorderWidth(int width)
      Sets borderWidth and returns this for fluent chaining.
    • withSize

      public UiDiagramNode withSize(int width, int height)
      Sets width + height together and returns this.
    • addChild

      public UiDiagramNode addChild(UiDiagramNode child)
      Adds a child node and returns this for fluent chaining.
    • of

      public static UiDiagramNode of(String id, String shape, String label)
      Factory shortcut: id, shape, label in one call. The shape is a free string — pass a UiDiagramShape constant for the built-ins.