diff options
author | ashatalin | 2008-12-29 12:41:42 +0000 |
---|---|---|
committer | ashatalin | 2008-12-29 12:41:42 +0000 |
commit | b8fcf6e045ecf9959e33600f92d012670d74ac14 (patch) | |
tree | 6a48254797286a49db56271de00a62e35b829e32 /plugins/org.eclipse.gmf.graphdef.codegen/templates.migrated/attr/Figure.xpt | |
parent | fc1dfb3b462e159eec1b6031bb41ab79c762474b (diff) | |
download | org.eclipse.gmf-tooling-b8fcf6e045ecf9959e33600f92d012670d74ac14.tar.gz org.eclipse.gmf-tooling-b8fcf6e045ecf9959e33600f92d012670d74ac14.tar.xz org.eclipse.gmf-tooling-b8fcf6e045ecf9959e33600f92d012670d74ac14.zip |
QVTO-based xpand implementation was merged to HEAD
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates.migrated/attr/Figure.xpt')
-rw-r--r-- | plugins/org.eclipse.gmf.graphdef.codegen/templates.migrated/attr/Figure.xpt | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates.migrated/attr/Figure.xpt b/plugins/org.eclipse.gmf.graphdef.codegen/templates.migrated/attr/Figure.xpt new file mode 100644 index 000000000..1e0984f6d --- /dev/null +++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates.migrated/attr/Figure.xpt @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2006 Borland Software Corporation + * + * 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: + * Artem Tikhomirov (Borland) - initial API and implementation + */ +«IMPORT 'http://www.eclipse.org/gmf/2006/GraphicalDefinition'» +«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'» +«IMPORT 'templates'» +«EXTENSION Util» +«EXTENSION xpt::StringOperations» + +«DEFINE figureAttrs(figureVarName : String) FOR gmfgraph::Figure-» +«EXPAND foregroundColor(self, figureVarName) FOR foregroundColor-» +«EXPAND backgroundColor(self, figureVarName) FOR backgroundColor-» +«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(figure : gmfgraph::Figure, figureVarName : String) FOR gmfgraph::Color-» + «figureVarName».setForegroundColor(«EXPAND color(figureVarName.toUpper() + '_FORE')»); +«ENDDEFINE» +«DEFINE backgroundColor(figure : gmfgraph::Figure, figureVarName : String) FOR gmfgraph::Color-» + «figureVarName».setBackgroundColor(«EXPAND color(figureVarName.toUpper() + '_BACK')»); +«ENDDEFINE» + +«DEFINE preferredSize(figureVarName : String) FOR gmfgraph::Dimension-» +«figureVarName».setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(«EXPAND MapMode::_map»)); +«ENDDEFINE» + +«DEFINE maximumSize(figureVarName : String) FOR gmfgraph::Dimension-» +«figureVarName».setMaximumSize(new org.eclipse.draw2d.geometry.Dimension(«EXPAND MapMode::_map»)); +«ENDDEFINE» + +«DEFINE minimumSize(figureVarName : String) FOR gmfgraph::Dimension-» +«figureVarName».setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(«EXPAND MapMode::_map»)); +«ENDDEFINE» + +«DEFINE position(figureVarName : String) FOR gmfgraph::Point-» +«figureVarName».setLocation(new org.eclipse.draw2d.geometry.Point(«EXPAND MapMode::_map»)); +«ENDDEFINE» + +«DEFINE size(figureVarName : String) FOR gmfgraph::Point-» +«figureVarName».setSize(«EXPAND MapMode::_map»); +«ENDDEFINE» + +«DEFINE insets(figureVarName : String) FOR gmfgraph::Insets-» +«REM»using MarginBorder for insets is not good idea«ENDREM» +«figureVarName».setBorder(new org.eclipse.draw2d.MarginBorder(«EXPAND MapMode::_map»)); +«ENDDEFINE» + +«DEFINE font(figureVarName : String) FOR gmfgraph::Font» +«ERROR 'This is abstact definition, just to overcome some xpand polymorphism limitations'» +«ENDDEFINE» + +«DEFINE color(variableName : String) FOR gmfgraph::Color» +«ERROR 'This is abstact definition, just to overcome some xpand polymorphism limitations'» +«ENDDEFINE» + +«DEFINE color(variableName : String) FOR gmfgraph::RGBColor-» +«variableName-» +«FILE '' staticFields» +/** + * @generated + */ +static final org.eclipse.swt.graphics.Color «variableName» = new org.eclipse.swt.graphics.Color(null, «red», «green», «blue»); +«ENDFILE» +«ENDDEFINE» + +«DEFINE color(variableName : String) FOR gmfgraph::ConstantColor-» +org.eclipse.draw2d.ColorConstants.«value-» +«ENDDEFINE» + +«DEFINE font(figureVarName : String) FOR gmfgraph::BasicFont-» +«LET figureVarName.toUpper() + '_FONT' AS variableName» +«figureVarName».setFont(«variableName»); +«FILE '' staticFields» +/** + * @generated + */ +static final org.eclipse.swt.graphics.Font «variableName» = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), «IF null = faceName or faceName.trim().xpandLength() = 0»org.eclipse.swt.widgets.Display.getDefault().getSystemFont().getFontData()[0].getName()«ELSE»"«faceName»"«ENDIF», «height», org.eclipse.swt.SWT.«style»); +«ENDFILE» +«ENDLET» +«ENDDEFINE» + |