Skip to content

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

Open
@jeevcat

Description

@jeevcat

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions