Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/BaseDiagramPositionProvider.xtend12
-rw-r--r--plugins/org.eclipse.etrice.ui.behavior.fsm/xtend-gen/org/eclipse/etrice/ui/behavior/fsm/support/BaseDiagramPositionProvider.java61
2 files changed, 39 insertions, 34 deletions
diff --git a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/BaseDiagramPositionProvider.xtend b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/BaseDiagramPositionProvider.xtend
index 33bbdf199..aca12cb84 100644
--- a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/BaseDiagramPositionProvider.xtend
+++ b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/BaseDiagramPositionProvider.xtend
@@ -102,10 +102,14 @@ class BaseDiagramPositionProvider implements IPositionProvider {
}
override getPosition(StateGraphNode node) {
- if(node instanceof RefinedState){
- baseDiagram.getPictograms(node.target).findFirst[parentBo instanceof StateGraph]?.toPosAndSize(node.margin)
- } else {
- baseDiagram.getPictograms(node).findFirst[parentBo instanceof StateGraph]?.toPosAndSize(node.margin)
+ val getBasePos = [baseDiagram.getPictograms(it).findFirst[parentBo instanceof StateGraph]?.toPosAndSize(node.margin)]
+
+ return if(node instanceof RefinedState){
+ // 1. RefinedState is base diagram
+ // 2. RefinedState target is in base diagram
+ getBasePos.apply(node)?:getBasePos.apply(node.target)
+ } else {
+ getBasePos.apply(node)
}
}
diff --git a/plugins/org.eclipse.etrice.ui.behavior.fsm/xtend-gen/org/eclipse/etrice/ui/behavior/fsm/support/BaseDiagramPositionProvider.java b/plugins/org.eclipse.etrice.ui.behavior.fsm/xtend-gen/org/eclipse/etrice/ui/behavior/fsm/support/BaseDiagramPositionProvider.java
index 0cde9a2f5..35a44cfc1 100644
--- a/plugins/org.eclipse.etrice.ui.behavior.fsm/xtend-gen/org/eclipse/etrice/ui/behavior/fsm/support/BaseDiagramPositionProvider.java
+++ b/plugins/org.eclipse.etrice.ui.behavior.fsm/xtend-gen/org/eclipse/etrice/ui/behavior/fsm/support/BaseDiagramPositionProvider.java
@@ -228,40 +228,41 @@ public class BaseDiagramPositionProvider implements IPositionProvider {
@Override
public IPositionProvider.PosAndSize getPosition(final StateGraphNode node) {
+ final Function1<EObject, IPositionProvider.PosAndSize> _function = new Function1<EObject, IPositionProvider.PosAndSize>() {
+ @Override
+ public IPositionProvider.PosAndSize apply(final EObject it) {
+ Collection<PictogramElement> _pictograms = BaseDiagramPositionProvider.this.baseDiagram.getPictograms(it);
+ final Function1<PictogramElement, Boolean> _function = new Function1<PictogramElement, Boolean>() {
+ @Override
+ public Boolean apply(final PictogramElement it) {
+ EObject _parentBo = BaseDiagramPositionProvider.this.getParentBo(it);
+ return Boolean.valueOf((_parentBo instanceof StateGraph));
+ }
+ };
+ PictogramElement _findFirst = IterableExtensions.<PictogramElement>findFirst(_pictograms, _function);
+ IPositionProvider.PosAndSize _posAndSize = null;
+ if (_findFirst!=null) {
+ int _margin = BaseDiagramPositionProvider.this.getMargin(node);
+ _posAndSize=BaseDiagramPositionProvider.this.toPosAndSize(_findFirst, _margin);
+ }
+ return _posAndSize;
+ }
+ };
+ final Function1<EObject, IPositionProvider.PosAndSize> getBasePos = _function;
IPositionProvider.PosAndSize _xifexpression = null;
if ((node instanceof RefinedState)) {
- State _target = ((RefinedState)node).getTarget();
- Collection<PictogramElement> _pictograms = this.baseDiagram.getPictograms(_target);
- final Function1<PictogramElement, Boolean> _function = new Function1<PictogramElement, Boolean>() {
- @Override
- public Boolean apply(final PictogramElement it) {
- EObject _parentBo = BaseDiagramPositionProvider.this.getParentBo(it);
- return Boolean.valueOf((_parentBo instanceof StateGraph));
- }
- };
- PictogramElement _findFirst = IterableExtensions.<PictogramElement>findFirst(_pictograms, _function);
- IPositionProvider.PosAndSize _posAndSize = null;
- if (_findFirst!=null) {
- int _margin = this.getMargin(node);
- _posAndSize=this.toPosAndSize(_findFirst, _margin);
+ IPositionProvider.PosAndSize _elvis = null;
+ IPositionProvider.PosAndSize _apply = getBasePos.apply(node);
+ if (_apply != null) {
+ _elvis = _apply;
+ } else {
+ State _target = ((RefinedState)node).getTarget();
+ IPositionProvider.PosAndSize _apply_1 = getBasePos.apply(_target);
+ _elvis = _apply_1;
}
- _xifexpression = _posAndSize;
+ _xifexpression = _elvis;
} else {
- Collection<PictogramElement> _pictograms_1 = this.baseDiagram.getPictograms(node);
- final Function1<PictogramElement, Boolean> _function_1 = new Function1<PictogramElement, Boolean>() {
- @Override
- public Boolean apply(final PictogramElement it) {
- EObject _parentBo = BaseDiagramPositionProvider.this.getParentBo(it);
- return Boolean.valueOf((_parentBo instanceof StateGraph));
- }
- };
- PictogramElement _findFirst_1 = IterableExtensions.<PictogramElement>findFirst(_pictograms_1, _function_1);
- IPositionProvider.PosAndSize _posAndSize_1 = null;
- if (_findFirst_1!=null) {
- int _margin_1 = this.getMargin(node);
- _posAndSize_1=this.toPosAndSize(_findFirst_1, _margin_1);
- }
- _xifexpression = _posAndSize_1;
+ _xifexpression = getBasePos.apply(node);
}
return _xifexpression;
}

Back to the top