-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserving style when the type of a task or a gateway is changed
Change-Id: I6f56fb425d916f80c60f4df74c2144233308b263
- Loading branch information
Stephane Drapeau
authored and
Stephane Drapeau
committed
Mar 18, 2024
1 parent
cab5889
commit 5c1d3de
Showing
11 changed files
with
844 additions
and
474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...etwork.dsl.bpmn2.design/src/org/obeonetwork/bpmn2/design/refactoring/DiagramModifier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
* Copyright (c) 2024 Obeo. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
* | ||
*/ | ||
package org.obeonetwork.bpmn2.design.refactoring; | ||
|
||
import java.util.Collection; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.eclipse.sirius.business.api.session.Session; | ||
import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; | ||
import org.eclipse.sirius.common.tools.api.util.RefreshIdsHolder; | ||
import org.eclipse.sirius.diagram.DSemanticDiagram; | ||
import org.eclipse.sirius.diagram.EdgeTarget; | ||
import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManager; | ||
import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManagerRegistry; | ||
import org.eclipse.sirius.diagram.business.internal.helper.decoration.DecorationHelperInternal; | ||
import org.eclipse.sirius.diagram.business.internal.sync.DDiagramElementSynchronizer; | ||
import org.eclipse.sirius.diagram.description.DiagramElementMapping; | ||
import org.eclipse.sirius.diagram.description.EdgeMapping; | ||
import org.eclipse.sirius.diagram.description.MappingBasedDecoration; | ||
import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; | ||
import org.eclipse.sirius.tools.api.SiriusPlugin; | ||
import org.eclipse.sirius.tools.api.interpreter.InterpreterUtil; | ||
import org.eclipse.sirius.viewpoint.description.SemanticBasedDecoration; | ||
|
||
/** | ||
* | ||
* @author nperansin | ||
*/ | ||
@SuppressWarnings("restriction") | ||
class DiagramModifier { | ||
|
||
final Session session; | ||
final DSemanticDiagram parent; | ||
final ModelAccessor accessor; | ||
final IInterpreter interpreter; | ||
final DDiagramElementSynchronizer dsync; | ||
final DiagramMappingsManager mmapping; | ||
final RefreshIdsHolder idFactory; | ||
|
||
Map<DiagramElementMapping, Collection<EdgeTarget>> mappingsToEdgeTargets = null; | ||
final Map<EdgeMapping, Collection<MappingBasedDecoration>> edgeToMappings = new HashMap<>(); | ||
final Map<String, Collection<SemanticBasedDecoration>> edgeToSemantics = new HashMap<>(); | ||
|
||
protected DiagramModifier(DSemanticDiagram diagram, Session session) { | ||
this.session = session; | ||
parent = diagram; | ||
accessor = SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(diagram); | ||
mmapping = DiagramMappingsManagerRegistry.INSTANCE.getDiagramMappingsManager(session, diagram); | ||
interpreter = InterpreterUtil.getInterpreter(diagram); | ||
dsync = new DDiagramElementSynchronizer(diagram, interpreter, accessor); | ||
idFactory = RefreshIdsHolder.getOrCreateHolder(diagram); | ||
} | ||
|
||
protected void prepareEdges() { | ||
if (mappingsToEdgeTargets != null) { | ||
return; | ||
} | ||
mappingsToEdgeTargets = dsync.computeMappingsToEdgeTargets(session.getSelectedViewpoints(false)); | ||
// Initialize cache | ||
new DecorationHelperInternal(parent, interpreter, accessor).computeDecorations(mappingsToEdgeTargets, | ||
edgeToSemantics, edgeToMappings); | ||
// TODO update with new nodes ? | ||
} | ||
|
||
} |
Oops, something went wrong.