Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2007-05-28 09:33:47 -0400
committeratikhomirov2007-05-28 09:33:47 -0400
commitb9c2e8ba0dcf0fec890f43da131fe59ff8d0bdd9 (patch)
treedfc1fe9aaa3654eb23b6975d1bcaeffa37bad9ad /plugins/org.eclipse.gmf.graphdef.codegen/templates/attr
parentd82588c35a079238625cef04c59ad3cfeaa1b304 (diff)
downloadorg.eclipse.gmf-tooling-b9c2e8ba0dcf0fec890f43da131fe59ff8d0bdd9.tar.gz
org.eclipse.gmf-tooling-b9c2e8ba0dcf0fec890f43da131fe59ff8d0bdd9.tar.xz
org.eclipse.gmf-tooling-b9c2e8ba0dcf0fec890f43da131fe59ff8d0bdd9.zip
FigureDescriptor with explicit means to access children introduced into gmfgraph
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/attr')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/CustomClass.xpt2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Decoration.xpt2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.xpt19
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.xpt19
4 files changed, 25 insertions, 17 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/CustomClass.xpt b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/CustomClass.xpt
index 26b38b281..974fb3977 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/CustomClass.xpt
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/CustomClass.xpt
@@ -9,7 +9,7 @@
* Contributors:
* Artem Tikhomirov (Borland) - initial API and implementation
*/
-«IMPORT "http://www.eclipse.org/gmf/2005/GraphicalDefinition"»
+«IMPORT "http://www.eclipse.org/gmf/2006/GraphicalDefinition"»
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
«EXTENSION Util»
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Decoration.xpt b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Decoration.xpt
index 1ad81d328..98a90f00e 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Decoration.xpt
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Decoration.xpt
@@ -9,7 +9,7 @@
* Contributors:
* Artem Tikhomirov (Borland) - initial API and implementation
*/
-«IMPORT "http://www.eclipse.org/gmf/2005/GraphicalDefinition"»
+«IMPORT "http://www.eclipse.org/gmf/2006/GraphicalDefinition"»
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
«IMPORT "templates"»
«EXTENSION Util»
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.xpt b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.xpt
index 8a08202c6..0b42ecbf6 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.xpt
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Figure.xpt
@@ -9,7 +9,7 @@
* Contributors:
* Artem Tikhomirov (Borland) - initial API and implementation
*/
-«IMPORT "http://www.eclipse.org/gmf/2005/GraphicalDefinition"»
+«IMPORT "http://www.eclipse.org/gmf/2006/GraphicalDefinition"»
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
«IMPORT "templates"»
«EXTENSION Util»
@@ -17,20 +17,21 @@
«DEFINE figureAttrs(EString figureVarName) FOR gmfgraph::Figure-»
«EXPAND foregroundColor(this, figureVarName) FOR foregroundColor-»
«EXPAND backgroundColor(this, figureVarName) FOR backgroundColor-»
-«EXPAND font(this, figureVarName) FOR font-»
+«EXPAND font(figureVarName) FOR font-»
«EXPAND preferredSize(figureVarName) FOR preferredSize-»
«EXPAND maximumSize(figureVarName) FOR maximumSize-»
«EXPAND minimumSize(figureVarName) FOR minimumSize-»
+«EXPAND position(figureVarName) FOR location-»
«EXPAND size(figureVarName) FOR size-»
«EXPAND insets(figureVarName) FOR insets-»
«EXPAND Border::Init(figureVarName) FOR border-»
«ENDDEFINE»
«DEFINE foregroundColor(gmfgraph::Figure figure, String figureVarName) FOR gmfgraph::Color-»
- «figureVarName».setForegroundColor(«EXPAND color(figure.name.toUpperCase() + "_FORE")»);
+ «figureVarName».setForegroundColor(«EXPAND color(figureVarName.toUpperCase() + "_FORE")»);
«ENDDEFINE»
«DEFINE backgroundColor(gmfgraph::Figure figure, String figureVarName) FOR gmfgraph::Color-»
- «figureVarName».setBackgroundColor(«EXPAND color(figure.name.toUpperCase() + "_BACK")»);
+ «figureVarName».setBackgroundColor(«EXPAND color(figureVarName.toUpperCase() + "_BACK")»);
«ENDDEFINE»
«DEFINE preferredSize(EString figureVarName) FOR gmfgraph::Dimension-»
@@ -45,6 +46,10 @@
«figureVarName».setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(«EXPAND MapMode::map»));
«ENDDEFINE»
+«DEFINE position(String figureVarName) FOR gmfgraph::Point-»
+«figureVarName».setLocation(new org.eclipse.draw2d.geometry.Point(«EXPAND MapMode::map»));
+«ENDDEFINE»
+
«DEFINE size(EString figureVarName) FOR gmfgraph::Point-»
«figureVarName».setSize(«EXPAND MapMode::map»);
«ENDDEFINE»
@@ -54,7 +59,7 @@
«figureVarName».setBorder(new org.eclipse.draw2d.MarginBorder(«EXPAND MapMode::map»));
«ENDDEFINE»
-«DEFINE font(Figure figure, EString figureVarName) FOR gmfgraph::Font»
+«DEFINE font(String figureVarName) FOR gmfgraph::Font»
«ERROR "This is abstact definition, just to overcome some xpand polymorphism limitations"»
«ENDDEFINE»
@@ -76,8 +81,8 @@ static final org.eclipse.swt.graphics.Color «variableName» = new org.eclipse.swt
org.eclipse.draw2d.ColorConstants.«value.literal-»
«ENDDEFINE»
-«DEFINE font(Figure figure, EString figureVarName) FOR gmfgraph::BasicFont-»
-«LET figure.name + "_FONT" AS variableName»
+«DEFINE font(String figureVarName) FOR gmfgraph::BasicFont-»
+«LET figureVarName.toUpperCase() + "_FONT" AS variableName»
«figureVarName».setFont(«variableName»);
«FILE "" staticFields»
/**
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.xpt b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.xpt
index 0cc32c81f..5f8f472c6 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.xpt
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/Shape.xpt
@@ -9,17 +9,20 @@
* Contributors:
* Artem Tikhomirov (Borland) - initial API and implementation
*/
-«IMPORT "http://www.eclipse.org/gmf/2005/GraphicalDefinition"»
+«IMPORT "http://www.eclipse.org/gmf/2006/GraphicalDefinition"»
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
-// XXX call figureAttrs from this?
+«REM»
+org.eclipse.draw2d.Shape
+ private boolean fill = true, outline = true, xorFill, xorOutline;
+«ENDREM»
«DEFINE shapeAttrs(EString figureVarName) FOR Shape-»
-«EXPAND fill(figureVarName)-»
-«EXPAND xorFill(figureVarName)-»
-«EXPAND outline(figureVarName)-»
-«EXPAND xorOutline(figureVarName)-»
-«EXPAND lineWidth(figureVarName)-»
-«EXPAND lineKind(figureVarName)-»
+«IF !fill»«EXPAND fill(figureVarName)»«ENDIF-»
+«IF xorFill»«EXPAND xorFill(figureVarName)»«ENDIF-»
+«IF !outline»«EXPAND outline(figureVarName)»«ENDIF-»
+«IF xorOutline»«EXPAND xorOutline(figureVarName)»«ENDIF-»
+«IF lineWidth != 1»«EXPAND lineWidth(figureVarName)»«ENDIF-»
+«IF lineKind.value != LineKind::LINE_SOLID.value»«EXPAND lineKind(figureVarName)»«ENDIF-»
«ENDDEFINE»
«DEFINE fill(EString figureVarName) FOR Shape-»

Back to the top