carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/graphdef.codegen.templates/LayoutData.xpt
author cawthron
Fri, 04 Dec 2009 11:06:59 -0600
changeset 422 033392511bf7
permissions -rw-r--r--
add files for RCL_2_2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
422
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     1
/*
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     2
 * Copyright (c) 2006, 2007 Borland Software Corporation
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     3
 * 
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     4
 * All rights reserved. This program and the accompanying materials
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     5
 * are made available under the terms of the Eclipse Public License v1.0
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     6
 * which accompanies this distribution, and is available at
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     7
 * http://www.eclipse.org/legal/epl-v10.html
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     8
 *
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     9
 * Contributors:
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    10
 *    Artem Tikhomirov (Borland) - initial API and implementation
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    11
 */
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    12
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    13
«IMPORT "http://www.eclipse.org/gmf/2006/GraphicalDefinition"»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    14
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    15
«EXTENSION Util»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    16
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    17
«DEFINE Init(EString parentFigureVariable, EString owningFigureVariable) FOR gmfgraph::LayoutData»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    18
«ERROR "Abstract definition, there should be specific template for " + this»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    19
«ENDDEFINE»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    20
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    21
«DEFINE Init(EString parentFigureVariable, EString owningFigureVariable) FOR gmfgraph::BorderLayoutData»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    22
«parentFigureVariable».add(«owningFigureVariable», org.eclipse.draw2d.BorderLayout.«borderLayoutConstant(this)»);
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    23
«ENDDEFINE»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    24
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    25
«DEFINE Init(EString parentFigureVariable, EString owningFigureVariable) FOR gmfgraph::XYLayoutData»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    26
«parentFigureVariable».add(«owningFigureVariable», «EXPAND newRectangle»);
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    27
«ENDDEFINE»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    28
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    29
«DEFINE Init(EString parentFigureVariable, EString owningFigureVariable) FOR gmfgraph::CustomLayoutData»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    30
«LET "constraint" + owningFigureVariable.toFirstUpper() AS constraintVarName-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    31
«qualifiedClassName» «constraintVarName» = new «qualifiedClassName»();
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    32
«EXPAND attr::CustomClass::Init(constraintVarName)»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    33
«parentFigureVariable».add(«owningFigureVariable», «constraintVarName»);
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    34
«ENDLET-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    35
«ENDDEFINE»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    36
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    37
«DEFINE Init(EString parentFigureVariable, EString owningFigureVariable) FOR gmfgraph::GridLayoutData»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    38
«LET "constraint" + owningFigureVariable.toFirstUpper() AS constraintVarName»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    39
«EXPAND Runtime::newInstance(constraintVarName)»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    40
«constraintVarName».verticalAlignment = «EXPAND Runtime::fqn».«verticalAlignment.name»;«REM».literal, not .name!«ENDREM»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    41
«constraintVarName».horizontalAlignment = «EXPAND Runtime::fqn».«horizontalAlignment.name»;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    42
«constraintVarName».horizontalIndent = «horizontalIndent»;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    43
«constraintVarName».horizontalSpan = «horizontalSpan»;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    44
«constraintVarName».verticalSpan = «verticalSpan»;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    45
«constraintVarName».grabExcessHorizontalSpace = «grabExcessHorizontalSpace»;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    46
«constraintVarName».grabExcessVerticalSpace = «grabExcessVerticalSpace»;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    47
«IF null != sizeHint-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    48
«constraintVarName».widthHint = «sizeHint.dx»;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    49
«constraintVarName».heightHint = «sizeHint.dy»;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    50
«ENDIF-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    51
«parentFigureVariable».add(«owningFigureVariable», «constraintVarName»);
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    52
«ENDLET»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    53
«ENDDEFINE»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    54
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    55
«DEFINE newRectangle FOR gmfgraph::XYLayoutData»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    56
new org.eclipse.draw2d.geometry.Rectangle(«IF null != topLeft-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    57
«EXPAND MapMode::map FOR topLeft», «ELSE»0, 0, «ENDIF-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    58
«IF null != size-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    59
«EXPAND MapMode::map FOR size»«ELSE»0, 0«ENDIF»)
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    60
«ENDDEFINE»