Hi all,
I’m currently trying to modify the create_LAB_diagram script in order to define the positions of components created in the diagram
To do so I added a call to set_bounds function from diagram.py
# we define a function that will recursively walk the given LogicalComponent and it’s children to apply the given mapping.
def create_logical_component_mappings(parentContainer, logical_component, mapping):
for child in logical_component.get_owned_logical_components():
# the semantic element of the “LAB Logical Component” is the component Part
newContainer = apply_mapping(parentContainer, mappingComponent, child.get_java_object().getAbstractTypedElements()[0])
newContainer.getSemanticElements().add(logical_component.get_java_object())
set_bounds(newContainer, [10, 20, 50, 80])
# we call the same function on the child LogicalComponent
create_logical_component_mappings(newContainer, child, mapping)
And then encounter the following error: “the given diagram element has no GMF node.” Because eInverseByType does not find any object referencing the created container
It seems that the created DNodeContainerSpec (newContainer) is not “fully” created
I’ve tried adding a call to a refresh (org.eclipse.sirius.diagram.business.internal.dialect.DiagramDialectServices().refesh(…)) without any success
How could I set up the bounds of a component in diagram created through script?
Thanks in advance