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

Adding NodeModel to NodeLayer set itself as its parent, but NodeModel's parent must be a Diagram #1023

Open
jeevcat opened this issue Dec 18, 2023 · 0 comments

Comments

@jeevcat
Copy link
Contributor

jeevcat commented Dec 18, 2023

The type the parent of a NodeModel must be a DiagramModel (which is a CanvasModel):

However, when adding a node to a layer, the layer sets the node's parent to itself:

As LayerModel doesn't inherit from DiagramModel, a class inheriting from NodeModel cannot correctly define its parent type to be a NodeLayerModel (due to the G extends NodeModelGenerics constraint), which is what the parent will actually be at runtime, if the node has been added to a layer.

The above also applies for links.

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

No branches or pull requests

1 participant