Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen.xtend/xtend/gmfgraph/top/Figure.xtend')
-rw-r--r--plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen.xtend/xtend/gmfgraph/top/Figure.xtend139
1 files changed, 0 insertions, 139 deletions
diff --git a/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen.xtend/xtend/gmfgraph/top/Figure.xtend b/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen.xtend/xtend/gmfgraph/top/Figure.xtend
deleted file mode 100644
index 908435a14e7..00000000000
--- a/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen.xtend/xtend/gmfgraph/top/Figure.xtend
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2020 Borland Software Corporation, CEA LIST, Artal and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Artem Tikhomirov (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- * Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174
- *****************************************************************************/
-package gmfgraph.top
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import gmfgraph.Attrs
-import gmfgraph.Border
-import gmfgraph.Children
-import gmfgraph.Decoration
-import gmfgraph.Extras
-import gmfgraph.Layout
-import gmfgraph.Utils_Statefull_qvto
-import java.util.ArrayList
-import java.util.List
-import org.eclipse.papyrus.gmf.gmfgraph.DecorationFigure
-import org.eclipse.papyrus.gmf.gmfgraph.FigureRef
-import org.eclipse.papyrus.gmf.gmfgraph.PolylineConnection
-import org.eclipse.papyrus.gmf.gmfgraph.RealFigure
-import xpt.Common
-import xpt.Common_qvto import java.lang.reflect.Array
-import java.util.Arrays
-
-@Singleton class Figure {
- @Inject extension Common_qvto;
- @Inject extension Common;
- @Inject extension Utils_Statefull_qvto;
-
- @Inject Layout xptLayout;
- @Inject Attrs xptAttrs;
- @Inject Children xptChildren;
- @Inject Border xptBorder;
- @Inject Extras xptExtras;
- @Inject Decoration xptDecoration;
-
- def dispatch ClassBody(org.eclipse.papyrus.gmf.gmfgraph.Figure it, String cuName) '''«ERROR('abstract ClassBody(Figure)')»'''
-
- def dispatch ClassBody(FigureRef it, String cuName) '''«ClassBody(figure, cuName, it)»'''
-
- def dispatch ClassBody(RealFigure it, String cuName) '''«ClassBody(it, cuName, null)»'''
-
- def dispatch ClassBody(RealFigure it, String cuName, FigureRef figureRef) '''
- «generatedMemberComment»
- public «cuName»() {
- «clearState()»
- «xptLayout.Init(it.layout, 'this')»
- «xptAttrs.Init(it, 'this')»
- «IF figureRef != null»
- // «figureRef.figure.name»
- // Process FigureRef details
- «xptLayout.Init(figureRef.layout, 'this')»
- «xptAttrs.Init(figureRef, 'this')»
- «ENDIF»
- «IF !it.children.filter(typeof(org.eclipse.papyrus.gmf.gmfgraph.Figure)).empty»
- createContents();
- }
- «xptChildren.CreateChildren(it)»
- «ELSE»
- }
- «ENDIF»
- «xptBorder.InitMethods(it)»
- «extraLineBreak»
- «xptExtras.extraMethods(it)»
- «additions(it)»
- '''
-
- def Iterable<org.eclipse.papyrus.gmf.gmfgraph.Figure> safeExcluding(List<org.eclipse.papyrus.gmf.gmfgraph.Figure> children, DecorationFigure... d) {
- return safeExcluding(children, Arrays.asList(d));
- }
-
- def Iterable<org.eclipse.papyrus.gmf.gmfgraph.Figure> safeExcluding(List<org.eclipse.papyrus.gmf.gmfgraph.Figure> children, List<DecorationFigure> d) {
- children.filter[f| !d.contains(f)];
- }
-
- def dispatch ClassBody(PolylineConnection it, String cuName, FigureRef figureRef) '''
- «val childrenWithoutDecorators = safeExcluding(it.children, sourceDecoration, targetDecoration)»
- «generatedMemberComment»
- public «cuName»() {
- «clearState()»
- «xptAttrs.Init(it, 'this')»
- «extraLineBreak»
- «IF !childrenWithoutDecorators.isEmpty()»
- createContents();
- «ENDIF»
- «IF it.sourceDecoration != null»
- setSourceDecoration(createSourceDecoration());
- «ENDIF»
- «IF it.targetDecoration != null»
- setTargetDecoration(createTargetDecoration());
- «ENDIF»
- }
-
- «/*
- * Copy of Children::CreateChildren with temp workaround to generate child figures for labels only.
- * Though this is workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=193180, I'm not sure
- * what's the right approach with e.g. decoration as child of a link.
- */
- IF !childrenWithoutDecorators.isEmpty()»
- «generatedMemberComment»
- private void createContents(){
- «FOR l : childrenWithoutDecorators»
- «xptChildren.instantiate(l, 0, it, 'this')»
- «ENDFOR»
- «extraLineBreak»
- }
- «ENDIF»
- «IF it.sourceDecoration != null»
- «generatedMemberComment»
- private org.eclipse.draw2d.RotatableDecoration createSourceDecoration() {
- «xptDecoration.Instantiate(it.sourceDecoration, 'df')»
- return df;
- }
- «ENDIF»
- «IF it.targetDecoration != null»
- «generatedMemberComment»
- private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
- «xptDecoration.Instantiate(it.targetDecoration, 'df')»
- return df;
- }
- «ENDIF»
- «additions(it)»
- '''
-
- def additions(org.eclipse.papyrus.gmf.gmfgraph.Figure it) ''''''
-
-} \ No newline at end of file

Back to the top