use of org.eclipse.sirius.components.diagrams.layout.incremental.IncrementalLayoutConvertedDiagram in project sirius-components by eclipse-sirius.
the class LayoutService method incrementalLayout.
@Override
public Diagram incrementalLayout(IEditingContext editingContext, Diagram newDiagram, Optional<IDiagramEvent> optionalDiagramElementEvent) {
IncrementalLayoutConvertedDiagram convertedDiagram = this.incrementalLayoutDiagramConverter.convert(newDiagram);
DiagramLayoutData diagramLayoutData = convertedDiagram.getDiagramLayoutData();
var representationDescription = this.representationDescriptionSearchService.findById(editingContext, newDiagram.getDescriptionId());
ISiriusWebLayoutConfigurator layoutConfigurator;
if (representationDescription.isPresent() && representationDescription.get() instanceof DiagramDescription) {
layoutConfigurator = this.layoutConfiguratorRegistry.getLayoutConfigurator(newDiagram, (DiagramDescription) representationDescription.get());
} else {
layoutConfigurator = this.layoutConfiguratorRegistry.getDefaultLayoutConfigurator();
}
this.incrementalLayoutEngine.layout(optionalDiagramElementEvent, diagramLayoutData, layoutConfigurator);
Map<String, ILayoutData> id2LayoutData = convertedDiagram.getId2LayoutData();
return this.incrementalLayoutedDiagramProvider.getLayoutedDiagram(newDiagram, diagramLayoutData, id2LayoutData);
}
Aggregations