Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagram.ownedPresentation and Presentation.diagram do not behave as normal relationships #1083

Closed
amolenaar opened this issue Oct 17, 2021 · 1 comment
Labels
bug An issue in the application not-quite-right This feature is not ready yet
Milestone

Comments

@amolenaar
Copy link
Member

Adding a listener for diagram.ownedPresentation does only work for delete events.

On creation, event submission is suppressed during the creation of a diagram item. A diagram item gets a diagram on construction and can not exist without a diagram being set. However, since events are suppressed, services like EventDispatcher do not detect updates on the structure and are therefore unaware of changes in Diagram.ownedPresentation.

The reason events are suppressed during construction is that a model element should first be announced via an ElementCreated event. that is the point an element is available from our repository (element factory) That way we know an element exists and the undo manager can track it accordingly.

On the Presentation.diagram item side this is not a problem: there are no listeners for this specific item while it's being created.

Since Presentations are now normal model elements, managed by ElementFactory, it would be good if their properties expose the same behavior.

Version

Version of Gaphor: 2.x

@amolenaar amolenaar added bug An issue in the application not-quite-right This feature is not ready yet labels Oct 17, 2021
@amolenaar amolenaar added this to the 2.7.0 milestone Oct 31, 2021
@amolenaar
Copy link
Member Author

Closed by #1088.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue in the application not-quite-right This feature is not ready yet
Projects
None yet
Development

No branches or pull requests

1 participant