Skip to content

Commit

Permalink
[3677] Remove old position, size and ratio from old layout engine
Browse files Browse the repository at this point in the history
Bug: #3677
Signed-off-by: Guillaume Coutable <[email protected]>
  • Loading branch information
gcoutable authored and sbegaudeau committed Sep 23, 2024
1 parent 9989503 commit d70c426
Show file tree
Hide file tree
Showing 106 changed files with 527 additions and 3,349 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ An event may have been caused by another event or caused by an input received fr
It is now possible to choose between three options:
never, always and if_children (to display the separator only if children exist).
- https://github.com/eclipse-sirius/sirius-web/issues/4021[#4021] [sirius-web] Disable the _Rename_ and _Delete_ project menu actions when project is read-only
- https://github.com/eclipse-sirius/sirius-web/issues/3677[#3677] [diagram] Remove backend layouting code from the time the backend was computing the layout.

== v2024.9.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2024 Obeo and others.
* Copyright (c) 2019, 2024 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -33,7 +33,6 @@
import org.eclipse.sirius.components.diagrams.LabelOverflowStrategy;
import org.eclipse.sirius.components.diagrams.LabelTextAlign;
import org.eclipse.sirius.components.diagrams.LineStyle;
import org.eclipse.sirius.components.diagrams.Size;
import org.eclipse.sirius.components.diagrams.description.EdgeDescription;
import org.eclipse.sirius.components.diagrams.description.InsideLabelDescription;
import org.eclipse.sirius.components.diagrams.description.LabelStyleDescription;
Expand Down Expand Up @@ -131,7 +130,6 @@ private NodeDescription createNodeDescription(String id) {
.insideLabelDescription(insideLabelDescription)
.styleProvider(variableManager -> null)
.childrenLayoutStrategyProvider(variableManager -> new FreeFormLayoutStrategy())
.sizeProvider(variableManager -> Size.UNDEFINED)
.borderNodeDescriptions(List.of())
.childNodeDescriptions(List.of())
.labelEditHandler((variableManager, newLabel) -> new Success())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
import org.eclipse.sirius.components.diagrams.LineStyle;
import org.eclipse.sirius.components.diagrams.Node;
import org.eclipse.sirius.components.diagrams.NodeType;
import org.eclipse.sirius.components.diagrams.Position;
import org.eclipse.sirius.components.diagrams.Ratio;
import org.eclipse.sirius.components.diagrams.RectangularNodeStyle;
import org.eclipse.sirius.components.diagrams.Size;
import org.eclipse.sirius.components.diagrams.ViewModifier;
import org.eclipse.sirius.components.diagrams.tools.SingleClickOnDiagramElementTool;
import org.eclipse.sirius.components.representations.Success;
Expand All @@ -56,8 +53,6 @@ public Diagram getDiagram(String id) {
.label("diagramLabel")
.descriptionId(UUID.randomUUID().toString())
.targetObjectId("diagramTargetObjectId")
.position(Position.UNDEFINED)
.size(Size.UNDEFINED)
.nodes(List.of())
.edges(List.of())
.build();
Expand Down Expand Up @@ -88,8 +83,6 @@ public Node getNode(String id, boolean withLabel) {
.descriptionId(UUID.randomUUID().toString())
.style(this.getRectangularNodeStyle())
.childrenLayoutStrategy(new FreeFormLayoutStrategy())
.position(Position.UNDEFINED)
.size(Size.UNDEFINED)
.borderNodes(List.of())
.childNodes(List.of())
.modifiers(Set.of())
Expand Down Expand Up @@ -137,11 +130,8 @@ public Edge getEdge(String id, String sourceId, String targetId) {
.sourceId(sourceId)
.targetId(targetId)
.style(style)
.routingPoints(List.of())
.modifiers(Set.of())
.state(ViewModifier.Normal)
.sourceAnchorRelativePosition(Ratio.UNDEFINED)
.targetAnchorRelativePosition(Ratio.UNDEFINED)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2021, 2024 Obeo and others.
* Copyright (c) 2021, 2024 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -35,9 +35,7 @@
import org.eclipse.sirius.components.diagrams.LabelOverflowStrategy;
import org.eclipse.sirius.components.diagrams.LabelTextAlign;
import org.eclipse.sirius.components.diagrams.LineStyle;
import org.eclipse.sirius.components.diagrams.Position;
import org.eclipse.sirius.components.diagrams.RectangularNodeStyle;
import org.eclipse.sirius.components.diagrams.Size;
import org.eclipse.sirius.components.diagrams.ViewCreationRequest;
import org.eclipse.sirius.components.diagrams.description.DiagramDescription;
import org.eclipse.sirius.components.diagrams.description.InsideLabelDescription;
Expand Down Expand Up @@ -95,8 +93,6 @@ public void initialize() {
.descriptionId(diagramDescription.getId())
.targetObjectId(UUID.randomUUID().toString())
.label("DiagramTest")
.position(Position.at(0, 0))
.size(Size.of(100, 100))
.nodes(new ArrayList<>())
.edges(List.of())
.build();
Expand Down Expand Up @@ -248,7 +244,6 @@ private NodeDescription getNodeDescription(String nodeDescriptionId) {
.insideLabelDescription(insideLabelDescription)
.styleProvider(nodeStyleProvider)
.childrenLayoutStrategyProvider(variableManager -> new FreeFormLayoutStrategy())
.sizeProvider(variableManager -> Size.UNDEFINED)
.borderNodeDescriptions(new ArrayList<>())
.childNodeDescriptions(new ArrayList<>())
.labelEditHandler((variableManager, newLabel) -> new Success())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2021, 2024 Obeo and others.
* Copyright (c) 2021, 2024 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -39,9 +39,7 @@
import org.eclipse.sirius.components.diagrams.LabelTextAlign;
import org.eclipse.sirius.components.diagrams.LineStyle;
import org.eclipse.sirius.components.diagrams.Node;
import org.eclipse.sirius.components.diagrams.Position;
import org.eclipse.sirius.components.diagrams.RectangularNodeStyle;
import org.eclipse.sirius.components.diagrams.Size;
import org.eclipse.sirius.components.diagrams.ViewDeletionRequest;
import org.eclipse.sirius.components.diagrams.ViewModifier;
import org.eclipse.sirius.components.diagrams.description.DiagramDescription;
Expand Down Expand Up @@ -119,8 +117,6 @@ public void initialize() {
.textAlign(LabelTextAlign.CENTER)
.build())
.style(ImageNodeStyle.newImageNodeStyle().imageURL("").scalingFactor(0).build())
.position(Position.at(0, 0))
.size(Size.of(10, 10))
.borderNodes(List.of())
.childNodes(List.of())
.state(ViewModifier.Normal)
Expand All @@ -132,8 +128,6 @@ public void initialize() {
.descriptionId(diagramDescription.getId())
.targetObjectId(UUID.randomUUID().toString())
.label("DiagramTest")
.position(Position.at(0, 0))
.size(Size.of(100, 100))
.nodes(List.of(node))
.edges(List.of())
.build();
Expand Down Expand Up @@ -234,7 +228,6 @@ private NodeDescription getNodeDescription(String nodeDescriptionId) {
.insideLabelDescription(insideLabelDescription)
.styleProvider(nodeStyleProvider)
.childrenLayoutStrategyProvider(variableManager -> new FreeFormLayoutStrategy())
.sizeProvider(variableManager -> Size.UNDEFINED)
.borderNodeDescriptions(new ArrayList<>())
.childNodeDescriptions(new ArrayList<>())
.labelEditHandler((variableManager, newLabel) -> new Success())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.eclipse.sirius.components.diagrams.LabelOverflowStrategy;
import org.eclipse.sirius.components.diagrams.LabelTextAlign;
import org.eclipse.sirius.components.diagrams.NodeType;
import org.eclipse.sirius.components.diagrams.Size;
import org.eclipse.sirius.components.diagrams.description.InsideLabelDescription;
import org.eclipse.sirius.components.diagrams.description.LabelStyleDescription;
import org.eclipse.sirius.components.diagrams.description.NodeDescription;
Expand Down Expand Up @@ -120,7 +119,6 @@ public NodeDescription convert(AbstractNodeMapping abstractNodeMapping, AQLInter
}
return result;
};
Function<VariableManager, Size> sizeProvider = variableManager -> Size.UNDEFINED;

String domainClass = abstractNodeMapping.getDomainClass();
String semanticCandidatesExpression = abstractNodeMapping.getSemanticCandidatesExpression();
Expand Down Expand Up @@ -158,7 +156,6 @@ public NodeDescription convert(AbstractNodeMapping abstractNodeMapping, AQLInter
.insideLabelDescription(insideLabelDescription)
.styleProvider(styleProvider)
.childrenLayoutStrategyProvider(childrenLayoutStrategyProvider)
.sizeProvider(sizeProvider)
.borderNodeDescriptions(borderNodeDescriptions)
.childNodeDescriptions(childNodeDescriptions)
.collapsible(collapsible)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import org.eclipse.sirius.components.diagrams.CollapsingState;
import org.eclipse.sirius.components.diagrams.INodeStyle;
import org.eclipse.sirius.components.diagrams.ImageNodeStyle;
import org.eclipse.sirius.components.diagrams.Position;
import org.eclipse.sirius.components.diagrams.Size;
import org.eclipse.sirius.components.diagrams.ViewModifier;
import org.eclipse.sirius.components.diagrams.description.DiagramDescription;
import org.eclipse.sirius.components.diagrams.elements.NodeElementProps;
Expand Down Expand Up @@ -76,7 +74,6 @@ public String getIdentifier(Object element) {
}

private Element createNodeElement(String descriptionId) {
// @formatter:off
INodeStyle style = ImageNodeStyle.newImageNodeStyle()
.imageURL("")
.scalingFactor(42)
Expand All @@ -89,14 +86,11 @@ private Element createNodeElement(String descriptionId) {
.targetObjectLabel("targetObjectLabel")
.descriptionId(descriptionId)
.style(style)
.position(Position.UNDEFINED)
.size(Size.UNDEFINED)
.children(List.of())
.state(ViewModifier.Normal)
.modifiers(Set.of())
.collapsingState(CollapsingState.EXPANDED)
.build();
// @formatter:on
return new Element(NodeElementProps.TYPE, nodeElementProps);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import org.eclipse.sirius.components.diagrams.CollapsingState;
import org.eclipse.sirius.components.diagrams.INodeStyle;
import org.eclipse.sirius.components.diagrams.ImageNodeStyle;
import org.eclipse.sirius.components.diagrams.Position;
import org.eclipse.sirius.components.diagrams.Size;
import org.eclipse.sirius.components.diagrams.ViewModifier;
import org.eclipse.sirius.components.diagrams.description.DiagramDescription;
import org.eclipse.sirius.components.diagrams.elements.NodeElementProps;
Expand Down Expand Up @@ -70,7 +68,6 @@ public String getIdentifier(Object element) {
}

private Element createNodeElement(String descriptionId) {
// @formatter:off
INodeStyle style = ImageNodeStyle.newImageNodeStyle()
.imageURL("")
.build();
Expand All @@ -82,14 +79,11 @@ private Element createNodeElement(String descriptionId) {
.targetObjectLabel("targetObjectLabel")
.descriptionId(descriptionId)
.style(style)
.position(Position.UNDEFINED)
.size(Size.UNDEFINED)
.children(List.of())
.state(ViewModifier.Normal)
.modifiers(Set.of())
.collapsingState(CollapsingState.EXPANDED)
.build();
// @formatter:on
return new Element(NodeElementProps.TYPE, nodeElementProps);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.UUID;

import org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramInput;
import org.eclipse.sirius.components.diagrams.Position;
import org.eclipse.sirius.components.diagrams.events.ReconnectEdgeKind;

/**
Expand All @@ -29,6 +28,5 @@ public record ReconnectEdgeInput(
String representationId,
String edgeId,
String newEdgeEndId,
ReconnectEdgeKind reconnectEdgeKind,
Position newEdgeEndPosition) implements IDiagramInput {
ReconnectEdgeKind reconnectEdgeKind) implements IDiagramInput {
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit d70c426

Please sign in to comment.