Skip to content

Persist the "Group multiplicities / role names" class diagram layout option (#16)#135

Open
cansin wants to merge 4 commits into
useocl:mainfrom
cansin:claude/dreamy-keller-m6isga
Open

Persist the "Group multiplicities / role names" class diagram layout option (#16)#135
cansin wants to merge 4 commits into
useocl:mainfrom
cansin:claude/dreamy-keller-m6isga

Conversation

@cansin

@cansin cansin commented Jun 9, 2026

Copy link
Copy Markdown

Summary

Fixes #16.

The class diagram layout option "Group multiplicities / role names" was not
stored in the layout file, so the setting was lost whenever a model was
reopened. This PR persists the option in the layout file and enables it by
default for class diagrams.

Changes

  • Add a groupmultiplicityrolenames layout tag and write/read it in
    DiagramOptions#saveOptions / #loadOptions, guarded by a bumped layout
    version (13 → 14) so older layout files remain loadable and unaffected.
  • Default the option to true for class diagrams (ClassDiagramOptions).
    Object, communication and state machine diagrams are unchanged.
  • Make MultiplicityRolenameWrapper mirror the actual option value instead of
    blindly toggling do_group on every change, and initialise its grouping
    state from the option, so a restored or default value is honoured.
  • Suppress grouping while a layout is being restored (using the existing
    isLoadingLayout flag, now set around layout loading in DiagramView) so
    the restored positions of multiplicities / role names are not overwritten.

Backward compatibility

  • Layout files written by older versions (version ≤ 13) do not contain the new
    tag. The version > 13 guard keeps the default and never resets the option,
    and loading such files does not fail.
  • New layout files are written with version 14.

Testing

  • New DiagramOptionsPersistenceTest (JUnit 5) covering: the true/false
    save–load round-trip, presence of the option element in the saved XML, the
    default value, the layout-version bump, backward compatibility with a
    pre-v14 layout file, and that the existing options still round-trip.
  • Full use-gui suite is green, including the 129 ShellIT integration tests
    and the ArchUnit layered-architecture test (no new package-dependency
    violations).

Notes

  • The persistence behaviour is fully unit-tested. The GUI-runtime parts (the
    wrapper sync and the loading guard) are exercised manually rather than with a
    unit test, as they would require a full diagram harness to set up.

claude added 2 commits June 9, 2026 04:21
…ocl#16)

The class diagram layout option "Group multiplicities / role names" was
not stored in the layout file, so the setting was lost whenever a model
was reopened. It now defaults to enabled for class diagrams and is saved
to and restored from the layout file.

Changes:
- Add a "groupmultiplicityrolenames" layout tag and write/read it in
  DiagramOptions#saveOptions/#loadOptions, guarded by a new layout
  version (14) for backward compatibility with older layout files.
- Default the option to true for class diagrams (ClassDiagramOptions).
- Make MultiplicityRolenameWrapper mirror the actual option value
  instead of blindly toggling on every change, and initialize its
  grouping state from the option, so a loaded/default value is honored.
- Suppress grouping while a layout is being restored (reusing the
  existing isLoadingLayout flag, now set around layout loading in
  DiagramView) so restored label positions are not overwritten.

Add DiagramOptionsPersistenceTest covering the save/load round-trip,
the default value, the layout-version bump and backward compatibility
with pre-v14 layout files.

https://claude.ai/code/session_01A85dAvTAvi2oWkGZH6REEq
The layered-architecture test writes docs/archunit-results/*-failure-report.txt
on every run. Only the directory's README is meant to be tracked, so ignore
the generated report files.

https://claude.ai/code/session_01A85dAvTAvi2oWkGZH6REEq
@cansin cansin changed the title Persist the "Group multiplicities / role names" class diagram layout option Persist the "Group multiplicities / role names" class diagram layout option (resolves #16) Jun 9, 2026
@cansin cansin changed the title Persist the "Group multiplicities / role names" class diagram layout option (resolves #16) Persist the "Group multiplicities / role names" class diagram layout option (#16) Jun 9, 2026
claude added 2 commits June 9, 2026 06:32
Add @author Cansin Yildiz and @author Claude to the files added in this
branch, and update the copyright year to 1999-2026.

Co-authored-by: Claude <[email protected]>
https://claude.ai/code/session_01A85dAvTAvi2oWkGZH6REEq
@cansin cansin force-pushed the claude/dreamy-keller-m6isga branch from a0310f9 to c750f4c Compare June 9, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default value for "Group Multiplicities/Role names" layout option

2 participants