Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime PORHEL2013-12-11 08:20:54 -0500
committerMaxime PORHEL2013-12-11 08:27:59 -0500
commit2ff5618b3d8b1178f9ade67b96a4c2f15a676d58 (patch)
tree803988841be64f0f15311d8d239efb0d2cca4c06
parent48693804124fa95627e94fe445d9abe904864600 (diff)
downloadorg.eclipse.sirius-2ff5618b3d8b1178f9ade67b96a4c2f15a676d58.tar.gz
org.eclipse.sirius-2ff5618b3d8b1178f9ade67b96a4c2f15a676d58.tar.xz
org.eclipse.sirius-2ff5618b3d8b1178f9ade67b96a4c2f15a676d58.zip
[423577] Add variables for edge size computation
New variables are available for EdgeStyleDescription#sizeComputationExpression to compute edge size: . sourceView, . targetView, . view, . diagram. In addition correct preSource variable type in EdgeCreationDescription#connectionStartPrecondition (cherry picked from commit 9caed744447e4bf4a4b1edfdf49c907b06b2328c) Signed-off-by: Maxime PORHEL <maxime.porhel@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release Notes.html22
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release Notes.textile8
-rw-r--r--plugins/org.eclipse.sirius.editor/help/contexts.xml8
-rw-r--r--plugins/org.eclipse.sirius/model/viewpoint.ecore9
-rw-r--r--plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/style/impl/StylePackageImpl.java4
-rw-r--r--plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/ToolPackageImpl.java4
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/experimental/sync/DDiagramElementSynchronizer.java32
7 files changed, 82 insertions, 5 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
index 37c2c77934..ea369db700 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
@@ -547,6 +547,28 @@ void addSelectedView(DView view) throws IllegalArgumentException;
void removeSelectedView(DView view);
</pre>
+ <h3 id="SpecifierVisibleChanges">Specifier-Visible Changes</h3>
+ <p>New variables are available for
+ <code>sizeComputationExpression</code> to compute the size of edges on
+ <code>EdgeStyleDescription</code> and
+ <code>BracketEdgeStyleDescription</code>:
+ </p>
+ <ul>
+ <li>
+ <em>diagram</em>: the current
+ <code>DDiagram</code>
+ </li>
+ <li>
+ <em>view</em>: the current
+ <code>DEdge</code>
+ </li>
+ <li>
+ <em>sourceView</em>: the source view of the current edge.
+ </li>
+ <li>
+ <em>targetView</em>: the target view of the current edge.
+ </li>
+ </ul>
<h3 id="UserVisibleChanges2">User-Visible Changes</h3>
<ul>
<li>The ability to print table representations has been disabled for the 0.9 release due to an external dependency issue (see
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
index 432638c70a..a920dd7c6d 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
@@ -188,6 +188,14 @@ void createView(Viewpoint viewpoint, Collection<EObject> semantics, boolean crea
void addSelectedView(DView view) throws IllegalArgumentException;
void removeSelectedView(DView view);
+h3. Specifier-Visible Changes
+
+New variables are available for @sizeComputationExpression@ to compute the size of edges on @EdgeStyleDescription@ and @BracketEdgeStyleDescription@:
+* _diagram_: the current @DDiagram@
+* _view_: the current @DEdge@
+* _sourceView_: the source view of the current edge.
+* _targetView_: the target view of the current edge.
+
h3. User-Visible Changes
* The ability to print table representations has been disabled for the 0.9 release due to an external dependency issue (see "bug #422223":https://bugs.eclipse.org/bugs/show_bug.cgi?id=422223 for the details). It should be re-introduced in 1.0.
diff --git a/plugins/org.eclipse.sirius.editor/help/contexts.xml b/plugins/org.eclipse.sirius.editor/help/contexts.xml
index 646e4652c4..b5af842a55 100644
--- a/plugins/org.eclipse.sirius.editor/help/contexts.xml
+++ b/plugins/org.eclipse.sirius.editor/help/contexts.xml
@@ -2459,6 +2459,10 @@
Interpreted expressions, requested return type and available variables:
- sizeComputationExpression: an integer.
+ . diagram: the current DSemanticDiagram.
+ . view: the current edge view for which the size is calculated.
+ . sourceView: the source view of the current edge.
+ . targetView: the target view of the current edge.
@@ -2558,6 +2562,10 @@
Interpreted expressions, requested return type and available variables:
- sizeComputationExpression: an integer.
+ . diagram: the current DSemanticDiagram.
+ . view: the current edge view for which the size is calculated.
+ . sourceView: the source view of the current edge.
+ . targetView: the target view of the current edge.
diff --git a/plugins/org.eclipse.sirius/model/viewpoint.ecore b/plugins/org.eclipse.sirius/model/viewpoint.ecore
index 53e4f1db52..5e9fe4086a 100644
--- a/plugins/org.eclipse.sirius/model/viewpoint.ecore
+++ b/plugins/org.eclipse.sirius/model/viewpoint.ecore
@@ -3273,7 +3273,12 @@
<eAnnotations source="http://www.eclipse.org/sirius/interpreted/expression/returnType">
<details key="returnType" value="an integer."/>
</eAnnotations>
- <eAnnotations source="http://www.eclipse.org/sirius/interpreted/expression/variables"/>
+ <eAnnotations source="http://www.eclipse.org/sirius/interpreted/expression/variables">
+ <details key="diagram" value="viewpoint.DDiagram | the current DSemanticDiagram."/>
+ <details key="view" value="viewpoint.DEdge | the current edge view for which the size is calculated."/>
+ <details key="sourceView" value="viewpoint.EdgeTarget | the source view of the current edge."/>
+ <details key="targetView" value="viewpoint.EdgeTarget | the target view of the current edge."/>
+ </eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="routingStyle" lowerBound="1"
eType="#//EdgeRouting" defaultValueLiteral="straight">
@@ -3648,7 +3653,7 @@
<eAnnotations source="http://www.eclipse.org/sirius/interpreted/expression/variables">
<details key="container" value="ecore.EObject | the semantic element of diagram."/>
<details key="preSourceView" value="viewpoint.EdgeTarget | (edge only) the source view of the current potential edge."/>
- <details key="preSource" value="viewpoint.EdgeTarget | (edge only) the semantic element of $preSourceView."/>
+ <details key="preSource" value="ecore.EObject | (edge only) the semantic element of $preSourceView."/>
<details key="diagram" value="viewpoint.DDiagram | the diagram of the current potential edge"/>
</eAnnotations>
<eAnnotations source="http://www.eclipse.org/sirius/interpreted/expression/returnType">
diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/style/impl/StylePackageImpl.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/style/impl/StylePackageImpl.java
index 1309f13ea6..1bce080e96 100644
--- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/style/impl/StylePackageImpl.java
+++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/style/impl/StylePackageImpl.java
@@ -1643,7 +1643,9 @@ public class StylePackageImpl extends EPackageImpl implements StylePackage {
addAnnotation(getEllipseNodeDescription_HorizontalDiameterComputationExpression(), source, new String[] {});
addAnnotation(getEllipseNodeDescription_VerticalDiameterComputationExpression(), source, new String[] {});
addAnnotation(getDotDescription_StrokeSizeComputationExpression(), source, new String[] {});
- addAnnotation(getEdgeStyleDescription_SizeComputationExpression(), source, new String[] {});
+ addAnnotation(getEdgeStyleDescription_SizeComputationExpression(), source, new String[] { "diagram", "viewpoint.DDiagram | the current DSemanticDiagram.", "view",
+ "viewpoint.DEdge | the current edge view for which the size is calculated.", "sourceView", "viewpoint.EdgeTarget | the source view of the current edge.", "targetView",
+ "viewpoint.EdgeTarget | the target view of the current edge." });
addAnnotation(getTooltipStyleDescription_TooltipExpression(), source, new String[] { "view", "viewpoint.DSemanticDecorator | the current view." });
addAnnotation(getGaugeSectionDescription_MinValueExpression(), source, new String[] {});
addAnnotation(getGaugeSectionDescription_MaxValueExpression(), source, new String[] {});
diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/ToolPackageImpl.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/ToolPackageImpl.java
index 7ec8ac2f88..d54cbff49e 100644
--- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/ToolPackageImpl.java
+++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/ToolPackageImpl.java
@@ -4106,8 +4106,8 @@ public class ToolPackageImpl extends EPackageImpl implements ToolPackage {
addAnnotation(getNodeCreationDescription_Variable(), source, new String[] { "type", "ecore.EObject" });
addAnnotation(getNodeCreationDescription_ViewVariable(), source, new String[] { "type", "viewpoint.DDiagramElementContainer" });
addAnnotation(getEdgeCreationDescription_ConnectionStartPrecondition(), source, new String[] { "container", "ecore.EObject | the semantic element of diagram.", "preSourceView",
- "viewpoint.EdgeTarget | (edge only) the source view of the current potential edge.", "preSource", "viewpoint.EdgeTarget | (edge only) the semantic element of $preSourceView.",
- "diagram", "viewpoint.DDiagram | the diagram of the current potential edge" });
+ "viewpoint.EdgeTarget | (edge only) the source view of the current potential edge.", "preSource", "ecore.EObject | (edge only) the semantic element of $preSourceView.", "diagram",
+ "viewpoint.DDiagram | the diagram of the current potential edge" });
addAnnotation(getDeleteHookParameter_Value(), source, new String[] {});
addAnnotation(getPaneBasedSelectionWizardDescription_CandidatesExpression(), source, new String[] { "diagram", "viewpoint.DDiagram | the current DDiagram.", "containerView",
"viewpoint.DSemanticDecorator | the selected view.", "container", "ecore.EObject | the semantic element of containerView." });
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/experimental/sync/DDiagramElementSynchronizer.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/experimental/sync/DDiagramElementSynchronizer.java
index dfb193ab72..bdf8dd494b 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/experimental/sync/DDiagramElementSynchronizer.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/experimental/sync/DDiagramElementSynchronizer.java
@@ -397,7 +397,18 @@ public class DDiagramElementSynchronizer {
containerVariable = ((DSemanticDecorator) edge.eContainer()).getTarget();
}
// Recompute the conditional style
+ this.interpreter.setVariable(IInterpreterSiriusVariables.DIAGRAM, this.diagram);
+ this.interpreter.setVariable(IInterpreterSiriusVariables.VIEW, edge);
+ this.interpreter.setVariable(IInterpreterSiriusVariables.SOURCE_VIEW, edge.getSourceNode());
+ this.interpreter.setVariable(IInterpreterSiriusVariables.TARGET_VIEW, edge.getTargetNode());
+
this.mappingHelper.affectAndRefreshStyle(edge.getDiagramElementMapping(), edge, edge.getTarget(), containerVariable, (DDiagram) edge.eContainer());
+
+ this.interpreter.unSetVariable(IInterpreterSiriusVariables.DIAGRAM);
+ this.interpreter.unSetVariable(IInterpreterSiriusVariables.VIEW);
+ this.interpreter.unSetVariable(IInterpreterSiriusVariables.SOURCE_VIEW);
+ this.interpreter.unSetVariable(IInterpreterSiriusVariables.TARGET_VIEW);
+
final EdgeStyle edgeStyle = edge.getOwnedStyle();
if (edgeStyle != null) {
final EdgeStyleDescription edgeStyleDescription = (EdgeStyleDescription) edgeStyle.getDescription();
@@ -717,6 +728,11 @@ public class DDiagramElementSynchronizer {
* the parent diagram of the edge
*/
public void refreshStyle(final DEdge edge, final EdgeMapping mapping, final DDiagram parentDiagram) {
+ this.interpreter.setVariable(IInterpreterSiriusVariables.DIAGRAM, this.diagram);
+ this.interpreter.setVariable(IInterpreterSiriusVariables.VIEW, edge);
+ this.interpreter.setVariable(IInterpreterSiriusVariables.SOURCE_VIEW, edge.getSourceNode());
+ this.interpreter.setVariable(IInterpreterSiriusVariables.TARGET_VIEW, edge.getTargetNode());
+
EObject containerVariable = null;
if (edge.eContainer() instanceof DSemanticDecorator) {
containerVariable = ((DSemanticDecorator) edge.eContainer()).getTarget();
@@ -731,6 +747,11 @@ public class DDiagramElementSynchronizer {
} else if (edge.getStyle() != null) {
styleHelper.refreshStyle(edge.getStyle());
}
+
+ this.interpreter.unSetVariable(IInterpreterSiriusVariables.DIAGRAM);
+ this.interpreter.unSetVariable(IInterpreterSiriusVariables.VIEW);
+ this.interpreter.unSetVariable(IInterpreterSiriusVariables.SOURCE_VIEW);
+ this.interpreter.unSetVariable(IInterpreterSiriusVariables.TARGET_VIEW);
}
/**
@@ -753,6 +774,7 @@ public class DDiagramElementSynchronizer {
this.interpreter.setVariable(IInterpreterSiriusVariables.VIEWPOINT, this.diagram);
this.interpreter.setVariable(IInterpreterSiriusVariables.DIAGRAM, this.diagram);
this.interpreter.setVariable(IInterpreterSiriusVariables.VIEW, node);
+
this.mappingHelper.affectAndRefreshStyle(mapping, node, node.getTarget(), containerVariable, diagram);
if (node.eContainer() != null) {
@@ -778,6 +800,11 @@ public class DDiagramElementSynchronizer {
* the parent diagram of the edge
*/
public void createStyle(final DEdge edge, final EdgeMapping mapping, final DDiagram parentDiagram) {
+ this.interpreter.setVariable(IInterpreterSiriusVariables.DIAGRAM, this.diagram);
+ this.interpreter.setVariable(IInterpreterSiriusVariables.VIEW, edge);
+ this.interpreter.setVariable(IInterpreterSiriusVariables.SOURCE_VIEW, edge.getSourceNode());
+ this.interpreter.setVariable(IInterpreterSiriusVariables.TARGET_VIEW, edge.getTargetNode());
+
if (edge.getStyle() == null || edge.getStyle().getCustomFeatures().isEmpty()) {
EObject containerVariable = null;
if (edge.eContainer() instanceof DSemanticDecorator) {
@@ -792,6 +819,11 @@ public class DDiagramElementSynchronizer {
styleHelper.refreshStyle(edge.getOwnedStyle(), Options.newSome(edge.getOwnedStyle()));
}
}
+
+ this.interpreter.unSetVariable(IInterpreterSiriusVariables.DIAGRAM);
+ this.interpreter.unSetVariable(IInterpreterSiriusVariables.VIEW);
+ this.interpreter.unSetVariable(IInterpreterSiriusVariables.SOURCE_VIEW);
+ this.interpreter.unSetVariable(IInterpreterSiriusVariables.TARGET_VIEW);
}
private String computeLabel(final DDiagramElement view, final EObject descriptionObject) {

Back to the top