JetUML icon indicating copy to clipboard operation
JetUML copied to clipboard

Support for Subjects in Use Case Diagrams

Open Gregor-Gottschewski opened this issue 2 months ago • 1 comments

According to the UML specification, subjects are part of the Use Case Diagram.
Currently, JetUML does not support subjects.
A subject is represented as a rectangle enclosing use cases and labeled with a name and optional stereotype (e.g., process, subsystem, service).


Design Considerations

Components to Add or Extend

  • Add
    • SubjectNode
    • SubjectNodeRenderer
  • Extend
    • UseCaseDiagramRenderer
    • UseCaseDiagramValidator
    • Prototypes
    • DiagramType.USECASE

Wireframe

Image


Potential Issues

JetUML currently does not support manual resizing of nodes.
A subject’s visual size should ideally depend on the number of contained use cases.

Possible Solutions

F1: Fixed Size (Dirty)

  • Use a static rectangle size for all subjects
  • Ensures subjects are never too small, but may appear too large for few use cases
  • No API changes required
  • Simplest and fastest implementation

Pros

  • Minimal code change
  • No impact on current resizing model

Cons

  • Inefficient use of diagram space
  • Poor scalability for complex diagrams

F2: Adjustable Size via Properties (Cleaner)

  • Add WIDTH and HEIGHT properties to AbstractNode.
  • User can change size in Properties viewer
  • Renderer adapts to these properties.

Pros

  • More flexible subject representation
  • Backward-compatible default sizes possible

Cons

  • Requires renderer adjustments
  • Introduces moderate to big API changes

F3: User-Resizable Subjects (Cleanest, Complex)

  • Introduce UI-based resizing for nodes
  • Extend interaction model and rendering logic
  • Similar to graphical frameworks with bounding box manipulation

Pros

  • Most intuitive for users
  • Fully dynamic diagram layout

Cons

  • Major API and UI changes
  • Complex to validate and persist
  • Requires consistent integration with layout and connector logic

Recommendation

For the initial implementation, F1 (Fixed Size) is sufficient. It enables basic UML compliance and feature completeness with minimal code changes. Solutions F2 and F3 can be considered for the future to enhance flexibility and usability.


Further design consinderations follow, if approved and solution (F1, F2, F3) discussed.

Gregor-Gottschewski avatar Oct 29 '25 10:10 Gregor-Gottschewski

This is worth trying for Release 3.10. I think what we can largely copy the design of PackageNode (and PackageNodeRenderer). I recommend experimenting with this. It has all the right stuff, including auto-sizing based on content and a shortcut key (Shift) to add/remove nodes from a package -> subject. See also Item 30 in the user guide

prmr avatar Oct 30 '25 23:10 prmr