Skip to content

Support for Subjects in Use Case Diagrams #579

@Gregor-Gottschewski

Description

@Gregor-Gottschewski

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.

Metadata

Metadata

Labels

featureA feature requestmainIssues with the main code base

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions