View | Details | Raw Unified | Return to bug 173499 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/gmf/internal/xpand/BuiltinMetaModel.java (-2 / +6 lines)
Lines 735-741 Link Here
735
			@Override
735
			@Override
736
			public Object evaluate(List target, Object[] params) {
736
			public Object evaluate(List target, Object[] params) {
737
				if (!target.isEmpty()) {
737
				if (!target.isEmpty()) {
738
					target.remove(0);
738
                    LinkedList rv = new LinkedList(target);
739
					rv.removeFirst();
740
                    return rv;
739
				}
741
				}
740
				return target;
742
				return target;
741
			}
743
			}
Lines 744-750 Link Here
744
			@Override
746
			@Override
745
			public Object evaluate(List target, Object[] params) {
747
			public Object evaluate(List target, Object[] params) {
746
				if (!target.isEmpty()) {
748
				if (!target.isEmpty()) {
747
					target.remove(target.size() - 1);
749
                    LinkedList rv = new LinkedList(target);
750
					rv.removeLast();
751
                    return rv;
748
				}
752
				}
749
				return target;
753
				return target;
750
			}
754
			}
(-)templates/aspects/xpt/propsheet/Utils.ext (+225 lines)
Lines 10-20 Link Here
10
 *    Anna Karjakina (Borland) - initial API and implementation
10
 *    Anna Karjakina (Borland) - initial API and implementation
11
 */
11
 */
12
 
12
 
13
import "http://www.eclipse.org/gmf/2007/GmfGraph/PropSheet";
13
import "http://www.eclipse.org/gmf/2005/GraphicalDefinition";
14
import "http://www.eclipse.org/gmf/2005/GraphicalDefinition";
14
import "http://www.eclipse.org/gmf/2005/GenModel/2.0";
15
import "http://www.eclipse.org/gmf/2005/GenModel/2.0";
15
import "http://www.eclipse.org/emf/2002/GenModel";
16
import "http://www.eclipse.org/emf/2002/GenModel";
16
import "http://www.eclipse.org/emf/2002/Ecore";
17
import "http://www.eclipse.org/emf/2002/Ecore";
17
18
19
extension xpt::GenModelUtils;
20
18
boolean isLayoutTab(gmfgen::GenCustomPropertyTab tab) :
21
boolean isLayoutTab(gmfgen::GenCustomPropertyTab tab) :
19
"layout" == tab.iD
22
"layout" == tab.iD
20
;
23
;
Lines 30-32 Link Here
30
boolean isCustomTab(gmfgen::GenCustomPropertyTab tab) :
33
boolean isCustomTab(gmfgen::GenCustomPropertyTab tab) :
31
"custom" == tab.iD
34
"custom" == tab.iD
32
;
35
;
36
37
boolean isExampleTab(gmfgen::GenCustomPropertyTab tab) :
38
"genLayout" == tab.iD || "genStyles" == tab.iD
39
;
40
41
cached List[propsheet::Sectionable] collectAllParents(propsheet::Sectionable sectionable) :
42
sectionable.parent == null ? {sectionable} : collectAllParents(sectionable.parent, {sectionable})
43
;
44
45
private List[propsheet::Sectionable] collectAllParents(propsheet::Group target, List[propsheet::Sectionable] parents) :
46
parents.add(target) -> (target.parent == null ? parents : collectAllParents(target.parent, parents))
47
;
48
49
cached String composeModelCall(propsheet::Sectionable sectionable, String targetVar) :
50
collectAllParents(sectionable).collect(group | group.composeCast()).concatReverse() + targetVar + collectAllParents(sectionable).collect(group | group.composeAccessor()).concatReverse()
51
;
52
53
private String concatReverse(Collection[Object] coll) :
54
let list = coll.toList() :
55
	list.isEmpty() ? "" : (((String) list.last()) + concatReverse(list.withoutLast()))
56
;
57
58
private cached String composeAccessor(propsheet::Sectionable modelElementOwner) :
59
composeAccessor(modelElementOwner, getModelElement(modelElementOwner))
60
;
61
62
private cached String composeCast(propsheet::Sectionable modelElementOwner) :
63
composeCast(modelElementOwner, getModelElement(modelElementOwner))
64
;
65
66
private cached String composeAccessor(propsheet::Sectionable modelElementOwner, propsheet::FeatureReference modelElement) :
67
modelElement != null 
68
? 
69
( ((modelElementOwner.target != null && modelElementOwner.parent != null) ? ")" : "") +  "."+modelElement.feature.getGetAccessor()+"()") 
70
: 
71
((modelElementOwner.target != null && modelElementOwner.parent != null) ? ")" : "")
72
;
73
74
private cached String composeCast(propsheet::Sectionable modelElementOwner, propsheet::FeatureReference modelElement) :
75
((modelElementOwner.target != null && modelElementOwner.parent != null) 
76
? 
77
("("+ 
78
(modelElementOwner.parent.getModelElement() != null && modelElement == null 
79
? 
80
"" 
81
: 
82
"("+modelElementOwner.target.getQualifiedInterfaceName()+")" 
83
)) 
84
: 
85
"")
86
;
87
88
cached propsheet::FeatureReference getModelElement(propsheet::Group modelElementOwner) :
89
modelElementOwner.modelElement
90
;
91
92
cached propsheet::FeatureReference getModelElement(propsheet::Radio modelElementOwner) :
93
modelElementOwner.modelElement
94
;
95
96
cached propsheet::FeatureReference getModelElement(propsheet::Checkbox modelElementOwner) :
97
modelElementOwner.modelElement
98
;
99
100
cached propsheet::FeatureReference getModelElement(propsheet::Spin modelElementOwner) :
101
modelElementOwner.modelElement
102
;
103
104
cached propsheet::FeatureReference getModelElement(propsheet::TextField modelElementOwner) :
105
modelElementOwner.modelElement
106
;
107
108
cached propsheet::FeatureReference getModelElement(propsheet::Sectionable modelElementOwner) :
109
null
110
;
111
112
cached String getQualifiedInterfaceName(genmodel::GenClassifier classifier) :
113
classifier.genPackage.basePackage+"."+classifier.genPackage.ecorePackage.name+(classifier.genPackage.interfacePackageSuffix != "" ? "."+classifier.genPackage.interfacePackageSuffix : "")+"."+getName(classifier)
114
;
115
116
cached String getQualifiedClassifierCreaterName(genmodel::GenClassifier classifier) :
117
classifier == null ? "null" : getQualifiedFactoryInterfaceName(classifier.genPackage) + ".eINSTANCE.create" + getName(classifier) + "()"
118
;
119
120
cached String getName(genmodel::GenClass genClass) :
121
getEClassifierName(genClass.ecoreClass)
122
;
123
124
cached String getName(genmodel::GenEnum enum) :
125
getEClassifierName(enum.ecoreEnum)
126
;
127
128
cached String getName(genmodel::GenDataType dataType) :
129
getEClassifierName(dataType.ecoreDataType)
130
;
131
132
cached String getName(genmodel::GenClassifier abstract) :
133
""
134
;
135
136
private cached String getEClassifierName(ecore::EClassifier classifier) :
137
	switch (classifier.name) {
138
		case "Class" : "Class_"
139
		case "Name" : "Name_"
140
		default : classifier.name
141
	}
142
;
143
144
private cached String getName(genmodel::GenFeature genFeature) :
145
genFeature.ecoreFeature.name
146
;
147
148
// TODO: completely rewrite this very bad-styled function!!!
149
cached String getSetterAccessor(genmodel::GenFeature feature) :
150
let getAccessor = feature.getGetAccessor() :
151
getAccessor.startsWith("get|is") ? getAccessor.replaceFirst("get|is", "set") : "set" + feature.ecoreFeature.name.toFirstUpper()
152
;
153
154
// TODO: completely rewrite this very bad-styled function!!!
155
cached String getSetterAccessor(String getAccessor, String accessorName) :
156
getAccessor.replaceFirst("[.](get|is)" + accessorName + "[(][)]", ".set" + accessorName)
157
;
158
159
// TODO: add Java5 check: @see GenEnumLiteralImpl.getEnumLiteralInstanceConstantName()
160
cached String getEnumLiteralInstanceConstantName(genmodel::GenEnumLiteral genLiteral) :
161
genLiteral.ecoreEnumLiteral.literal.replaceAll(" ", "_").toUpperCase() + "_LITERAL"
162
;
163
164
cached propsheet::CustomPropertySection getCustomPropertySection(propsheet::Sectionable sectionable) :
165
sectionable.parent == null ? ((propsheet::CustomPropertySection) sectionable) : getCustomPropertySection(sectionable.parent)
166
;
167
168
boolean createLabel(propsheet::Text text) :
169
text != null ? text.createLabel : false
170
;
171
172
boolean isVisibleOnlyForTargets(propsheet::Sectionable sectionable) :
173
sectionable.target != null ? sectionable.visibleOnlyForTargets : false  
174
;
175
176
String name(propsheet::Sectionable sectionable) :
177
sectionable != null ? (sectionable.name == null ? generateVarName(sectionable) : sectionable.name) : ""  
178
;
179
180
// TODO: implement generation of variable names
181
private cached String generateVarName(propsheet::Sectionable sectionable) :
182
let modelElement = getModelElement(sectionable) :
183
modelElement == null ? (getText(sectionable) == null ? "Undefined" : composeVarName(getTextValueForVar(getText(sectionable)), sectionable)) : composeVarName(getModelElementNameForVar(modelElement), sectionable)
184
;
185
186
private cached propsheet::Text getText(propsheet::Sectionable sectionable) :
187
null
188
;
189
190
private cached propsheet::Text getText(propsheet::Labeled sectionable) :
191
sectionable.text
192
;
193
194
private getTextValueForVar(propsheet::Text text) :
195
((String)text.overridedItemProviderText).replaceAll(" ", "")
196
;
197
198
private cached String composeVarName(String middlePart, propsheet::Sectionable sectionable) :
199
getVarPrefix()+middlePart+getSectionableKindSuffix(sectionable)
200
;
201
202
private cached String getVarPrefix() :
203
"my"
204
;
205
206
private cached String getSectionableKindSuffix(propsheet::Sectionable sectionable) :
207
""
208
;
209
210
private cached String getSectionableKindSuffix(propsheet::Group sectionable) :
211
createLabel(sectionable.text) ? "Group" : "Composite"
212
;
213
214
private cached String getSectionableKindSuffix(propsheet::Radio sectionable) :
215
"Radio"
216
;
217
218
private cached String getSectionableKindSuffix(propsheet::Checkbox sectionable) :
219
"Checkbox"
220
;
221
222
private cached String getSectionableKindSuffix(propsheet::Spin sectionable) :
223
"Spin"
224
;
225
226
private cached String getSectionableKindSuffix(propsheet::TextField sectionable) :
227
"Text"
228
;
229
230
private cached String getSectionableKindSuffix(propsheet::Label sectionable) :
231
"Label"
232
;
233
234
private cached String getModelElementNameForVar(propsheet::IsFeatureOfTypeReference featureRef) :
235
getName(featureRef.isOfType)
236
;
237
238
private cached String getModelElementNameForVar(propsheet::IsFeatureIsOfKindReference featureRef) :
239
getEnumLiteral(featureRef.isOfValue).toFirstUpper()
240
;
241
242
private cached String getModelElementNameForVar(propsheet::FeatureReference featureRef) :
243
getName(featureRef.feature).toFirstUpper()
244
;
245
246
cached String getFormattedName(genmodel::GenFeature genFeature) :
247
getName(genFeature) == null ? "" : format(getName(genFeature).toFirstUpper())
248
;
249
250
//TODO: invoke CodeGenUtil.format(mixedCaseName, ' ', null, false, false), like GenFeatureImpl does 
251
private String format(String mixedCaseString) :
252
mixedCaseString
253
;
254
255
cached String getEnumLiteral(genmodel::GenEnumLiteral genLiteral) :
256
genLiteral.ecoreEnumLiteral.literal
257
;
(-)templates/aspects/xpt/propsheet/PropertySection.xpt (-15 / +526 lines)
Lines 9-25 Link Here
9
 * Contributors:
9
 * Contributors:
10
 *    Anna Karjakina (Borland) - initial API and implementation
10
 *    Anna Karjakina (Borland) - initial API and implementation
11
 */
11
 */
12
«IMPORT "http://www.eclipse.org/gmf/2007/GmfGraph/PropSheet"»
13
«IMPORT "http://www.eclipse.org/gmf/2005/GraphicalDefinition"»
12
«IMPORT "http://www.eclipse.org/gmf/2005/GenModel/2.0"»
14
«IMPORT "http://www.eclipse.org/gmf/2005/GenModel/2.0"»
15
«IMPORT "http://www.eclipse.org/emf/2002/GenModel"»
13
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
16
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
14
17
18
«EXTENSION xpt::EMFUtils»
19
«EXTENSION xpt::GenModelUtils»
15
«EXTENSION aspects::xpt::propsheet::Utils»
20
«EXTENSION aspects::xpt::propsheet::Utils»
16
21
17
«AROUND extendsList FOR gmfgen::GenCustomPropertyTab»«IF isCustomTab()»org.eclipse.gmf.graphdef.editor.sheet.AbstractCustomPropertySection«ELSE»«targetDef.proceed()»«ENDIF»«ENDAROUND»
22
«AROUND extendsList FOR gmfgen::GenCustomPropertyTab»«IF isCustomTab()»org.eclipse.gmf.graphdef.editor.sheet.CustomStylesPropertySection
23
«ELSEIF isLayoutTab()»org.eclipse.gmf.graphdef.editor.sheet.CustomLayoutPropertySection
24
«ELSEIF isExampleTab()»org.eclipse.gmf.graphdef.editor.sheet.AbstractCustomSectionParent
25
«ELSE»«targetDef.proceed()»«ENDIF»«ENDAROUND»
18
26
19
«AROUND implementsClause FOR gmfgen::GenCustomPropertyTab»«IF isCustomTab()»«ELSE»«targetDef.proceed()»«ENDIF»«ENDAROUND»
27
«AROUND implementsClause FOR gmfgen::GenCustomPropertyTab»«IF isCustomTab() || isLayoutTab() || isExampleTab()»«ELSE»«targetDef.proceed()»«ENDIF»«ENDAROUND»
20
28
21
«AROUND transfromSelectionMethod FOR gmfgen::GenCustomPropertyTab»
29
«AROUND transfromSelectionMethod FOR gmfgen::GenCustomPropertyTab»
22
«IF isLayoutTab() || isViewTab() || isPointTab() || isCustomTab()»
30
«IF isLayoutTab() || isViewTab() || isPointTab() || isCustomTab() || isExampleTab()»
23
	«EXPAND xpt::Common::generatedMemberComment("Modify/unwrap selection.")»
31
	«EXPAND xpt::Common::generatedMemberComment("Modify/unwrap selection.")»
24
	protected Object transformSelection(Object selected) {
32
	protected Object transformSelection(Object selected) {
25
«IF isViewTab() -»
33
«IF isViewTab() -»
Lines 58-67 Link Here
58
«ENDAROUND»
66
«ENDAROUND»
59
67
60
«AROUND getPropertySourceMethod FOR gmfgen::GenCustomPropertyTab-»
68
«AROUND getPropertySourceMethod FOR gmfgen::GenCustomPropertyTab-»
61
«IF isLayoutTab() || isViewTab() || isPointTab()»
69
«IF isViewTab() || isPointTab()»
62
	«EXPAND xpt::Common::generatedMemberComment»
70
	«EXPAND xpt::Common::generatedMemberComment»
63
	public org.eclipse.ui.views.properties.IPropertySource getPropertySource(Object object) {
71
	public org.eclipse.ui.views.properties.IPropertySource getPropertySource(Object object) {
64
		«IF isLayoutTab()-»
72
		«IF isLayoutTab() || isExampleTab()-»
65
		«EXPAND createLayoutSources»
73
		«EXPAND createLayoutSources»
66
		«ELSEIF isPointTab()-»
74
		«ELSEIF isPointTab()-»
67
		«EXPAND createTemplatePointSources»
75
		«EXPAND createTemplatePointSources»
Lines 82-102 Link Here
82
		return null;
90
		return null;
83
		«ENDIF-»
91
		«ENDIF-»
84
	}
92
	}
85
«ELSEIF isCustomTab()»
93
«ELSEIF isCustomTab() || isLayoutTab() || isExampleTab()»
86
«ELSE-»
94
«ELSE-»
87
«targetDef.proceed()»
95
«targetDef.proceed()»
88
«ENDIF-»
96
«ENDIF-»
89
«ENDAROUND»
97
«ENDAROUND»
90
98
91
«AROUND getPropertySourceProviderMethod FOR gmfgen::GenCustomPropertyTab»
99
«AROUND getPropertySourceProviderMethod FOR gmfgen::GenCustomPropertyTab»
92
«IF isCustomTab()»
100
«IF isCustomTab() || isLayoutTab() || isExampleTab()»
93
«ELSE-»
101
«ELSE-»
94
«targetDef.proceed()»
102
«targetDef.proceed()»
95
«ENDIF-»
103
«ENDIF-»
96
«ENDAROUND»
104
«ENDAROUND»
97
105
98
«AROUND getAdapterFactoryMethod FOR gmfgen::GenCustomPropertyTab»
106
«AROUND getAdapterFactoryMethod FOR gmfgen::GenCustomPropertyTab»
99
«IF isLayoutTab() || isViewTab() || isPointTab()»
107
«IF isViewTab() || isPointTab()»
100
	«EXPAND xpt::Common::generatedMemberComment»
108
	«EXPAND xpt::Common::generatedMemberComment»
101
	protected org.eclipse.emf.common.notify.AdapterFactory getAdapterFactory(Object object) {
109
	protected org.eclipse.emf.common.notify.AdapterFactory getAdapterFactory(Object object) {
102
		if (getEditingDomain() instanceof org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) {
110
		if (getEditingDomain() instanceof org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) {
Lines 108-114 Link Here
108
		}
116
		}
109
		return null;
117
		return null;
110
	}
118
	}
111
«ELSEIF isCustomTab()»
119
«ELSEIF isCustomTab() || isLayoutTab() || isExampleTab()»
112
«ELSE-»
120
«ELSE-»
113
«targetDef.proceed()»
121
«targetDef.proceed()»
114
«ENDIF-»
122
«ENDIF-»
Lines 167-185 Link Here
167
«ENDDEFINE»
175
«ENDDEFINE»
168
176
169
«AROUND additions FOR gmfgen::GenCustomPropertyTab-»
177
«AROUND additions FOR gmfgen::GenCustomPropertyTab-»
170
	«IF isLayoutTab() || isPointTab()»
178
	«IF isPointTab()»
171
		«EXPAND SingleDescriptorPropertySourceClass-»
179
		«EXPAND SingleDescriptorPropertySourceClass-»
172
		«IF isLayoutTab()»
180
	«ELSEIF isLayoutTab() || isExampleTab()»
173
			«EXPAND LayoutItemPropertyDescriptorClass-»
174
		«ENDIF»
175
	«ELSEIF isCustomTab()»
181
	«ELSEIF isCustomTab()»
176
	    «EXPAND getImageRegistry-»
182
	    «EXPAND getImageRegistry-»
177
	«ELSE»
183
	«ELSE»
178
		«EXPAND createPropertySource»
184
		«EXPAND createPropertySource»
179
	«ENDIF»
185
	«ENDIF»
186
	«EXPAND modelExtensionExample-»
180
«ENDAROUND»
187
«ENDAROUND»
181
188
182
183
«DEFINE createPropertySource FOR gmfgen::GenCustomPropertyTab-»
189
«DEFINE createPropertySource FOR gmfgen::GenCustomPropertyTab-»
184
«EXPAND xpt::Common::generatedMemberComment»
190
«EXPAND xpt::Common::generatedMemberComment»
185
    protected org.eclipse.ui.views.properties.IPropertySource createPropertySource(Object object, org.eclipse.emf.edit.provider.IItemPropertySource itemPropertySource) {
191
    protected org.eclipse.ui.views.properties.IPropertySource createPropertySource(Object object, org.eclipse.emf.edit.provider.IItemPropertySource itemPropertySource) {
Lines 300-306 Link Here
300
«ENDDEFINE»
306
«ENDDEFINE»
301
307
302
«AROUND setInputMethod FOR gmfgen::GenCustomPropertyTab»
308
«AROUND setInputMethod FOR gmfgen::GenCustomPropertyTab»
303
«IF isCustomTab()-»
309
«IF isCustomTab() || isLayoutTab() || isExampleTab()-»
304
	«EXPAND xpt::Common::generatedMemberComment»
310
	«EXPAND xpt::Common::generatedMemberComment»
305
	private java.util.Collection mySavedSelection = new java.util.ArrayList();
311
	private java.util.Collection mySavedSelection = new java.util.ArrayList();
306
	
312
	
Lines 332-334 Link Here
332
«targetDef.proceed()»
338
«targetDef.proceed()»
333
«ENDIF-»
339
«ENDIF-»
334
«ENDAROUND»
340
«ENDAROUND»
341
342
«REM»
343
///////////////////////////////// Model Customization Example /////////////////////////////////
344
«ENDREM»
345
346
«DEFINE modelExtensionExample FOR gmfgen::GenCustomPropertyTab-»
347
	«EXPAND processModelExtensionExample FOREACH getReferencingObjects(this).typeSelect(propsheet::CustomPropertySection)»
348
«ENDDEFINE»
349
350
«DEFINE processModelExtensionExample FOR propsheet::CustomPropertySection-»
351
	«EXPAND xpt::Common::generatedMemberComment»
352
	private ModelHelper myModelHelper;
353
	
354
	«EXPAND initVars FOREACH contents-»
355
356
	«EXPAND xpt::Common::generatedMemberComment»
357
	public void doCreateControls(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage tabbedPropertySheetPage) {
358
		org.eclipse.swt.widgets.Composite mainComposite = createMainWidget(parent);
359
		«EXPAND createControls("mainComposite") FOREACH contents-»
360
	}
361
362
	«EXPAND xpt::Common::generatedMemberComment»
363
	public void doDispose() {
364
		«EXPAND disposeControl FOREACH contents-»
365
	}
366
367
	«EXPAND xpt::Common::generatedMemberComment»
368
	public void refresh() {
369
		getListener().startNonUserChange();
370
		for (java.util.Iterator it = getSavedSelection().iterator(); it.hasNext();) {
371
			Object next = it.next();
372
			if (next instanceof «target.getQualifiedInterfaceName()») {
373
				final «target.getQualifiedInterfaceName()» target = («target.getQualifiedInterfaceName()»)next;
374
				executeAsReadAction(new Runnable() {
375
					public void run() {
376
						updateFromModel(target);
377
					}
378
				});
379
			}
380
		}
381
		getListener().finishNonUserChange();
382
	}
383
	
384
	«EXPAND xpt::Common::generatedMemberComment»
385
	public void updateFromModel(«target.getQualifiedInterfaceName()» target) {
386
		«EXPAND updateFromModel("target") FOREACH contents-»
387
	}
388
	
389
	«EXPAND xpt::Common::generatedMemberComment»
390
	public ModelUpdater createModelUpdater() {
391
		return new ModelUpdater() {
392
			public void applyChangesFrom(org.eclipse.swt.widgets.Widget widget, int kind) {
393
				«genTab.className».this.applyChangesFrom(widget, kind);
394
			}
395
		};
396
	}
397
398
	«EXPAND xpt::Common::generatedMemberComment»
399
	public void applyChangesFrom(final org.eclipse.swt.widgets.Widget widget, int kind) {
400
		String commandName = "Modifying model with ui data from "+widget.toString();
401
		java.util.ArrayList commands = new java.util.ArrayList(getSavedSelection().size());
402
		for (java.util.Iterator it = getSavedSelection().iterator(); it.hasNext();) {
403
			Object next = it.next();
404
			if (next instanceof «target.getQualifiedInterfaceName()») {
405
				final «target.getQualifiedInterfaceName()» target = («target.getQualifiedInterfaceName()»)next;
406
				commands.add(createCommand(commandName, target, getModelModifierFor(target, widget, kind)));
407
			}
408
		}
409
		executeAsCompositeCommand(commandName, commands);
410
		//refresh();
411
	}
412
	
413
	«EXPAND xpt::Common::generatedMemberComment»
414
	public Runnable getModelModifierFor(final «target.getQualifiedInterfaceName()» target, final org.eclipse.swt.widgets.Widget widget, int kind) {
415
		«EXPAND wrapModelHelperWithRunnable("target", "widget") FOREACH contents-»
416
		// default:
417
		return new Runnable() {
418
			public void run() {
419
				// does nothing
420
			}
421
		};
422
	}
423
424
425
	«EXPAND xpt::Common::generatedMemberComment»
426
	protected ModelHelper getModelHelper() {
427
		if (myModelHelper == null) {
428
			myModelHelper = new ModelHelper();
429
		}
430
		return myModelHelper;
431
	}
432
	
433
	«EXPAND modelHelperInnerClass»
434
«ENDDEFINE»
435
436
«DEFINE initVars FOR propsheet::Radio-»
437
«EXPAND xpt::Common::generatedMemberComment»
438
private org.eclipse.swt.widgets.Button «name()»;
439
«IF null != iconPath»«EXPAND initImage»«ENDIF»
440
«ENDDEFINE»
441
442
«DEFINE initVars FOR propsheet::Checkbox-»
443
«EXPAND xpt::Common::generatedMemberComment»
444
private org.eclipse.swt.widgets.Button «name()»;
445
«IF null != iconPath»«EXPAND initImage»«ENDIF»
446
«ENDDEFINE»
447
448
«DEFINE initVars FOR propsheet::Spin-»
449
«EXPAND xpt::Common::generatedMemberComment»
450
private org.eclipse.swt.widgets.Spinner «name()»;
451
«ENDDEFINE»
452
453
«DEFINE initVars FOR propsheet::TextField-»
454
«EXPAND xpt::Common::generatedMemberComment»
455
private org.eclipse.swt.widgets.Text «name()»;
456
«ENDDEFINE»
457
458
«DEFINE initVars FOR propsheet::Label-»
459
«EXPAND xpt::Common::generatedMemberComment»
460
private org.eclipse.swt.custom.CLabel «name()»;
461
«IF null != iconPath»«EXPAND initImage»«ENDIF»
462
«ENDDEFINE»
463
464
«DEFINE initVars FOR propsheet::Group-»
465
«EXPAND xpt::Common::generatedMemberComment»
466
«IF createLabel(text)»private org.eclipse.swt.widgets.Group «name()»;
467
«ELSE»private org.eclipse.swt.widgets.Composite «name()»;«ENDIF»
468
«EXPAND initVars FOREACH contents-»
469
«ENDDEFINE»
470
471
«DEFINE initVars FOR propsheet::Sectionable-»
472
«ERROR "Unsupported Graphical Control"»
473
«ENDDEFINE»
474
475
«DEFINE initImage FOR propsheet::Sectionable-»
476
«EXPAND xpt::Common::generatedMemberComment»
477
private org.eclipse.swt.graphics.Image «name()»_image;
478
«ENDDEFINE»
479
480
«DEFINE createControls(String parentVar) FOR propsheet::Group-»
481
«IF createLabel(text)-»
482
«name()» = createGroupWidget(«parentVar», «EXPAND createLabel», «EXPAND layoutArgs»);
483
«ELSE-»
484
«name()» = createCompositeWidget(«parentVar», "", «EXPAND layoutArgs»);
485
«ENDIF»
486
«EXPAND createControls(name()) FOREACH contents-»
487
«ENDDEFINE»
488
489
«DEFINE createControls(String parentVar) FOR propsheet::Radio-»
490
«name()» = createRadioButton(«parentVar», «EXPAND createLabel», «EXPAND layoutArgs»);
491
«IF null != iconPath»«EXPAND createImage(iconPath)»«ENDIF»
492
«IF null != modelElement»«EXPAND installListener»«ENDIF»
493
«ENDDEFINE»
494
495
«DEFINE createControls(String parentVar) FOR propsheet::Checkbox-»
496
«name()» = createCheckboxButton(«parentVar», «EXPAND createLabel», «EXPAND layoutArgs»);
497
«IF null != iconPath»«EXPAND createImage(iconPath)»«ENDIF»
498
«IF null != modelElement»«EXPAND installListener»«ENDIF»
499
«ENDDEFINE»
500
501
«DEFINE createControls(String parentVar) FOR propsheet::Spin-»
502
«name()» = createSpinnerWidget(«parentVar», «EXPAND createLabel», «min», «max», «inc», 100, «EXPAND layoutArgs»);
503
«IF null != modelElement»«EXPAND installListener»«ENDIF»
504
«ENDDEFINE»
505
506
«DEFINE createControls(String parentVar) FOR propsheet::TextField-»
507
«name()» = createTextWidget(«parentVar», «EXPAND createLabel», «EXPAND layoutArgs»);
508
«IF null != modelElement»«EXPAND installListener»«ENDIF»
509
«ENDDEFINE»
510
511
«DEFINE createControls(String parentVar) FOR propsheet::Label-»
512
«name()» = createLabelWidget(«parentVar», «EXPAND createLabel», «EXPAND layoutArgs»);
513
«IF null != iconPath»«EXPAND createImage(iconPath)»«ENDIF»
514
«ENDDEFINE»
515
516
«DEFINE createControls(String parentVar) FOR propsheet::Sectionable-»
517
«ERROR "Cannot create Abstract Graphical Control"»
518
«ENDDEFINE»
519
520
«DEFINE createLabel FOR propsheet::Labeled»
521
«IF createLabel(text)»«IF null != text.overridedItemProviderText»"«text.overridedItemProviderText»"«ELSE»«EXPAND callStringsAccessor»«ENDIF»«ELSE»""«ENDIF»«ENDDEFINE»
522
523
«DEFINE createImage(String iconPath) FOR propsheet::Sectionable-»
524
«name()»_image = «getCustomPropertySection().genTab.sheet.editorGen.plugin.getActivatorQualifiedClassName()».findImageDescriptor("«iconPath»").createImage();
525
«name()».setImage(«name()»_image);
526
«ENDDEFINE»
527
528
«DEFINE installListener FOR propsheet::Sectionable-»
529
getListener().startListeningTo(«name()»);
530
«ENDDEFINE»
531
532
«DEFINE layoutArgs FOR Sectionable-»
533
«IF null != layoutConstraints-»
534
«EXPAND processLeftAndTopLayoutConstraints FOR layoutConstraints-»
535
«ELSE-»
536
null, null, null, null, true, true, false, false
537
«ENDIF-»
538
«ENDDEFINE»
539
540
«DEFINE processLeftAndTopLayoutConstraints FOR propsheet::LayoutConstraints-»
541
«ERROR "Abstract definition"»
542
«ENDDEFINE»
543
544
«DEFINE processLeftAndTopLayoutConstraints FOR propsheet::FormLayoutConstraints-»
545
«IF null != anchorControl-»
546
	«IF Positions::LEFT.value == relativePosition.value-»
547
«anchorControl.name()», null, null, null, true, false, «lowermost», «rightmost»
548
	«ELSEIF Positions::RIGHT.value == relativePosition.value-»
549
null, null, «anchorControl.name()», null, false, false, «lowermost», «rightmost»
550
	«ELSEIF Positions::TOP.value == relativePosition.value-»
551
null, «anchorControl.name()», null, null, false, true, «lowermost», «rightmost»
552
	«ELSEIF Positions::BOTTOM.value == relativePosition.value-»
553
null, null, null, «anchorControl.name()», false, false, «lowermost», «rightmost»
554
	«ENDIF-»
555
«ELSE-»
556
null, null, null, null, false, false, «lowermost», «rightmost»
557
«ENDIF-»
558
«ENDDEFINE»
559
560
«DEFINE disposeControl FOR propsheet::Group-»
561
«EXPAND disposeControl FOREACH contents-»
562
«ENDDEFINE»
563
564
«DEFINE disposeControl FOR propsheet::Radio-»
565
«IF null != modelElement»«EXPAND deinstallListener»«ENDIF»
566
«IF null != iconPath-»«EXPAND disposeImage»«ENDIF»
567
«ENDDEFINE»
568
569
«DEFINE disposeControl FOR propsheet::Checkbox-»
570
«IF null != modelElement»«EXPAND deinstallListener»«ENDIF»
571
«IF null != iconPath-»«EXPAND disposeImage»«ENDIF»
572
«ENDDEFINE»
573
574
«DEFINE disposeControl FOR propsheet::Spin-»
575
«IF null != modelElement»«EXPAND deinstallListener»«ENDIF»
576
«ENDDEFINE»
577
578
«DEFINE disposeControl FOR propsheet::TextField-»
579
«IF null != modelElement»«EXPAND deinstallListener»«ENDIF»
580
«ENDDEFINE»
581
582
«DEFINE disposeControl FOR propsheet::Label-»
583
«IF null != iconPath-»«EXPAND disposeImage»«ENDIF»
584
«ENDDEFINE»
585
586
«DEFINE disposeControl FOR propsheet::Sectionable-»
587
«ERROR "Cannot dispose Abstract Graphical Control"»
588
«ENDDEFINE»
589
590
«DEFINE disposeImage FOR propsheet::Sectionable-»
591
«name()»_image.dispose();
592
«name()»_image = null;
593
«ENDDEFINE»
594
595
«DEFINE deinstallListener FOR propsheet::Sectionable-»
596
getListener().stopListeningTo(«name()»);
597
«ENDDEFINE»
598
599
«DEFINE wrapModelHelperWithRunnable(String modelVar, String widgetVar) FOR propsheet::Sectionable-»
600
«IF null != getModelElement()-»
601
if («widgetVar» == «name()» && «name()».isVisible()) {
602
	return new Runnable() {
603
		public void run() {
604
			«EXPAND applyChanges(modelVar, widgetVar)-»
605
		}
606
	};
607
}
608
«ENDIF»
609
«ENDDEFINE»
610
611
«DEFINE wrapModelHelperWithRunnable(String modelVar, String widgetVar) FOR propsheet::Group-»
612
«EXPAND wrapModelHelperWithRunnable(modelVar, widgetVar) FOREACH contents-»«ENDDEFINE»
613
614
«DEFINE applyChanges(String modelVar, String widgetVar) FOR propsheet::Sectionable-»
615
«ERROR "Cannot make appliance of changes for Abstract control"»
616
«ENDDEFINE»
617
618
«DEFINE applyChanges(String modelVar, String widgetVar) FOR propsheet::Group-»
619
«EXPAND applyChanges(modelVar, widgetVar) FOREACH contents-»
620
«ENDDEFINE»
621
622
«DEFINE applyChanges(String modelVar, String widgetVar) FOR propsheet::Label-»
623
«ENDDEFINE»
624
625
«DEFINE applyChanges(String modelVar, String widgetVar) FOR propsheet::Radio-»
626
final boolean value = «name()».getSelection();
627
if (value) {
628
	«EXPAND callSetterForModelProperty(modelVar, "value")»;
629
}
630
«ENDDEFINE»
631
632
«DEFINE applyChanges(String modelVar, String widgetVar) FOR propsheet::Checkbox-»
633
final boolean value = «name()».getSelection();
634
«EXPAND callSetterForModelProperty(modelVar, "value")»;
635
«ENDDEFINE»
636
637
«DEFINE applyChanges(String modelVar, String widgetVar) FOR propsheet::Spin-»
638
final int value = «name()».getSelection();
639
«EXPAND callSetterForModelProperty(modelVar, "value")»;
640
«ENDDEFINE»
641
642
«DEFINE applyChanges(String modelVar, String widgetVar) FOR propsheet::TextField-»
643
final String value = «name()».getText();
644
«EXPAND callSetterForModelProperty(modelVar, "value")»;
645
«ENDDEFINE»
646
647
«DEFINE setValue(propsheet::Sectionable sect, String modelVar, String valueVar) FOR propsheet::FeatureReference-»
648
«LET composeModelCall(sect, modelVar) AS modelCallsChain-»
649
	«getSetterAccessor(modelCallsChain, feature.getAccessorName())»(«valueVar»);
650
«ENDLET»
651
«ENDDEFINE»
652
653
«DEFINE setValue(propsheet::Sectionable sect, String modelVar, String valueVar) FOR propsheet::IsFeatureOfTypeReference-»
654
«LET composeModelCall(sect.parent, modelVar) AS modelCallsChain-»
655
	«modelCallsChain».«feature.getSetterAccessor()»(«getQualifiedClassifierCreaterName(isOfType)»);
656
«ENDLET»
657
«ENDDEFINE»
658
659
«DEFINE setValue(propsheet::Sectionable sect, String modelVar, String valueVar) FOR propsheet::IsFeatureIsOfKindReference-»
660
«IF null != sect.parent.modelElement-»
661
	«EXPAND setEnumLiteralValue(sect.parent, modelVar, valueVar, sect.parent.modelElement.feature)-»
662
«ELSE-»
663
    «EXPAND setEnumLiteralValue(sect, modelVar, valueVar, feature)-»
664
«ENDIF»
665
«ENDDEFINE»
666
667
«DEFINE setEnumLiteralValue(propsheet::Sectionable sect, String modelVar, String valueVar, genmodel::GenFeature theFeature) FOR propsheet::IsFeatureIsOfKindReference-»
668
«LET composeModelCall(sect.parent, modelVar) AS modelCallsChain-»
669
	«modelCallsChain».«theFeature.getSetterAccessor()»(«isOfValue.genEnum.getQualifiedInterfaceName()».«getEnumLiteralInstanceConstantName(isOfValue)»);
670
«ENDLET»
671
«ENDDEFINE»
672
673
«DEFINE callSetterForModelProperty(String targetVar, String valueVar) FOR propsheet::Sectionable»getModelHelper().setValueFor«name().toFirstUpper()»(«targetVar», «valueVar»)«ENDDEFINE»
674
675
«DEFINE callGetterForModelProperty(String targetVar) FOR propsheet::Sectionable»getModelHelper().getValueFor«name().toFirstUpper()»(«targetVar»)«ENDDEFINE»
676
677
«DEFINE callVisibilityTester(String targetVar) FOR propsheet::Sectionable»getModelHelper().isVisible«name().toFirstUpper()»(«targetVar»)«ENDDEFINE»
678
679
«DEFINE callStringsAccessor FOR propsheet::Labeled»getModelHelper().getName«name().toFirstUpper()»FromMetamodel()«ENDDEFINE»
680
681
«DEFINE updateFromModel(String targetVar) FOR propsheet::Sectionable-»
682
«IF isVisibleOnlyForTargets()-»
683
boolean is«name().toFirstUpper()»Visible = «EXPAND callVisibilityTester(targetVar)»;
684
«name()».setVisible(is«name().toFirstUpper()»Visible);
685
if (is«name().toFirstUpper()»Visible)«ENDIF» 
686
{
687
	«EXPAND updateUIValue(targetVar)-»
688
}
689
«ENDDEFINE»
690
691
«DEFINE updateUIValue(String targetVar) FOR propsheet::Group-»
692
«EXPAND updateFromModel(targetVar) FOREACH contents-»
693
«ENDDEFINE»
694
695
«DEFINE updateUIValue(String targetVar) FOR propsheet::Radio-»
696
«IF null != modelElement-»
697
«name()».setSelection(«EXPAND callGetterForModelProperty(targetVar)»);«ENDIF»
698
«ENDDEFINE»
699
700
«DEFINE updateUIValue(String targetVar) FOR propsheet::Checkbox-»
701
«IF null != modelElement-»
702
«name()».setSelection(«EXPAND callGetterForModelProperty(targetVar)»);«ENDIF»
703
«ENDDEFINE»
704
705
«DEFINE updateUIValue(String targetVar) FOR propsheet::Spin-»
706
«IF null != modelElement-»
707
«name()».setSelection(«EXPAND callGetterForModelProperty(targetVar)»);«ENDIF»
708
«ENDDEFINE»
709
710
«DEFINE updateUIValue(String targetVar) FOR propsheet::TextField-»
711
«IF null != modelElement-»
712
«name()».setText(«EXPAND callGetterForModelProperty(targetVar)»);«ENDIF»
713
«ENDDEFINE»
714
715
«DEFINE updateUIValue(String targetVar) FOR propsheet::Label-»
716
«IF createLabel(text)-»
717
//«name()».setText("«text.overridedItemProviderText»");«ENDIF»
718
«ENDDEFINE»
719
720
«DEFINE updateUIValue(String targetVar) FOR propsheet::Sectionable»
721
«ERROR "Cannot update Abstract UI Definition"»
722
«ENDDEFINE»
723
724
«DEFINE modelHelperInnerClass FOR propsheet::CustomPropertySection-»
725
«EXPAND xpt::Common::generatedMemberComment»
726
public static final class ModelHelper {
727
«EXPAND createAccessors-»
728
«EXPAND modelHelperAdditions-»
729
}
730
«ENDDEFINE»
731
732
«DEFINE modelHelperAdditions FOR propsheet::CustomPropertySection-»
733
«ENDDEFINE»
734
735
«DEFINE createAccessors FOR propsheet::Group-»
736
«IF isVisibleOnlyForTargets()»«EXPAND createVisibilityTesters»«ENDIF-»
737
«EXPAND createMetamodelNameGetter(this) FOR getModelElement()-»
738
«EXPAND createAccessors FOREACH contents-»
739
«ENDDEFINE»
740
741
«DEFINE createAccessors FOR propsheet::Sectionable-»
742
«EXPAND createGetterForModelProperty(this) FOR getModelElement()-»
743
«EXPAND createSetterForModelProperty(this) FOR getModelElement()-»
744
«IF isVisibleOnlyForTargets()»«EXPAND createVisibilityTesters»«ENDIF-»
745
«ENDDEFINE»
746
747
«DEFINE createAccessors FOR propsheet::Labeled-»
748
«EXPAND createGetterForModelProperty(this) FOR getModelElement()-»
749
«EXPAND createSetterForModelProperty(this) FOR getModelElement()-»
750
«EXPAND createMetamodelNameGetter(this) FOR getModelElement()-»
751
«IF isVisibleOnlyForTargets()»«EXPAND createVisibilityTesters»«ENDIF-»
752
«ENDDEFINE»
753
754
«DEFINE createVisibilityTesters FOR propsheet::Sectionable-»
755
«EXPAND xpt::Common::generatedMemberComment»
756
public boolean isVisible«name().toFirstUpper()»(«getCustomPropertySection().target.getQualifiedInterfaceName()» targetVar) {
757
	return «parent.composeModelCall("targetVar")» instanceof «target.getQualifiedInterfaceName()»;
758
}
759
«ENDDEFINE»
760
761
«DEFINE createMetamodelNameGetter(propsheet::Labeled sectionable) FOR propsheet::FeatureReference-»
762
«IF createLabel(sectionable.text) && null == sectionable.text.overridedItemProviderText»
763
«EXPAND xpt::Common::generatedMemberComment»
764
public String getName«sectionable.name().toFirstUpper()»FromMetamodel() {
765
	return "«EXPAND createFeaturedMetamodelNameGetter(sectionable)»";
766
}
767
«ENDIF»
768
«ENDDEFINE»
769
770
«DEFINE createFeaturedMetamodelNameGetter(propsheet::Sectionable sectionable) FOR propsheet::FeatureReference-»
771
«getFormattedName(feature)»«ENDDEFINE»
772
773
«DEFINE createFeaturedMetamodelNameGetter(propsheet::Sectionable sectionable) FOR propsheet::IsFeatureIsOfKindReference-»
774
«getEnumLiteral(isOfValue)»«ENDDEFINE»
775
776
«DEFINE createGetterForModelProperty(propsheet::Sectionable sectionable) FOR propsheet::FeatureReference-»
777
«ERROR "Unexpected model reference kind"»
778
«ENDDEFINE»
779
780
«DEFINE createSetterForModelProperty(propsheet::Sectionable sectionable) FOR propsheet::FeatureReference-»
781
«ERROR "Unexpected model reference kind"»
782
«ENDDEFINE»
783
784
«DEFINE createGetterForModelProperty(propsheet::Sectionable sectionable) FOR propsheet::BooleanCondition-»
785
«LET sectionable.getCustomPropertySection().target.getName().toFirstLower() AS targetVar-»
786
«EXPAND xpt::Common::generatedMemberComment»
787
public boolean getValueFor«sectionable.name().toFirstUpper()»(«sectionable.getCustomPropertySection().target.getQualifiedInterfaceName()» «targetVar») {
788
    return «EXPAND booleanCondition(sectionable.composeModelCall(targetVar))»;
789
}
790
«ENDLET»
791
«ENDDEFINE»
792
793
«DEFINE createSetterForModelProperty(propsheet::Sectionable sectionable) FOR propsheet::BooleanCondition-»
794
«LET sectionable.getCustomPropertySection().target.getName().toFirstLower() AS targetVar-»
795
«EXPAND xpt::Common::generatedMemberComment»
796
public void setValueFor«sectionable.name().toFirstUpper()»(«sectionable.getCustomPropertySection().target.getQualifiedInterfaceName()» «targetVar», boolean value) {
797
	«EXPAND setValue(sectionable, targetVar, "value")-»;
798
}
799
«ENDLET»
800
«ENDDEFINE»
801
802
«DEFINE createGetterForModelProperty(propsheet::Sectionable sectionable) FOR propsheet::IntValue-»
803
«LET sectionable.getCustomPropertySection().target.getName().toFirstLower() AS targetVar-»
804
«EXPAND xpt::Common::generatedMemberComment»
805
public int getValueFor«sectionable.name().toFirstUpper()»(«sectionable.getCustomPropertySection().target.getQualifiedInterfaceName()» «targetVar») {
806
	int value = «sectionable.composeModelCall(targetVar)»;
807
	return value;
808
}
809
«ENDLET»
810
«ENDDEFINE»
811
812
«DEFINE createSetterForModelProperty(propsheet::Sectionable sectionable) FOR propsheet::IntValue-»
813
«LET sectionable.getCustomPropertySection().target.getName().toFirstLower() AS targetVar-»
814
«EXPAND xpt::Common::generatedMemberComment»
815
public void setValueFor«sectionable.name().toFirstUpper()»(«sectionable.getCustomPropertySection().target.getQualifiedInterfaceName()» «targetVar», int value) {
816
	«EXPAND setValue(sectionable, targetVar, "value")-»;
817
}
818
«ENDLET»
819
«ENDDEFINE»
820
821
«DEFINE createGetterForModelProperty(propsheet::Sectionable sectionable) FOR propsheet::StringValue-»
822
«LET sectionable.getCustomPropertySection().target.getName().toFirstLower() AS targetVar-»
823
«EXPAND xpt::Common::generatedMemberComment»
824
public String getValueFor«sectionable.name().toFirstUpper()»(«sectionable.getCustomPropertySection().target.getQualifiedInterfaceName()» «targetVar») {
825
	String value = «sectionable.composeModelCall(targetVar)»;
826
	return value;
827
}
828
«ENDLET»
829
«ENDDEFINE»
830
831
«DEFINE createSetterForModelProperty(propsheet::Sectionable sectionable) FOR propsheet::StringValue-»
832
«LET sectionable.getCustomPropertySection().target.getName().toFirstLower() AS targetVar-»
833
«EXPAND xpt::Common::generatedMemberComment»
834
public void setValueFor«sectionable.name().toFirstUpper()»(«sectionable.getCustomPropertySection().target.getQualifiedInterfaceName()» «targetVar», String value) {
835
	«EXPAND setValue(sectionable, targetVar, "value")-»;
836
}
837
«ENDLET»
838
«ENDDEFINE»
839
840
«DEFINE booleanCondition(String varName) FOR propsheet::BooleanCondition»«varName»«ENDDEFINE»
841
842
«DEFINE booleanCondition(String varName) FOR propsheet::IsFeatureOfTypeReference»«IF null != isOfType»«varName» instanceof «isOfType.getQualifiedInterfaceName()»«ELSE»«varName» == null«ENDIF»«ENDDEFINE»
843
844
«DEFINE booleanCondition(String varName) FOR propsheet::IsFeatureIsOfKindReference»«IF null != isOfValue»«varName» == «getQualifiedInterfaceName(isOfValue.genEnum)».«isOfValue.ecoreEnumLiteral.name»«ELSE»false«ENDIF»«ENDDEFINE»
845
(-).project (+1 lines)
Lines 3-8 Link Here
3
	<name>org.eclipse.gmf.graphdef.editor</name>
3
	<name>org.eclipse.gmf.graphdef.editor</name>
4
	<comment></comment>
4
	<comment></comment>
5
	<projects>
5
	<projects>
6
		<project>org.eclipse.gmf.codegen</project>
6
	</projects>
7
	</projects>
7
	<buildSpec>
8
	<buildSpec>
8
		<buildCommand>
9
		<buildCommand>
(-)src-extra/org/eclipse/gmf/graphdef/editor/sheet/AbstractCustomPropertySection.java (-624 lines)
Removed Link Here
1
/*
2
 *  Copyright (c) 2007 Borland Software Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Borland Software Corporation - initial API and implementation
10
 */
11
package org.eclipse.gmf.graphdef.editor.sheet;
12
13
public abstract class AbstractCustomPropertySection extends org.eclipse.gmf.runtime.diagram.ui.properties.sections.AbstractModelerPropertySection {
14
15
	public abstract java.util.Collection getSavedSelection();
16
17
	public abstract org.eclipse.jface.resource.ImageRegistry getImageRegistry();
18
19
	private static final String KIND_KEY = "kind"; //$NON-NLS-1$
20
21
	private static final int FILL = 101;
22
23
	private static final int OUTLINE = 102;
24
25
	private static final int XOR_FILL = 103;
26
27
	private static final int XOR_OUTLINE = 104;
28
29
	private static final int CORNER_WIDTH = 201;
30
31
	private static final int CORNER_HEIGHT = 202;
32
33
	private static final int LINE_WIDTH = 203;
34
35
	private ModelUpdater myListener;
36
37
	private org.eclipse.swt.widgets.Group myLineStyleGroup;
38
39
	private org.eclipse.swt.widgets.Group myLineWidthGroup;
40
41
	private org.eclipse.swt.widgets.Group myFillOutlineGroup;
42
43
	private org.eclipse.swt.widgets.Group myCornerGroup;
44
45
	private org.eclipse.swt.widgets.Spinner myLineWidthSpinner;
46
47
	private org.eclipse.swt.widgets.Button myLineStyle_Solid;
48
49
	private org.eclipse.swt.widgets.Button myLineStyle_Dash;
50
51
	private org.eclipse.swt.widgets.Button myLineStyle_Dot;
52
53
	private org.eclipse.swt.widgets.Button myLineStyle_DashDot;
54
55
	private org.eclipse.swt.widgets.Button myLineStyle_DashDotDot;
56
57
	private org.eclipse.swt.widgets.Button myLineStyle_Custom;
58
59
	private org.eclipse.swt.widgets.Button myFillCheckbox;
60
61
	private org.eclipse.swt.widgets.Button myOutlineCheckbox;
62
63
	private org.eclipse.swt.widgets.Button myXorFillCheckbox;
64
65
	private org.eclipse.swt.widgets.Button myXorOutlineCheckbox;
66
67
	private org.eclipse.swt.widgets.Spinner myCornerWidthSpinner;
68
69
	private org.eclipse.swt.widgets.Spinner myCornerHeightSpinner;
70
71
	private org.eclipse.swt.widgets.Composite mySectionComposite;
72
73
	protected org.eclipse.emf.ecore.EObject getEObject() {
74
		if (getSavedSelection() != null && !getSavedSelection().isEmpty()) {
75
			return (org.eclipse.emf.ecore.EObject) getSavedSelection().iterator().next();
76
		}
77
		return super.getEObject();
78
	}
79
80
	public void createControls(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage tabbedPropertySheetPage) {
81
		super.createControls(parent, tabbedPropertySheetPage);
82
		mySectionComposite = getWidgetFactory().createFlatFormComposite(parent);
83
84
		myLineStyleGroup = createLineStyleGroup(mySectionComposite, getLineStyleLabel());
85
		myLineStyle_Solid = createLineStyleRadio(myLineStyleGroup, null, false, getImageRegistry().get(org.eclipse.gmf.gmfgraph.LineKind.LINE_SOLID_LITERAL.getLiteral()),
86
				org.eclipse.swt.SWT.LINE_SOLID);
87
		myLineStyle_Dash = createLineStyleRadio(myLineStyleGroup, myLineStyle_Solid, false, getImageRegistry().get(org.eclipse.gmf.gmfgraph.LineKind.LINE_DASH_LITERAL.getLiteral()),
88
				org.eclipse.swt.SWT.LINE_DASH);
89
		myLineStyle_Dot = createLineStyleRadio(myLineStyleGroup, myLineStyle_Dash, false, getImageRegistry().get(org.eclipse.gmf.gmfgraph.LineKind.LINE_DOT_LITERAL.getLiteral()),
90
				org.eclipse.swt.SWT.LINE_DOT);
91
		myLineStyle_DashDot = createLineStyleRadio(myLineStyleGroup, myLineStyle_Dot, false, getImageRegistry().get(org.eclipse.gmf.gmfgraph.LineKind.LINE_DASHDOT_LITERAL.getLiteral()),
92
				org.eclipse.swt.SWT.LINE_DASHDOT);
93
		myLineStyle_DashDotDot = createLineStyleRadio(myLineStyleGroup, myLineStyle_DashDot, false, getImageRegistry().get(org.eclipse.gmf.gmfgraph.LineKind.LINE_DASHDOTDOT_LITERAL.getLiteral()),
94
				org.eclipse.swt.SWT.LINE_DASHDOTDOT);
95
		myLineStyle_Custom = createLineStyleRadio(myLineStyleGroup, myLineStyle_DashDotDot, true, getImageRegistry().get(org.eclipse.gmf.gmfgraph.LineKind.LINE_CUSTOM_LITERAL.getLiteral()),
96
				org.eclipse.swt.SWT.LINE_CUSTOM);
97
98
		myLineWidthGroup = createLineWidthGroup(mySectionComposite, getLineWidthLabel());
99
		// org.eclipse.swt.custom.CLabel lineWidthLabel =
100
		// createLabelWidget(myLineWidthGroup, getLineWidthLabel(), null);
101
		myLineWidthSpinner = createSpinnerWidget(myLineWidthGroup, null, LINE_WIDTH);
102
103
		myFillOutlineGroup = createFillOutlineGroup(mySectionComposite, getFillOutlineLabel());
104
		myFillCheckbox = createCheckbox(myFillOutlineGroup, getFillPropertyNameLabel(), null, null, FILL);
105
		myOutlineCheckbox = createCheckbox(myFillOutlineGroup, getOutlinePropertyNameLabel(), myFillCheckbox, null, OUTLINE);
106
		myXorFillCheckbox = createCheckbox(myFillOutlineGroup, getXorFillPropertyNameLabel(), null, myFillCheckbox, XOR_FILL);
107
		myXorOutlineCheckbox = createCheckbox(myFillOutlineGroup, getXorOutlinePropertyNameLabel(), myXorFillCheckbox, myOutlineCheckbox, XOR_OUTLINE);
108
109
		myCornerGroup = createCornerGroup(mySectionComposite, getCornerDimensionsLabel());
110
		org.eclipse.swt.custom.CLabel cornerWidthLabel = createLabelWidget(myCornerGroup, getCornerWidthLabel(), null);
111
		myCornerWidthSpinner = createSpinnerWidget(myCornerGroup, cornerWidthLabel, CORNER_WIDTH);
112
		org.eclipse.swt.custom.CLabel cornerHeigthLabel = createLabelWidget(myCornerGroup, getCornerHeightLabel(), myCornerWidthSpinner);
113
		myCornerHeightSpinner = createSpinnerWidget(myCornerGroup, cornerHeigthLabel, CORNER_HEIGHT);
114
115
		getListener().startListeningTo(myLineWidthSpinner);
116
		getListener().startListeningTo(myLineStyle_Solid);
117
		getListener().startListeningTo(myLineStyle_Dash);
118
		getListener().startListeningTo(myLineStyle_Dot);
119
		getListener().startListeningTo(myLineStyle_DashDot);
120
		getListener().startListeningTo(myLineStyle_DashDotDot);
121
		getListener().startListeningTo(myLineStyle_Custom);
122
		getListener().startListeningTo(myFillCheckbox);
123
		getListener().startListeningTo(myOutlineCheckbox);
124
		getListener().startListeningTo(myXorFillCheckbox);
125
		getListener().startListeningTo(myXorOutlineCheckbox);
126
		getListener().startListeningTo(myCornerWidthSpinner);
127
		getListener().startListeningTo(myCornerHeightSpinner);
128
	}
129
130
	public void dispose() {
131
		getListener().stopListeningTo(myLineWidthSpinner);
132
		getListener().stopListeningTo(myLineStyle_Solid);
133
		getListener().stopListeningTo(myLineStyle_Dash);
134
		getListener().stopListeningTo(myLineStyle_Dot);
135
		getListener().stopListeningTo(myLineStyle_DashDot);
136
		getListener().stopListeningTo(myLineStyle_DashDotDot);
137
		getListener().stopListeningTo(myLineStyle_Custom);
138
		getListener().stopListeningTo(myFillCheckbox);
139
		getListener().stopListeningTo(myOutlineCheckbox);
140
		getListener().stopListeningTo(myXorFillCheckbox);
141
		getListener().stopListeningTo(myXorOutlineCheckbox);
142
		getListener().stopListeningTo(myCornerWidthSpinner);
143
		getListener().stopListeningTo(myCornerHeightSpinner);
144
		super.dispose();
145
	}
146
147
	protected org.eclipse.swt.widgets.Button createLineStyleRadio(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.widgets.Control topControl, boolean last,
148
			org.eclipse.swt.graphics.Image image, int kind) {
149
		org.eclipse.swt.widgets.Button radio = getWidgetFactory().createButton(parent, "", org.eclipse.swt.SWT.RADIO);
150
		radio.setImage(image);
151
		radio.setData(KIND_KEY, Integer.valueOf(kind));
152
		org.eclipse.swt.layout.FormData data = new org.eclipse.swt.layout.FormData();
153
		if (topControl == null) {
154
			data.top = new org.eclipse.swt.layout.FormAttachment(0);
155
		} else {
156
			data.top = new org.eclipse.swt.layout.FormAttachment(topControl, 5);
157
		}
158
		data.left = new org.eclipse.swt.layout.FormAttachment(0);
159
		if (last) {
160
			data.bottom = new org.eclipse.swt.layout.FormAttachment(100);
161
		}
162
		radio.setLayoutData(data);
163
		return radio;
164
	}
165
166
	protected org.eclipse.swt.widgets.Group createLineWidthGroup(org.eclipse.swt.widgets.Composite parent, String label) {
167
		org.eclipse.swt.widgets.Group group = getWidgetFactory().createGroup(parent, label);
168
		org.eclipse.swt.layout.FormData data = new org.eclipse.swt.layout.FormData();
169
		data.top = new org.eclipse.swt.layout.FormAttachment(0, 0);
170
		data.left = new org.eclipse.swt.layout.FormAttachment(myLineStyleGroup);
171
		group.setLayoutData(data);
172
		group.setLayout(createStandardFormLayout());
173
		return group;
174
	}
175
176
	protected org.eclipse.swt.widgets.Group createLineStyleGroup(org.eclipse.swt.widgets.Composite parent, String label) {
177
		org.eclipse.swt.widgets.Group group = getWidgetFactory().createGroup(parent, label);
178
		org.eclipse.swt.layout.FormData data = new org.eclipse.swt.layout.FormData();
179
		data.top = new org.eclipse.swt.layout.FormAttachment(0, 0);
180
		data.left = new org.eclipse.swt.layout.FormAttachment(0);
181
		group.setLayoutData(data);
182
		group.setLayout(createStandardFormLayout());
183
		return group;
184
	}
185
186
	protected org.eclipse.swt.widgets.Group createFillOutlineGroup(org.eclipse.swt.widgets.Composite parent, String label) {
187
		org.eclipse.swt.widgets.Group group = getWidgetFactory().createGroup(parent, label);
188
		org.eclipse.swt.layout.FormData data = new org.eclipse.swt.layout.FormData();
189
		data.top = new org.eclipse.swt.layout.FormAttachment(myLineWidthGroup);
190
		data.left = new org.eclipse.swt.layout.FormAttachment(myLineStyleGroup);
191
		group.setLayoutData(data);
192
		group.setLayout(createStandardFormLayout());
193
		return group;
194
	}
195
196
	protected org.eclipse.swt.widgets.Group createCornerGroup(org.eclipse.swt.widgets.Composite parent, String label) {
197
		org.eclipse.swt.widgets.Group group = getWidgetFactory().createGroup(parent, label);
198
		org.eclipse.swt.layout.FormData data = new org.eclipse.swt.layout.FormData();
199
		data.top = new org.eclipse.swt.layout.FormAttachment(myFillOutlineGroup);
200
		data.left = new org.eclipse.swt.layout.FormAttachment(myLineStyleGroup);
201
		data.bottom = new org.eclipse.swt.layout.FormAttachment(100);
202
		group.setLayoutData(data);
203
		group.setLayout(createStandardFormLayout());
204
		return group;
205
	}
206
207
	protected org.eclipse.swt.widgets.Layout createStandardFormLayout() {
208
		org.eclipse.swt.layout.FormLayout layout = new org.eclipse.swt.layout.FormLayout();
209
		layout.marginWidth = org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants.HSPACE + 2;
210
		layout.marginHeight = org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants.VSPACE;
211
		layout.spacing = org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants.VMARGIN + 1;
212
		return layout;
213
	}
214
215
	protected org.eclipse.swt.widgets.Button createCheckbox(org.eclipse.swt.widgets.Group parent, String label, org.eclipse.swt.widgets.Control topControl,
216
			org.eclipse.swt.widgets.Control leftControl, int kind) {
217
		org.eclipse.swt.widgets.Button checkbox = getWidgetFactory().createButton(parent, label, org.eclipse.swt.SWT.CHECK);
218
		checkbox.setData(KIND_KEY, Integer.valueOf(kind));
219
		org.eclipse.swt.layout.FormData data = new org.eclipse.swt.layout.FormData();
220
		if (topControl == null) {
221
			data.top = new org.eclipse.swt.layout.FormAttachment(0);
222
		} else {
223
			data.top = new org.eclipse.swt.layout.FormAttachment(topControl);
224
		}
225
		if (leftControl == null) {
226
			data.left = new org.eclipse.swt.layout.FormAttachment(0);
227
		} else {
228
			data.right = new org.eclipse.swt.layout.FormAttachment(100, -org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants.HSPACE);
229
			data.left = new org.eclipse.swt.layout.FormAttachment(50);
230
		}
231
		checkbox.setLayoutData(data);
232
		return checkbox;
233
	}
234
235
	private String getCornerDimensionsLabel() {
236
		return "Corner Dimensions";
237
	}
238
239
	private String getCornerWidthLabel() {
240
		return "Corner Width";
241
	}
242
243
	private String getCornerHeightLabel() {
244
		return "Corner Height";
245
	}
246
247
	private String getFillPropertyNameLabel() {
248
		return "Fill";
249
	}
250
251
	private String getOutlinePropertyNameLabel() {
252
		return "Outline";
253
	}
254
255
	private String getXorFillPropertyNameLabel() {
256
		return "XOR Fill";
257
	}
258
259
	private String getXorOutlinePropertyNameLabel() {
260
		return "XOR Outline";
261
	}
262
263
	private String getFillOutlineLabel() {
264
		return "Mix Styles";
265
	}
266
267
	private String getLineStyleLabel() {
268
		return "Line Style";
269
	}
270
271
	private String getLineWidthLabel() {
272
		return "Line Width";
273
	}
274
275
	protected void setLineWidth(final int lineWidth) {
276
		modifyModel(new RunnableWithShape() {
277
278
			public void run() {
279
				getShape().setLineWidth(lineWidth);
280
			}
281
		}, "Setting line width");
282
	}
283
284
	protected void setLineKind(final int lineKind) {
285
		modifyModel(new RunnableWithShape() {
286
287
			public void run() {
288
				getShape().setLineKind(org.eclipse.gmf.gmfgraph.LineKind.get(lineKind));
289
			}
290
		}, "Setting line style");
291
	}
292
293
	protected void setFill(final boolean value) {
294
		modifyModel(new RunnableWithShape() {
295
296
			public void run() {
297
				getShape().setFill(value);
298
			}
299
		}, "Setting shape fill");
300
	}
301
302
	protected void setOutline(final boolean value) {
303
		modifyModel(new RunnableWithShape() {
304
305
			public void run() {
306
				getShape().setOutline(value);
307
			}
308
		}, "Setting shape outline");
309
	}
310
311
	protected void setXorFill(final boolean value) {
312
		modifyModel(new RunnableWithShape() {
313
314
			public void run() {
315
				getShape().setXorFill(value);
316
			}
317
		}, "Setting shape XOR fill");
318
	}
319
320
	protected void setXorOutline(final boolean value) {
321
		modifyModel(new RunnableWithShape() {
322
323
			public void run() {
324
				getShape().setXorOutline(value);
325
			}
326
		}, "Setting shape XOR outline");
327
	}
328
329
	protected void setCornerWidth(final int cornerWidth) {
330
		modifyModel(new RunnableWithShape() {
331
332
			public void run() {
333
				((org.eclipse.gmf.gmfgraph.RoundedRectangle) getShape()).setCornerWidth(cornerWidth);
334
			}
335
		}, "Setting corner width");
336
	}
337
338
	protected void setCornerHeight(final int cornerHeight) {
339
		modifyModel(new RunnableWithShape() {
340
341
			public void run() {
342
				((org.eclipse.gmf.gmfgraph.RoundedRectangle) getShape()).setCornerHeight(cornerHeight);
343
			}
344
		}, "Setting corner height");
345
	}
346
347
	public static abstract class RunnableWithShape implements Runnable {
348
349
		private org.eclipse.gmf.gmfgraph.Shape myShape;
350
351
		public org.eclipse.gmf.gmfgraph.Shape getShape() {
352
			return myShape;
353
		}
354
355
		public void setTargetShape(org.eclipse.gmf.gmfgraph.Shape shape) {
356
			myShape = shape;
357
		}
358
	}
359
360
	protected void modifyModel(RunnableWithShape runnable, String commandName) {
361
		java.util.ArrayList commands = new java.util.ArrayList();
362
		for (java.util.Iterator it = getSavedSelection().iterator(); it.hasNext();) {
363
			final org.eclipse.emf.ecore.EObject next = (org.eclipse.emf.ecore.EObject) it.next();
364
			if (next instanceof org.eclipse.gmf.gmfgraph.Shape) {
365
				final org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) next;
366
				runnable.setTargetShape(shape);
367
				commands.add(createCommand(commandName, next, runnable));
368
			}
369
		}
370
		executeAsCompositeCommand(commandName, commands);
371
		refresh();
372
	}
373
374
	private ModelUpdater getListener() {
375
		if (myListener == null) {
376
			myListener = new ModelUpdater();
377
		}
378
		return myListener;
379
	}
380
381
	private class ModelUpdater implements org.eclipse.swt.events.ModifyListener, org.eclipse.swt.events.SelectionListener {
382
383
		private boolean nonUserChange;
384
385
		public boolean isNonUserChange() {
386
			return nonUserChange;
387
		}
388
389
		private void applyChangesFrom(org.eclipse.swt.widgets.Widget widget) {
390
			if (!isNonUserChange()) {
391
				if (widget instanceof org.eclipse.swt.widgets.Spinner) {
392
					Integer kind = (Integer) widget.getData(KIND_KEY);
393
					int value = ((org.eclipse.swt.widgets.Spinner) widget).getSelection();
394
					switch (kind.intValue()) {
395
					case CORNER_WIDTH: {
396
						setCornerWidth(value);
397
						break;
398
					}
399
					case CORNER_HEIGHT: {
400
						setCornerHeight(value);
401
						break;
402
					}
403
					case LINE_WIDTH: {
404
						setLineWidth(value);
405
						break;
406
					}
407
					}
408
				} else if (widget instanceof org.eclipse.swt.widgets.Button) {
409
					boolean turnedOn = ((org.eclipse.swt.widgets.Button) widget).getSelection();
410
					Integer kind = (Integer) widget.getData(KIND_KEY);
411
					switch (kind.intValue()) {
412
					case org.eclipse.swt.SWT.LINE_SOLID:
413
					case org.eclipse.swt.SWT.LINE_DASH:
414
					case org.eclipse.swt.SWT.LINE_DOT:
415
					case org.eclipse.swt.SWT.LINE_DASHDOT:
416
					case org.eclipse.swt.SWT.LINE_DASHDOTDOT:
417
					case org.eclipse.swt.SWT.LINE_CUSTOM: {
418
						setLineKind(kind.intValue());
419
						break;
420
					}
421
					case FILL: {
422
						setFill(turnedOn);
423
						break;
424
					}
425
					case OUTLINE: {
426
						setOutline(turnedOn);
427
						break;
428
					}
429
					case XOR_FILL: {
430
						setXorFill(turnedOn);
431
						break;
432
					}
433
					case XOR_OUTLINE: {
434
						setXorOutline(turnedOn);
435
						break;
436
					}
437
					}
438
				}
439
			}
440
		}
441
442
		public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
443
			applyChangesFrom(e.widget);
444
		}
445
446
		public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
447
			widgetSelected(e);
448
		}
449
450
		public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
451
			applyChangesFrom(e.widget);
452
		}
453
454
		public void startListeningTo(org.eclipse.swt.widgets.Spinner spinner) {
455
			spinner.addModifyListener(this);
456
			spinner.addSelectionListener(this);
457
		}
458
459
		public void stopListeningTo(org.eclipse.swt.widgets.Spinner spinner) {
460
			spinner.removeModifyListener(this);
461
			spinner.removeSelectionListener(this);
462
		}
463
464
		public void startListeningTo(org.eclipse.swt.widgets.Button button) {
465
			button.addSelectionListener(this);
466
		}
467
468
		public void stopListeningTo(org.eclipse.swt.widgets.Button button) {
469
			button.removeSelectionListener(this);
470
		}
471
472
		public void startNonUserChange() {
473
			nonUserChange = true;
474
		}
475
476
		public void finishNonUserChange() {
477
			nonUserChange = false;
478
		}
479
	}
480
481
	protected org.eclipse.swt.custom.CLabel createLabelWidget(org.eclipse.swt.widgets.Composite parent, String labelText, org.eclipse.swt.widgets.Control leftWidget) {
482
		org.eclipse.swt.custom.CLabel label = getWidgetFactory().createCLabel(parent, labelText);
483
		org.eclipse.swt.layout.FormData data = new org.eclipse.swt.layout.FormData();
484
		data.top = new org.eclipse.swt.layout.FormAttachment(0);
485
		if (leftWidget != null) {
486
			data.left = new org.eclipse.swt.layout.FormAttachment(leftWidget);
487
		} else {
488
			data.left = new org.eclipse.swt.layout.FormAttachment(0);
489
		}
490
		label.setLayoutData(data);
491
		return label;
492
	}
493
494
	protected org.eclipse.swt.widgets.Spinner createSpinnerWidget(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.widgets.Control leftWidget, int kind) {
495
		org.eclipse.swt.widgets.Spinner spinner = new org.eclipse.swt.widgets.Spinner(parent, org.eclipse.swt.SWT.BORDER);
496
		spinner.setMinimum(1);
497
		spinner.setMaximum(999);
498
		spinner.setSelection(100);
499
		spinner.setIncrement(1);
500
		spinner.setPageIncrement(100);
501
		spinner.setBackground(parent.getBackground());
502
		spinner.setForeground(parent.getForeground());
503
		spinner.setData(KIND_KEY, Integer.valueOf(kind));
504
		org.eclipse.swt.layout.FormData data = new org.eclipse.swt.layout.FormData();
505
		if (leftWidget != null) {
506
			data.left = new org.eclipse.swt.layout.FormAttachment(leftWidget);
507
		} else {
508
			data.left = new org.eclipse.swt.layout.FormAttachment(0);
509
		}
510
		data.top = new org.eclipse.swt.layout.FormAttachment(0);
511
		spinner.setLayoutData(data);
512
		return spinner;
513
	}
514
515
	private int getLineKind(Object object) {
516
		if (object instanceof org.eclipse.gmf.gmfgraph.Shape) {
517
			org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) object;
518
			return shape.getLineKind().getValue();
519
		}
520
		return -1;
521
	}
522
523
	private int getLineWidth(Object object) {
524
		if (object instanceof org.eclipse.gmf.gmfgraph.Shape) {
525
			org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) object;
526
			return shape.getLineWidth();
527
		}
528
		return -1;
529
	}
530
531
	private boolean getFill(Object object) {
532
		if (object instanceof org.eclipse.gmf.gmfgraph.Shape) {
533
			org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) object;
534
			return shape.isFill();
535
		}
536
		return false;
537
	}
538
539
	private boolean getOutline(Object object) {
540
		if (object instanceof org.eclipse.gmf.gmfgraph.Shape) {
541
			org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) object;
542
			return shape.isOutline();
543
		}
544
		return false;
545
	}
546
547
	private boolean getXorFill(Object object) {
548
		if (object instanceof org.eclipse.gmf.gmfgraph.Shape) {
549
			org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) object;
550
			return shape.isXorFill();
551
		}
552
		return false;
553
	}
554
555
	private boolean getXorOutline(Object object) {
556
		if (object instanceof org.eclipse.gmf.gmfgraph.Shape) {
557
			org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) object;
558
			return shape.isXorOutline();
559
		}
560
		return false;
561
	}
562
563
	private int getCornerWidth(Object object) {
564
		if (object instanceof org.eclipse.gmf.gmfgraph.RoundedRectangle) {
565
			org.eclipse.gmf.gmfgraph.RoundedRectangle cornered = (org.eclipse.gmf.gmfgraph.RoundedRectangle) object;
566
			return cornered.getCornerWidth();
567
		}
568
		return -1;
569
	}
570
571
	private int getCornerHeight(Object object) {
572
		if (object instanceof org.eclipse.gmf.gmfgraph.RoundedRectangle) {
573
			org.eclipse.gmf.gmfgraph.RoundedRectangle cornered = (org.eclipse.gmf.gmfgraph.RoundedRectangle) object;
574
			return cornered.getCornerHeight();
575
		}
576
		return -1;
577
	}
578
579
	public void refresh() {
580
		getListener().startNonUserChange();
581
		try {
582
			for (java.util.Iterator it = getSavedSelection().iterator(); it.hasNext();) {
583
				final Object next = it.next();
584
				mySectionComposite.setVisible(next instanceof org.eclipse.gmf.gmfgraph.Shape);
585
				if (!mySectionComposite.isVisible()) {
586
					return;
587
				}
588
				executeAsReadAction(new Runnable() {
589
590
					public void run() {
591
						int lineWidth = getLineWidth(next);
592
						if (lineWidth != -1) {
593
							myLineWidthSpinner.setSelection(lineWidth);
594
						}
595
						int lineKind = getLineKind(next);
596
						myLineStyle_Solid.setSelection(lineKind == org.eclipse.swt.SWT.LINE_SOLID);
597
						myLineStyle_Dash.setSelection(lineKind == org.eclipse.swt.SWT.LINE_DASH);
598
						myLineStyle_Dot.setSelection(lineKind == org.eclipse.swt.SWT.LINE_DOT);
599
						myLineStyle_DashDot.setSelection(lineKind == org.eclipse.swt.SWT.LINE_DASHDOT);
600
						myLineStyle_DashDotDot.setSelection(lineKind == org.eclipse.swt.SWT.LINE_DASHDOTDOT);
601
						myLineStyle_Custom.setSelection(lineKind == org.eclipse.swt.SWT.LINE_CUSTOM);
602
						myFillCheckbox.setSelection(getFill(next));
603
						myOutlineCheckbox.setSelection(getOutline(next));
604
						myXorFillCheckbox.setSelection(getXorFill(next));
605
						myXorOutlineCheckbox.setSelection(getXorOutline(next));
606
						myCornerGroup.setVisible(next instanceof org.eclipse.gmf.gmfgraph.RoundedRectangle);
607
						if (myCornerGroup.isVisible()) {
608
							int cornerWidth = getCornerWidth(next);
609
							if (cornerWidth != -1) {
610
								myCornerWidthSpinner.setSelection(cornerWidth);
611
							}
612
							int cornerHeight = getCornerHeight(next);
613
							if (cornerHeight != -1) {
614
								myCornerHeightSpinner.setSelection(cornerHeight);
615
							}
616
						}
617
					}
618
				});
619
			}
620
		} finally {
621
			getListener().finishNonUserChange();
622
		}
623
	}
624
}
(-)models/graphdef.gmfgen (-949 / +1492 lines)
Lines 1-972 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<gmfgen:GenEditorGenerator xmi:version="2.0"
2
<xmi:XMI xmi:version="2.0"
3
    xmlns:xmi="http://www.omg.org/XMI"
3
    xmlns:xmi="http://www.omg.org/XMI"
4
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
    xmlns:gmfgen="http://www.eclipse.org/gmf/2005/GenModel/2.0" packageNamePrefix="org.eclipse.gmf.graphdef.editor"
5
    xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel"
6
    modelID="GMFGraph"
6
    xmlns:gmfgen="http://www.eclipse.org/gmf/2005/GenModel/2.0"
7
    dynamicTemplates="true"
7
    xmlns:propsheet="http://www.eclipse.org/gmf/2007/GmfGraph/PropSheet">
8
    templateDirectory="/org.eclipse.gmf.graphdef.editor/templates/"
8
  <gmfgen:GenEditorGenerator
9
    copyrightText=" Copyright (c) 2006, 2007 Borland Software Corporation and others.&#xD;&#xA; All rights reserved. This program and the accompanying materials&#xD;&#xA; are made available under the terms of the Eclipse Public License v1.0&#xD;&#xA; which accompanies this distribution, and is available at&#xD;&#xA; http://www.eclipse.org/legal/epl-v10.html&#xD;&#xA;&#xD;&#xA; Contributors:&#xD;&#xA;     Borland Software Corporation - initial API and implementation">
9
      packageNamePrefix="org.eclipse.gmf.graphdef.editor"
10
  <diagram
10
      modelID="GMFGraph"
11
      visualID="1000"
11
      dynamicTemplates="true"
12
      editPartClassName="CanvasEditPart"
12
      templateDirectory="/org.eclipse.gmf.graphdef.editor/templates/"
13
      itemSemanticEditPolicyClassName="CanvasItemSemanticEditPolicy"
13
      copyrightText=" Copyright (c) 2006, 2007 Borland Software Corporation and others.&#xD;&#xA; All rights reserved. This program and the accompanying materials&#xD;&#xA; are made available under the terms of the Eclipse Public License v1.0&#xD;&#xA; which accompanies this distribution, and is available at&#xD;&#xA; http://www.eclipse.org/legal/epl-v10.html&#xD;&#xA;&#xD;&#xA; Contributors:&#xD;&#xA;     Borland Software Corporation - initial API and implementation">
14
      notationViewFactoryClassName="CanvasViewFactory"
14
    <diagram
15
      canonicalEditPolicyClassName="CanvasCanonicalEditPolicy"
15
        visualID="1000"
16
      iconProviderPriority="Low"
16
        editPartClassName="CanvasEditPart"
17
      creationWizardCategoryID="org.eclipse.ui.Examples/org.eclipse.gmf.examples"
17
        itemSemanticEditPolicyClassName="CanvasItemSemanticEditPolicy"
18
      validationProviderPriority="Low">
18
        notationViewFactoryClassName="CanvasViewFactory"
19
    <diagramRunTimeClass
19
        canonicalEditPolicyClassName="CanvasCanonicalEditPolicy"
20
        href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/>
20
        iconProviderPriority="Low"
21
    <elementType
21
        creationWizardCategoryID="org.eclipse.ui.Examples/org.eclipse.gmf.examples"
22
        xsi:type="gmfgen:MetamodelType"
22
        validationProviderPriority="Low">
23
        editHelperClassName="CanvasEditHelper"/>
24
    <viewmap
25
        xsi:type="gmfgen:FigureViewmap"
26
        figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/>
27
    <containsShortcutsTo>gmfgen</containsShortcutsTo>
28
    <shortcutsProvidedFor>GMFGraph</shortcutsProvidedFor>
29
    <domainDiagramElement
30
        href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas"/>
31
    <childNodes
32
        visualID="3001"
33
        editPartClassName="RectangleEditPart"
34
        itemSemanticEditPolicyClassName="RectangleItemSemanticEditPolicy"
35
        notationViewFactoryClassName="RectangleViewFactory"
36
        canonicalEditPolicyClassName="RectangleCanonicalEditPolicy"
37
        childNodes="//@diagram/@childNodes.1 //@diagram/@childNodes.2 //@diagram/@childNodes.3 //@diagram/@childNodes.4"
38
        graphicalNodeEditPolicyClassName="RectangleGraphicalNodeEditPolicy"
39
        createCommandClassName="RectangleCreateCommand"
40
        containers="//@diagram/@compartments.3">
41
      <diagramRunTimeClass
23
      <diagramRunTimeClass
42
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
24
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/>
43
      <elementType
25
      <elementType
44
          xsi:type="gmfgen:MetamodelType"
26
          xsi:type="gmfgen:MetamodelType"
45
          editHelperClassName="RectangleEditHelper"/>
27
          editHelperClassName="CanvasEditHelper"/>
46
      <viewmap
47
          xsi:type="gmfgen:InnerClassViewmap"
48
          layoutType="XY_LAYOUT"
49
          className="RectangleFigure"
50
          classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class RectangleFigure extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public RectangleFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.XYLayout myGenLayoutManager = new org.eclipse.draw2d.XYLayout();&#xD;&#xA;&#x9;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setLayoutManager(myGenLayoutManager);&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
51
        <attributes
52
            xsi:type="gmfgen:DefaultSizeAttributes"
53
            width="0"
54
            height="0"/>
55
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
56
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
57
      </viewmap>
58
      <modelFacet>
59
        <metaClass
60
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Rectangle"/>
61
        <containmentMetaFeature
62
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
63
        <childMetaFeature
64
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
65
      </modelFacet>
66
    </childNodes>
67
    <childNodes
68
        visualID="3002"
69
        editPartClassName="Rectangle2EditPart"
70
        itemSemanticEditPolicyClassName="Rectangle2ItemSemanticEditPolicy"
71
        notationViewFactoryClassName="Rectangle2ViewFactory"
72
        canonicalEditPolicyClassName="Rectangle2CanonicalEditPolicy"
73
        childNodes="//@diagram/@childNodes.1 //@diagram/@childNodes.2 //@diagram/@childNodes.3 //@diagram/@childNodes.4"
74
        graphicalNodeEditPolicyClassName="Rectangle2GraphicalNodeEditPolicy"
75
        createCommandClassName="Rectangle2CreateCommand"
76
        containers="//@diagram/@childNodes.1 //@diagram/@childNodes.2 //@diagram/@childNodes.3 //@diagram/@childNodes.0 //@diagram/@childNodes.5 //@diagram/@childNodes.6">
77
      <diagramRunTimeClass
78
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
79
      <elementType
80
          xsi:type="gmfgen:SpecializationType"
81
          metamodelType="//@diagram/@childNodes.0/@elementType"
82
          editHelperAdviceClassName="RectangleEditHelperAdvice"/>
83
      <viewmap
84
          xsi:type="gmfgen:InnerClassViewmap"
85
          layoutType="XY_LAYOUT"
86
          className="RectangleFigure"
87
          classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class RectangleFigure extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public RectangleFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.XYLayout myGenLayoutManager = new org.eclipse.draw2d.XYLayout();&#xD;&#xA;&#x9;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setLayoutManager(myGenLayoutManager);&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
88
        <attributes
89
            xsi:type="gmfgen:DefaultSizeAttributes"
90
            width="0"
91
            height="0"/>
92
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
93
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
94
      </viewmap>
95
      <modelFacet>
96
        <metaClass
97
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Rectangle"/>
98
        <containmentMetaFeature
99
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
100
        <childMetaFeature
101
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
102
      </modelFacet>
103
    </childNodes>
104
    <childNodes
105
        visualID="3003"
106
        editPartClassName="EllipseEditPart"
107
        itemSemanticEditPolicyClassName="EllipseItemSemanticEditPolicy"
108
        notationViewFactoryClassName="EllipseViewFactory"
109
        canonicalEditPolicyClassName="EllipseCanonicalEditPolicy"
110
        childNodes="//@diagram/@childNodes.1 //@diagram/@childNodes.2 //@diagram/@childNodes.3 //@diagram/@childNodes.4"
111
        graphicalNodeEditPolicyClassName="EllipseGraphicalNodeEditPolicy"
112
        createCommandClassName="EllipseCreateCommand"
113
        containers="//@diagram/@childNodes.2 //@diagram/@childNodes.3 //@diagram/@childNodes.1 //@diagram/@childNodes.0 //@diagram/@childNodes.5 //@diagram/@childNodes.6">
114
      <diagramRunTimeClass
115
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
116
      <elementType
117
          xsi:type="gmfgen:MetamodelType"
118
          editHelperClassName="EllipseEditHelper"/>
119
      <viewmap
120
          xsi:type="gmfgen:InnerClassViewmap"
121
          layoutType="XY_LAYOUT"
122
          className="EllipseFigure"
123
          classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class EllipseFigure extends org.eclipse.draw2d.Ellipse {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public EllipseFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.XYLayout myGenLayoutManager = new org.eclipse.draw2d.XYLayout();&#xD;&#xA;&#x9;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setLayoutManager(myGenLayoutManager);&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
124
        <attributes
125
            xsi:type="gmfgen:DefaultSizeAttributes"
126
            width="0"
127
            height="0"/>
128
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
129
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
130
      </viewmap>
131
      <modelFacet>
132
        <metaClass
133
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Ellipse"/>
134
        <containmentMetaFeature
135
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
136
        <childMetaFeature
137
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
138
      </modelFacet>
139
    </childNodes>
140
    <childNodes
141
        visualID="3004"
142
        editPartClassName="RoundedRectangleEditPart"
143
        itemSemanticEditPolicyClassName="RoundedRectangleItemSemanticEditPolicy"
144
        notationViewFactoryClassName="RoundedRectangleViewFactory"
145
        canonicalEditPolicyClassName="RoundedRectangleCanonicalEditPolicy"
146
        childNodes="//@diagram/@childNodes.1 //@diagram/@childNodes.2 //@diagram/@childNodes.3 //@diagram/@childNodes.4"
147
        graphicalNodeEditPolicyClassName="RoundedRectangleGraphicalNodeEditPolicy"
148
        createCommandClassName="RoundedRectangleCreateCommand"
149
        containers="//@diagram/@childNodes.3 //@diagram/@childNodes.2 //@diagram/@childNodes.1 //@diagram/@childNodes.0 //@diagram/@childNodes.5 //@diagram/@childNodes.6">
150
      <diagramRunTimeClass
151
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
152
      <elementType
153
          xsi:type="gmfgen:MetamodelType"
154
          editHelperClassName="RoundedRectangleEditHelper"/>
155
      <viewmap
156
          xsi:type="gmfgen:InnerClassViewmap"
157
          layoutType="XY_LAYOUT"
158
          className="RoundedRectangleFigure"
159
          classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class RoundedRectangleFigure extends org.eclipse.draw2d.RoundedRectangle {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public RoundedRectangleFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.XYLayout myGenLayoutManager = new org.eclipse.draw2d.XYLayout();&#xD;&#xA;&#x9;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setLayoutManager(myGenLayoutManager);&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;this.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(8), getMapMode().DPtoLP(8)));&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
160
        <attributes
161
            xsi:type="gmfgen:DefaultSizeAttributes"
162
            width="0"
163
            height="0"/>
164
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
165
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
166
      </viewmap>
167
      <modelFacet>
168
        <metaClass
169
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/RoundedRectangle"/>
170
        <containmentMetaFeature
171
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
172
        <childMetaFeature
173
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
174
      </modelFacet>
175
    </childNodes>
176
    <childNodes
177
        visualID="3005"
178
        editPartClassName="PolylineEditPart"
179
        itemSemanticEditPolicyClassName="PolylineItemSemanticEditPolicy"
180
        notationViewFactoryClassName="PolylineViewFactory"
181
        canonicalEditPolicyClassName="PolylineCanonicalEditPolicy"
182
        graphicalNodeEditPolicyClassName="PolylineGraphicalNodeEditPolicy"
183
        createCommandClassName="PolylineCreateCommand"
184
        containers="//@diagram/@childNodes.3 //@diagram/@childNodes.2 //@diagram/@childNodes.1 //@diagram/@childNodes.0 //@diagram/@childNodes.5 //@diagram/@childNodes.6">
185
      <diagramRunTimeClass
186
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
187
      <elementType
188
          xsi:type="gmfgen:MetamodelType"
189
          editHelperClassName="PolylineEditHelper"/>
190
      <viewmap
28
      <viewmap
191
          xsi:type="gmfgen:FigureViewmap"
29
          xsi:type="gmfgen:FigureViewmap"
192
          figureQualifiedClassName="org.eclipse.draw2d.Polyline">
30
          figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/>
193
        <attributes
31
      <containsShortcutsTo>gmfgen</containsShortcutsTo>
194
            xsi:type="gmfgen:DefaultSizeAttributes"
32
      <shortcutsProvidedFor>GMFGraph</shortcutsProvidedFor>
195
            width="0"
33
      <domainDiagramElement
196
            height="0"/>
34
          href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas"/>
197
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
35
      <childNodes
198
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
36
          visualID="3001"
199
      </viewmap>
37
          editPartClassName="RectangleEditPart"
200
      <modelFacet>
38
          itemSemanticEditPolicyClassName="RectangleItemSemanticEditPolicy"
201
        <metaClass
39
          notationViewFactoryClassName="RectangleViewFactory"
202
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Polyline"/>
40
          canonicalEditPolicyClassName="RectangleCanonicalEditPolicy"
203
        <containmentMetaFeature
41
          childNodes="/0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4"
204
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
42
          graphicalNodeEditPolicyClassName="RectangleGraphicalNodeEditPolicy"
205
        <childMetaFeature
43
          createCommandClassName="RectangleCreateCommand"
206
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
44
          containers="/0/@diagram/@compartments.3">
207
      </modelFacet>
208
    </childNodes>
209
    <childNodes
210
        visualID="3006"
211
        editPartClassName="Ellipse2EditPart"
212
        itemSemanticEditPolicyClassName="Ellipse2ItemSemanticEditPolicy"
213
        notationViewFactoryClassName="Ellipse2ViewFactory"
214
        canonicalEditPolicyClassName="Ellipse2CanonicalEditPolicy"
215
        childNodes="//@diagram/@childNodes.1 //@diagram/@childNodes.2 //@diagram/@childNodes.3 //@diagram/@childNodes.4"
216
        graphicalNodeEditPolicyClassName="Ellipse2GraphicalNodeEditPolicy"
217
        createCommandClassName="Ellipse2CreateCommand"
218
        containers="//@diagram/@compartments.3">
219
      <diagramRunTimeClass
220
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
221
      <elementType
222
          xsi:type="gmfgen:SpecializationType"
223
          metamodelType="//@diagram/@childNodes.2/@elementType"
224
          editHelperAdviceClassName="EllipseEditHelperAdvice"/>
225
      <viewmap
226
          xsi:type="gmfgen:InnerClassViewmap"
227
          layoutType="XY_LAYOUT"
228
          className="EllipseFigure"
229
          classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class EllipseFigure extends org.eclipse.draw2d.Ellipse {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public EllipseFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.XYLayout myGenLayoutManager = new org.eclipse.draw2d.XYLayout();&#xD;&#xA;&#x9;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setLayoutManager(myGenLayoutManager);&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
230
        <attributes
231
            xsi:type="gmfgen:DefaultSizeAttributes"
232
            width="0"
233
            height="0"/>
234
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
235
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
236
      </viewmap>
237
      <modelFacet>
238
        <metaClass
239
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Ellipse"/>
240
        <containmentMetaFeature
241
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
242
        <childMetaFeature
243
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
244
      </modelFacet>
245
    </childNodes>
246
    <childNodes
247
        visualID="3007"
248
        editPartClassName="RoundedRectangle2EditPart"
249
        itemSemanticEditPolicyClassName="RoundedRectangle2ItemSemanticEditPolicy"
250
        notationViewFactoryClassName="RoundedRectangle2ViewFactory"
251
        canonicalEditPolicyClassName="RoundedRectangle2CanonicalEditPolicy"
252
        childNodes="//@diagram/@childNodes.1 //@diagram/@childNodes.2 //@diagram/@childNodes.3 //@diagram/@childNodes.4"
253
        graphicalNodeEditPolicyClassName="RoundedRectangle2GraphicalNodeEditPolicy"
254
        createCommandClassName="RoundedRectangle2CreateCommand"
255
        containers="//@diagram/@compartments.3">
256
      <diagramRunTimeClass
257
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
258
      <elementType
259
          xsi:type="gmfgen:SpecializationType"
260
          metamodelType="//@diagram/@childNodes.3/@elementType"
261
          editHelperAdviceClassName="RoundedRectangleEditHelperAdvice"/>
262
      <viewmap
263
          xsi:type="gmfgen:InnerClassViewmap"
264
          layoutType="XY_LAYOUT"
265
          className="RoundedRectangleFigure"
266
          classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class RoundedRectangleFigure extends org.eclipse.draw2d.RoundedRectangle {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public RoundedRectangleFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.XYLayout myGenLayoutManager = new org.eclipse.draw2d.XYLayout();&#xD;&#xA;&#x9;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setLayoutManager(myGenLayoutManager);&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;this.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(8), getMapMode().DPtoLP(8)));&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
267
        <attributes
268
            xsi:type="gmfgen:DefaultSizeAttributes"
269
            width="0"
270
            height="0"/>
271
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
272
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
273
      </viewmap>
274
      <modelFacet>
275
        <metaClass
276
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/RoundedRectangle"/>
277
        <containmentMetaFeature
278
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
279
        <childMetaFeature
280
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
281
      </modelFacet>
282
    </childNodes>
283
    <childNodes
284
        visualID="3008"
285
        editPartClassName="Polyline2EditPart"
286
        itemSemanticEditPolicyClassName="Polyline2ItemSemanticEditPolicy"
287
        notationViewFactoryClassName="Polyline2ViewFactory"
288
        canonicalEditPolicyClassName="Polyline2CanonicalEditPolicy"
289
        graphicalNodeEditPolicyClassName="Polyline2GraphicalNodeEditPolicy"
290
        createCommandClassName="Polyline2CreateCommand"
291
        containers="//@diagram/@compartments.3">
292
      <diagramRunTimeClass
293
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
294
      <elementType
295
          xsi:type="gmfgen:SpecializationType"
296
          metamodelType="//@diagram/@childNodes.4/@elementType"
297
          editHelperAdviceClassName="PolylineEditHelperAdvice"/>
298
      <viewmap
299
          xsi:type="gmfgen:FigureViewmap"
300
          figureQualifiedClassName="org.eclipse.draw2d.Polyline">
301
        <attributes
302
            xsi:type="gmfgen:DefaultSizeAttributes"
303
            width="0"
304
            height="0"/>
305
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
306
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
307
      </viewmap>
308
      <modelFacet>
309
        <metaClass
310
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Polyline"/>
311
        <containmentMetaFeature
312
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
313
        <childMetaFeature
314
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
315
      </modelFacet>
316
    </childNodes>
317
    <topLevelNodes
318
        visualID="2001"
319
        editPartClassName="CompartmentEditPart"
320
        itemSemanticEditPolicyClassName="CompartmentItemSemanticEditPolicy"
321
        notationViewFactoryClassName="CompartmentViewFactory"
322
        canonicalEditPolicyClassName="CompartmentCanonicalEditPolicy"
323
        compartments="//@diagram/@compartments.0"
324
        graphicalNodeEditPolicyClassName="CompartmentGraphicalNodeEditPolicy"
325
        createCommandClassName="CompartmentCreateCommand">
326
      <diagramRunTimeClass
327
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
328
      <elementType
329
          xsi:type="gmfgen:MetamodelType"
330
          editHelperClassName="CompartmentEditHelper"/>
331
      <viewmap
332
          xsi:type="gmfgen:InnerClassViewmap"
333
          className="DiagramElementFigure"
334
          classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class DiagramElementFigure extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public DiagramElementFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;&#x9;org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig_0 = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;setFigureDiagramElementFigure_NameLabel(fig_0);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;Object layData0 = null;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;this.add(fig_0, layData0);&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fDiagramElementFigure_NameLabel; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel getFigureDiagramElementFigure_NameLabel() {&#xD;&#xA;&#x9;&#x9;return fDiagramElementFigure_NameLabel;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void setFigureDiagramElementFigure_NameLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig){&#xD;&#xA;&#x9;&#x9;fDiagramElementFigure_NameLabel = fig;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
335
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
336
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
337
      </viewmap>
338
      <modelFacet>
339
        <metaClass
340
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Compartment"/>
341
        <containmentMetaFeature
342
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/compartments"/>
343
        <childMetaFeature
344
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/compartments"/>
345
      </modelFacet>
346
      <labels
347
          visualID="5001"
348
          editPartClassName="CompartmentNameEditPart"
349
          itemSemanticEditPolicyClassName="CompartmentNameItemSemanticEditPolicy"
350
          notationViewFactoryClassName="CompartmentNameViewFactory"
351
          elementIcon="true">
352
        <diagramRunTimeClass
45
        <diagramRunTimeClass
353
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
46
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
47
        <elementType
48
            xsi:type="gmfgen:MetamodelType"
49
            editHelperClassName="RectangleEditHelper"/>
354
        <viewmap
50
        <viewmap
355
            xsi:type="gmfgen:ParentAssignedViewmap"
51
            xsi:type="gmfgen:InnerClassViewmap"
356
            getterName="getFigureDiagramElementFigure_NameLabel"
52
            layoutType="XY_LAYOUT"
357
            figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel"/>
53
            className="RectangleFigure"
358
        <modelFacet
54
            classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class RectangleFigure extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public RectangleFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.XYLayout myGenLayoutManager = new org.eclipse.draw2d.XYLayout();&#xD;&#xA;&#x9;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setLayoutManager(myGenLayoutManager);&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
359
            xsi:type="gmfgen:FeatureLabelModelFacet">
55
          <attributes
360
          <metaFeatures
56
              xsi:type="gmfgen:DefaultSizeAttributes"
361
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Identity/name"/>
57
              width="0"
362
        </modelFacet>
58
              height="0"/>
363
      </labels>
59
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
364
    </topLevelNodes>
60
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
365
    <topLevelNodes
61
        </viewmap>
366
        visualID="2002"
62
        <modelFacet>
367
        editPartClassName="NodeEditPart"
63
          <metaClass
368
        itemSemanticEditPolicyClassName="NodeItemSemanticEditPolicy"
64
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Rectangle"/>
369
        notationViewFactoryClassName="NodeViewFactory"
65
          <containmentMetaFeature
370
        canonicalEditPolicyClassName="NodeCanonicalEditPolicy"
66
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
371
        compartments="//@diagram/@compartments.1"
67
          <childMetaFeature
372
        graphicalNodeEditPolicyClassName="NodeGraphicalNodeEditPolicy"
68
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
373
        createCommandClassName="NodeCreateCommand">
69
        </modelFacet>
374
      <diagramRunTimeClass
70
      </childNodes>
375
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
71
      <childNodes
376
      <elementType
72
          visualID="3002"
377
          xsi:type="gmfgen:MetamodelType"
73
          editPartClassName="Rectangle2EditPart"
378
          editHelperClassName="NodeEditHelper"/>
74
          itemSemanticEditPolicyClassName="Rectangle2ItemSemanticEditPolicy"
379
      <viewmap
75
          notationViewFactoryClassName="Rectangle2ViewFactory"
380
          xsi:type="gmfgen:InnerClassViewmap"
76
          canonicalEditPolicyClassName="Rectangle2CanonicalEditPolicy"
381
          className="DiagramElementFigure"
77
          childNodes="/0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4"
382
          classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class DiagramElementFigure extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public DiagramElementFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;&#x9;org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig_0 = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;setFigureDiagramElementFigure_NameLabel(fig_0);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;Object layData0 = null;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;this.add(fig_0, layData0);&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fDiagramElementFigure_NameLabel; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel getFigureDiagramElementFigure_NameLabel() {&#xD;&#xA;&#x9;&#x9;return fDiagramElementFigure_NameLabel;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void setFigureDiagramElementFigure_NameLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig){&#xD;&#xA;&#x9;&#x9;fDiagramElementFigure_NameLabel = fig;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
78
          graphicalNodeEditPolicyClassName="Rectangle2GraphicalNodeEditPolicy"
383
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
79
          createCommandClassName="Rectangle2CreateCommand"
384
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
80
          containers="/0/@diagram/@childNodes.0 /0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.5 /0/@diagram/@childNodes.6">
385
      </viewmap>
386
      <modelFacet>
387
        <metaClass
388
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Node"/>
389
        <containmentMetaFeature
390
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/nodes"/>
391
        <childMetaFeature
392
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/nodes"/>
393
      </modelFacet>
394
      <labels
395
          visualID="5002"
396
          editPartClassName="NodeNameEditPart"
397
          itemSemanticEditPolicyClassName="NodeNameItemSemanticEditPolicy"
398
          notationViewFactoryClassName="NodeNameViewFactory"
399
          elementIcon="true">
400
        <diagramRunTimeClass
81
        <diagramRunTimeClass
401
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
82
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
83
        <elementType
84
            xsi:type="gmfgen:SpecializationType"
85
            metamodelType="/0/@diagram/@childNodes.0/@elementType"
86
            editHelperAdviceClassName="RectangleEditHelperAdvice"/>
402
        <viewmap
87
        <viewmap
403
            xsi:type="gmfgen:ParentAssignedViewmap"
88
            xsi:type="gmfgen:InnerClassViewmap"
404
            getterName="getFigureDiagramElementFigure_NameLabel"
89
            layoutType="XY_LAYOUT"
405
            figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel"/>
90
            className="RectangleFigure"
406
        <modelFacet
91
            classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class RectangleFigure extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public RectangleFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.XYLayout myGenLayoutManager = new org.eclipse.draw2d.XYLayout();&#xD;&#xA;&#x9;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setLayoutManager(myGenLayoutManager);&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
407
            xsi:type="gmfgen:FeatureLabelModelFacet">
92
          <attributes
408
          <metaFeatures
93
              xsi:type="gmfgen:DefaultSizeAttributes"
409
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Identity/name"/>
94
              width="0"
410
        </modelFacet>
95
              height="0"/>
411
      </labels>
96
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
412
    </topLevelNodes>
97
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
413
    <topLevelNodes
98
        </viewmap>
414
        visualID="2003"
99
        <modelFacet>
415
        editPartClassName="ConnectionEditPart"
100
          <metaClass
416
        itemSemanticEditPolicyClassName="ConnectionItemSemanticEditPolicy"
101
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Rectangle"/>
417
        notationViewFactoryClassName="ConnectionViewFactory"
102
          <containmentMetaFeature
418
        canonicalEditPolicyClassName="ConnectionCanonicalEditPolicy"
103
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
419
        compartments="//@diagram/@compartments.2"
104
          <childMetaFeature
420
        graphicalNodeEditPolicyClassName="ConnectionGraphicalNodeEditPolicy"
105
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
421
        createCommandClassName="ConnectionCreateCommand">
106
        </modelFacet>
422
      <diagramRunTimeClass
107
      </childNodes>
423
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
108
      <childNodes
424
      <elementType
109
          visualID="3003"
425
          xsi:type="gmfgen:MetamodelType"
110
          editPartClassName="EllipseEditPart"
426
          editHelperClassName="ConnectionEditHelper"/>
111
          itemSemanticEditPolicyClassName="EllipseItemSemanticEditPolicy"
427
      <viewmap
112
          notationViewFactoryClassName="EllipseViewFactory"
428
          xsi:type="gmfgen:InnerClassViewmap"
113
          canonicalEditPolicyClassName="EllipseCanonicalEditPolicy"
429
          className="DiagramElementFigure"
114
          childNodes="/0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4"
430
          classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class DiagramElementFigure extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public DiagramElementFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;&#x9;org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig_0 = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;setFigureDiagramElementFigure_NameLabel(fig_0);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;Object layData0 = null;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;this.add(fig_0, layData0);&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fDiagramElementFigure_NameLabel; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel getFigureDiagramElementFigure_NameLabel() {&#xD;&#xA;&#x9;&#x9;return fDiagramElementFigure_NameLabel;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void setFigureDiagramElementFigure_NameLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig){&#xD;&#xA;&#x9;&#x9;fDiagramElementFigure_NameLabel = fig;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
115
          graphicalNodeEditPolicyClassName="EllipseGraphicalNodeEditPolicy"
431
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
116
          createCommandClassName="EllipseCreateCommand"
432
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
117
          containers="/0/@diagram/@childNodes.0 /0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.5 /0/@diagram/@childNodes.6">
433
      </viewmap>
434
      <modelFacet>
435
        <metaClass
436
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Connection"/>
437
        <containmentMetaFeature
438
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/connections"/>
439
        <childMetaFeature
440
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/connections"/>
441
      </modelFacet>
442
      <labels
443
          visualID="5003"
444
          editPartClassName="ConnectionNameEditPart"
445
          itemSemanticEditPolicyClassName="ConnectionNameItemSemanticEditPolicy"
446
          notationViewFactoryClassName="ConnectionNameViewFactory"
447
          elementIcon="true">
448
        <diagramRunTimeClass
118
        <diagramRunTimeClass
449
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
119
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
120
        <elementType
121
            xsi:type="gmfgen:MetamodelType"
122
            editHelperClassName="EllipseEditHelper"/>
450
        <viewmap
123
        <viewmap
451
            xsi:type="gmfgen:ParentAssignedViewmap"
124
            xsi:type="gmfgen:InnerClassViewmap"
452
            getterName="getFigureDiagramElementFigure_NameLabel"
125
            layoutType="XY_LAYOUT"
453
            figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel"/>
126
            className="EllipseFigure"
454
        <modelFacet
127
            classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class EllipseFigure extends org.eclipse.draw2d.Ellipse {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public EllipseFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.XYLayout myGenLayoutManager = new org.eclipse.draw2d.XYLayout();&#xD;&#xA;&#x9;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setLayoutManager(myGenLayoutManager);&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
455
            xsi:type="gmfgen:FeatureLabelModelFacet">
128
          <attributes
456
          <metaFeatures
129
              xsi:type="gmfgen:DefaultSizeAttributes"
457
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Identity/name"/>
130
              width="0"
458
        </modelFacet>
131
              height="0"/>
459
      </labels>
132
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
460
    </topLevelNodes>
133
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
461
    <topLevelNodes
134
        </viewmap>
462
        visualID="2004"
135
        <modelFacet>
463
        editPartClassName="FigureGalleryEditPart"
136
          <metaClass
464
        itemSemanticEditPolicyClassName="FigureGalleryItemSemanticEditPolicy"
137
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Ellipse"/>
465
        notationViewFactoryClassName="FigureGalleryViewFactory"
138
          <containmentMetaFeature
466
        canonicalEditPolicyClassName="FigureGalleryCanonicalEditPolicy"
139
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
467
        compartments="//@diagram/@compartments.3"
140
          <childMetaFeature
468
        graphicalNodeEditPolicyClassName="FigureGalleryGraphicalNodeEditPolicy"
141
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
469
        createCommandClassName="FigureGalleryCreateCommand">
142
        </modelFacet>
470
      <diagramRunTimeClass
143
      </childNodes>
471
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
144
      <childNodes
472
      <elementType
145
          visualID="3004"
473
          xsi:type="gmfgen:MetamodelType"
146
          editPartClassName="RoundedRectangleEditPart"
474
          editHelperClassName="FigureGalleryEditHelper"/>
147
          itemSemanticEditPolicyClassName="RoundedRectangleItemSemanticEditPolicy"
475
      <viewmap
148
          notationViewFactoryClassName="RoundedRectangleViewFactory"
476
          xsi:type="gmfgen:InnerClassViewmap"
149
          canonicalEditPolicyClassName="RoundedRectangleCanonicalEditPolicy"
477
          className="FigureGalleryFigure"
150
          childNodes="/0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4"
478
          classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class FigureGalleryFigure extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public FigureGalleryFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;&#x9;org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig_0 = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;setFigureFigureGalleryFigure_NameLabel(fig_0);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;Object layData0 = null;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;this.add(fig_0, layData0);&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fFigureGalleryFigure_NameLabel; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel getFigureFigureGalleryFigure_NameLabel() {&#xD;&#xA;&#x9;&#x9;return fFigureGalleryFigure_NameLabel;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void setFigureFigureGalleryFigure_NameLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig){&#xD;&#xA;&#x9;&#x9;fFigureGalleryFigure_NameLabel = fig;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
151
          graphicalNodeEditPolicyClassName="RoundedRectangleGraphicalNodeEditPolicy"
479
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
152
          createCommandClassName="RoundedRectangleCreateCommand"
480
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
153
          containers="/0/@diagram/@childNodes.0 /0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.5 /0/@diagram/@childNodes.6">
481
      </viewmap>
154
        <diagramRunTimeClass
482
      <modelFacet>
155
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
483
        <metaClass
156
        <elementType
484
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery"/>
157
            xsi:type="gmfgen:MetamodelType"
485
        <containmentMetaFeature
158
            editHelperClassName="RoundedRectangleEditHelper"/>
486
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/figures"/>
159
        <viewmap
487
        <childMetaFeature
160
            xsi:type="gmfgen:InnerClassViewmap"
488
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/figures"/>
161
            layoutType="XY_LAYOUT"
489
      </modelFacet>
162
            className="RoundedRectangleFigure"
490
      <labels
163
            classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class RoundedRectangleFigure extends org.eclipse.draw2d.RoundedRectangle {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public RoundedRectangleFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.XYLayout myGenLayoutManager = new org.eclipse.draw2d.XYLayout();&#xD;&#xA;&#x9;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setLayoutManager(myGenLayoutManager);&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;this.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(8), getMapMode().DPtoLP(8)));&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
491
          visualID="5004"
164
          <attributes
492
          editPartClassName="FigureGalleryNameEditPart"
165
              xsi:type="gmfgen:DefaultSizeAttributes"
493
          itemSemanticEditPolicyClassName="FigureGalleryNameItemSemanticEditPolicy"
166
              width="0"
494
          notationViewFactoryClassName="FigureGalleryNameViewFactory"
167
              height="0"/>
495
          elementIcon="true">
168
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
169
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
170
        </viewmap>
171
        <modelFacet>
172
          <metaClass
173
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/RoundedRectangle"/>
174
          <containmentMetaFeature
175
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
176
          <childMetaFeature
177
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
178
        </modelFacet>
179
      </childNodes>
180
      <childNodes
181
          visualID="3005"
182
          editPartClassName="PolylineEditPart"
183
          itemSemanticEditPolicyClassName="PolylineItemSemanticEditPolicy"
184
          notationViewFactoryClassName="PolylineViewFactory"
185
          canonicalEditPolicyClassName="PolylineCanonicalEditPolicy"
186
          graphicalNodeEditPolicyClassName="PolylineGraphicalNodeEditPolicy"
187
          createCommandClassName="PolylineCreateCommand"
188
          containers="/0/@diagram/@childNodes.0 /0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.5 /0/@diagram/@childNodes.6">
496
        <diagramRunTimeClass
189
        <diagramRunTimeClass
497
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
190
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
191
        <elementType
192
            xsi:type="gmfgen:MetamodelType"
193
            editHelperClassName="PolylineEditHelper"/>
498
        <viewmap
194
        <viewmap
499
            xsi:type="gmfgen:ParentAssignedViewmap"
195
            xsi:type="gmfgen:FigureViewmap"
500
            getterName="getFigureFigureGalleryFigure_NameLabel"
196
            figureQualifiedClassName="org.eclipse.draw2d.Polyline">
501
            figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel"/>
197
          <attributes
198
              xsi:type="gmfgen:DefaultSizeAttributes"
199
              width="0"
200
              height="0"/>
201
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
202
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
203
        </viewmap>
204
        <modelFacet>
205
          <metaClass
206
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Polyline"/>
207
          <containmentMetaFeature
208
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
209
          <childMetaFeature
210
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Figure/children"/>
211
        </modelFacet>
212
      </childNodes>
213
      <childNodes
214
          visualID="3006"
215
          editPartClassName="Ellipse2EditPart"
216
          itemSemanticEditPolicyClassName="Ellipse2ItemSemanticEditPolicy"
217
          notationViewFactoryClassName="Ellipse2ViewFactory"
218
          canonicalEditPolicyClassName="Ellipse2CanonicalEditPolicy"
219
          childNodes="/0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4"
220
          graphicalNodeEditPolicyClassName="Ellipse2GraphicalNodeEditPolicy"
221
          createCommandClassName="Ellipse2CreateCommand"
222
          containers="/0/@diagram/@compartments.3">
223
        <diagramRunTimeClass
224
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
225
        <elementType
226
            xsi:type="gmfgen:SpecializationType"
227
            metamodelType="/0/@diagram/@childNodes.2/@elementType"
228
            editHelperAdviceClassName="EllipseEditHelperAdvice"/>
229
        <viewmap
230
            xsi:type="gmfgen:InnerClassViewmap"
231
            layoutType="XY_LAYOUT"
232
            className="EllipseFigure"
233
            classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class EllipseFigure extends org.eclipse.draw2d.Ellipse {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public EllipseFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.XYLayout myGenLayoutManager = new org.eclipse.draw2d.XYLayout();&#xD;&#xA;&#x9;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setLayoutManager(myGenLayoutManager);&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
234
          <attributes
235
              xsi:type="gmfgen:DefaultSizeAttributes"
236
              width="0"
237
              height="0"/>
238
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
239
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
240
        </viewmap>
241
        <modelFacet>
242
          <metaClass
243
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Ellipse"/>
244
          <containmentMetaFeature
245
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
246
          <childMetaFeature
247
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
248
        </modelFacet>
249
      </childNodes>
250
      <childNodes
251
          visualID="3007"
252
          editPartClassName="RoundedRectangle2EditPart"
253
          itemSemanticEditPolicyClassName="RoundedRectangle2ItemSemanticEditPolicy"
254
          notationViewFactoryClassName="RoundedRectangle2ViewFactory"
255
          canonicalEditPolicyClassName="RoundedRectangle2CanonicalEditPolicy"
256
          childNodes="/0/@diagram/@childNodes.1 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4"
257
          graphicalNodeEditPolicyClassName="RoundedRectangle2GraphicalNodeEditPolicy"
258
          createCommandClassName="RoundedRectangle2CreateCommand"
259
          containers="/0/@diagram/@compartments.3">
260
        <diagramRunTimeClass
261
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
262
        <elementType
263
            xsi:type="gmfgen:SpecializationType"
264
            metamodelType="/0/@diagram/@childNodes.3/@elementType"
265
            editHelperAdviceClassName="RoundedRectangleEditHelperAdvice"/>
266
        <viewmap
267
            xsi:type="gmfgen:InnerClassViewmap"
268
            layoutType="XY_LAYOUT"
269
            className="RoundedRectangleFigure"
270
            classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class RoundedRectangleFigure extends org.eclipse.draw2d.RoundedRectangle {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public RoundedRectangleFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.XYLayout myGenLayoutManager = new org.eclipse.draw2d.XYLayout();&#xD;&#xA;&#x9;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setLayoutManager(myGenLayoutManager);&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;this.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(8), getMapMode().DPtoLP(8)));&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
271
          <attributes
272
              xsi:type="gmfgen:DefaultSizeAttributes"
273
              width="0"
274
              height="0"/>
275
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
276
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
277
        </viewmap>
278
        <modelFacet>
279
          <metaClass
280
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/RoundedRectangle"/>
281
          <containmentMetaFeature
282
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
283
          <childMetaFeature
284
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
285
        </modelFacet>
286
      </childNodes>
287
      <childNodes
288
          visualID="3008"
289
          editPartClassName="Polyline2EditPart"
290
          itemSemanticEditPolicyClassName="Polyline2ItemSemanticEditPolicy"
291
          notationViewFactoryClassName="Polyline2ViewFactory"
292
          canonicalEditPolicyClassName="Polyline2CanonicalEditPolicy"
293
          graphicalNodeEditPolicyClassName="Polyline2GraphicalNodeEditPolicy"
294
          createCommandClassName="Polyline2CreateCommand"
295
          containers="/0/@diagram/@compartments.3">
296
        <diagramRunTimeClass
297
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
298
        <elementType
299
            xsi:type="gmfgen:SpecializationType"
300
            metamodelType="/0/@diagram/@childNodes.4/@elementType"
301
            editHelperAdviceClassName="PolylineEditHelperAdvice"/>
302
        <viewmap
303
            xsi:type="gmfgen:FigureViewmap"
304
            figureQualifiedClassName="org.eclipse.draw2d.Polyline">
305
          <attributes
306
              xsi:type="gmfgen:DefaultSizeAttributes"
307
              width="0"
308
              height="0"/>
309
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
310
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
311
        </viewmap>
312
        <modelFacet>
313
          <metaClass
314
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Polyline"/>
315
          <containmentMetaFeature
316
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
317
          <childMetaFeature
318
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery/figures"/>
319
        </modelFacet>
320
      </childNodes>
321
      <topLevelNodes
322
          visualID="2001"
323
          editPartClassName="CompartmentEditPart"
324
          itemSemanticEditPolicyClassName="CompartmentItemSemanticEditPolicy"
325
          notationViewFactoryClassName="CompartmentViewFactory"
326
          canonicalEditPolicyClassName="CompartmentCanonicalEditPolicy"
327
          compartments="/0/@diagram/@compartments.0"
328
          graphicalNodeEditPolicyClassName="CompartmentGraphicalNodeEditPolicy"
329
          createCommandClassName="CompartmentCreateCommand">
330
        <diagramRunTimeClass
331
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
332
        <elementType
333
            xsi:type="gmfgen:MetamodelType"
334
            editHelperClassName="CompartmentEditHelper"/>
335
        <viewmap
336
            xsi:type="gmfgen:InnerClassViewmap"
337
            className="DiagramElementFigure"
338
            classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class DiagramElementFigure extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public DiagramElementFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;&#x9;org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig_0 = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;setFigureDiagramElementFigure_NameLabel(fig_0);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;Object layData0 = null;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;this.add(fig_0, layData0);&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fDiagramElementFigure_NameLabel; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel getFigureDiagramElementFigure_NameLabel() {&#xD;&#xA;&#x9;&#x9;return fDiagramElementFigure_NameLabel;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void setFigureDiagramElementFigure_NameLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig){&#xD;&#xA;&#x9;&#x9;fDiagramElementFigure_NameLabel = fig;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
339
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
340
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
341
        </viewmap>
342
        <modelFacet>
343
          <metaClass
344
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Compartment"/>
345
          <containmentMetaFeature
346
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/compartments"/>
347
          <childMetaFeature
348
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/compartments"/>
349
        </modelFacet>
350
        <labels
351
            visualID="5001"
352
            editPartClassName="CompartmentNameEditPart"
353
            itemSemanticEditPolicyClassName="CompartmentNameItemSemanticEditPolicy"
354
            notationViewFactoryClassName="CompartmentNameViewFactory"
355
            elementIcon="true">
356
          <diagramRunTimeClass
357
              href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
358
          <viewmap
359
              xsi:type="gmfgen:ParentAssignedViewmap"
360
              getterName="getFigureDiagramElementFigure_NameLabel"
361
              figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel"/>
362
          <modelFacet
363
              xsi:type="gmfgen:FeatureLabelModelFacet">
364
            <metaFeatures
365
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Identity/name"/>
366
          </modelFacet>
367
        </labels>
368
      </topLevelNodes>
369
      <topLevelNodes
370
          visualID="2002"
371
          editPartClassName="NodeEditPart"
372
          itemSemanticEditPolicyClassName="NodeItemSemanticEditPolicy"
373
          notationViewFactoryClassName="NodeViewFactory"
374
          canonicalEditPolicyClassName="NodeCanonicalEditPolicy"
375
          compartments="/0/@diagram/@compartments.1"
376
          graphicalNodeEditPolicyClassName="NodeGraphicalNodeEditPolicy"
377
          createCommandClassName="NodeCreateCommand">
378
        <diagramRunTimeClass
379
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
380
        <elementType
381
            xsi:type="gmfgen:MetamodelType"
382
            editHelperClassName="NodeEditHelper"/>
383
        <viewmap
384
            xsi:type="gmfgen:InnerClassViewmap"
385
            className="DiagramElementFigure"
386
            classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class DiagramElementFigure extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public DiagramElementFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;&#x9;org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig_0 = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;setFigureDiagramElementFigure_NameLabel(fig_0);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;Object layData0 = null;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;this.add(fig_0, layData0);&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fDiagramElementFigure_NameLabel; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel getFigureDiagramElementFigure_NameLabel() {&#xD;&#xA;&#x9;&#x9;return fDiagramElementFigure_NameLabel;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void setFigureDiagramElementFigure_NameLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig){&#xD;&#xA;&#x9;&#x9;fDiagramElementFigure_NameLabel = fig;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
387
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
388
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
389
        </viewmap>
390
        <modelFacet>
391
          <metaClass
392
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Node"/>
393
          <containmentMetaFeature
394
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/nodes"/>
395
          <childMetaFeature
396
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/nodes"/>
397
        </modelFacet>
398
        <labels
399
            visualID="5002"
400
            editPartClassName="NodeNameEditPart"
401
            itemSemanticEditPolicyClassName="NodeNameItemSemanticEditPolicy"
402
            notationViewFactoryClassName="NodeNameViewFactory"
403
            elementIcon="true">
404
          <diagramRunTimeClass
405
              href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
406
          <viewmap
407
              xsi:type="gmfgen:ParentAssignedViewmap"
408
              getterName="getFigureDiagramElementFigure_NameLabel"
409
              figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel"/>
410
          <modelFacet
411
              xsi:type="gmfgen:FeatureLabelModelFacet">
412
            <metaFeatures
413
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Identity/name"/>
414
          </modelFacet>
415
        </labels>
416
      </topLevelNodes>
417
      <topLevelNodes
418
          visualID="2003"
419
          editPartClassName="ConnectionEditPart"
420
          itemSemanticEditPolicyClassName="ConnectionItemSemanticEditPolicy"
421
          notationViewFactoryClassName="ConnectionViewFactory"
422
          canonicalEditPolicyClassName="ConnectionCanonicalEditPolicy"
423
          compartments="/0/@diagram/@compartments.2"
424
          graphicalNodeEditPolicyClassName="ConnectionGraphicalNodeEditPolicy"
425
          createCommandClassName="ConnectionCreateCommand">
426
        <diagramRunTimeClass
427
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
428
        <elementType
429
            xsi:type="gmfgen:MetamodelType"
430
            editHelperClassName="ConnectionEditHelper"/>
431
        <viewmap
432
            xsi:type="gmfgen:InnerClassViewmap"
433
            className="DiagramElementFigure"
434
            classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class DiagramElementFigure extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public DiagramElementFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;&#x9;org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig_0 = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;setFigureDiagramElementFigure_NameLabel(fig_0);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;Object layData0 = null;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;this.add(fig_0, layData0);&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fDiagramElementFigure_NameLabel; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel getFigureDiagramElementFigure_NameLabel() {&#xD;&#xA;&#x9;&#x9;return fDiagramElementFigure_NameLabel;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void setFigureDiagramElementFigure_NameLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig){&#xD;&#xA;&#x9;&#x9;fDiagramElementFigure_NameLabel = fig;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
435
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
436
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
437
        </viewmap>
438
        <modelFacet>
439
          <metaClass
440
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Connection"/>
441
          <containmentMetaFeature
442
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/connections"/>
443
          <childMetaFeature
444
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/connections"/>
445
        </modelFacet>
446
        <labels
447
            visualID="5003"
448
            editPartClassName="ConnectionNameEditPart"
449
            itemSemanticEditPolicyClassName="ConnectionNameItemSemanticEditPolicy"
450
            notationViewFactoryClassName="ConnectionNameViewFactory"
451
            elementIcon="true">
452
          <diagramRunTimeClass
453
              href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
454
          <viewmap
455
              xsi:type="gmfgen:ParentAssignedViewmap"
456
              getterName="getFigureDiagramElementFigure_NameLabel"
457
              figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel"/>
458
          <modelFacet
459
              xsi:type="gmfgen:FeatureLabelModelFacet">
460
            <metaFeatures
461
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Identity/name"/>
462
          </modelFacet>
463
        </labels>
464
      </topLevelNodes>
465
      <topLevelNodes
466
          visualID="2004"
467
          editPartClassName="FigureGalleryEditPart"
468
          itemSemanticEditPolicyClassName="FigureGalleryItemSemanticEditPolicy"
469
          notationViewFactoryClassName="FigureGalleryViewFactory"
470
          canonicalEditPolicyClassName="FigureGalleryCanonicalEditPolicy"
471
          compartments="/0/@diagram/@compartments.3"
472
          graphicalNodeEditPolicyClassName="FigureGalleryGraphicalNodeEditPolicy"
473
          createCommandClassName="FigureGalleryCreateCommand">
474
        <diagramRunTimeClass
475
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
476
        <elementType
477
            xsi:type="gmfgen:MetamodelType"
478
            editHelperClassName="FigureGalleryEditHelper"/>
479
        <viewmap
480
            xsi:type="gmfgen:InnerClassViewmap"
481
            className="FigureGalleryFigure"
482
            classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class FigureGalleryFigure extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public FigureGalleryFigure() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#x9;&#x9;org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig_0 = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;setFigureFigureGalleryFigure_NameLabel(fig_0);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;Object layData0 = null;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;this.add(fig_0, layData0);&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fFigureGalleryFigure_NameLabel; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel getFigureFigureGalleryFigure_NameLabel() {&#xD;&#xA;&#x9;&#x9;return fFigureGalleryFigure_NameLabel;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void setFigureFigureGalleryFigure_NameLabel(org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig){&#xD;&#xA;&#x9;&#x9;fFigureGalleryFigure_NameLabel = fig;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
483
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
484
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
485
        </viewmap>
486
        <modelFacet>
487
          <metaClass
488
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FigureGallery"/>
489
          <containmentMetaFeature
490
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/figures"/>
491
          <childMetaFeature
492
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Canvas/figures"/>
493
        </modelFacet>
494
        <labels
495
            visualID="5004"
496
            editPartClassName="FigureGalleryNameEditPart"
497
            itemSemanticEditPolicyClassName="FigureGalleryNameItemSemanticEditPolicy"
498
            notationViewFactoryClassName="FigureGalleryNameViewFactory"
499
            elementIcon="true">
500
          <diagramRunTimeClass
501
              href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
502
          <viewmap
503
              xsi:type="gmfgen:ParentAssignedViewmap"
504
              getterName="getFigureFigureGalleryFigure_NameLabel"
505
              figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel"/>
506
          <modelFacet
507
              xsi:type="gmfgen:FeatureLabelModelFacet">
508
            <metaFeatures
509
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Identity/name"/>
510
          </modelFacet>
511
        </labels>
512
      </topLevelNodes>
513
      <links
514
          visualID="4001"
515
          editPartClassName="DiagramElementFigureEditPart"
516
          itemSemanticEditPolicyClassName="DiagramElementFigureItemSemanticEditPolicy"
517
          notationViewFactoryClassName="DiagramElementFigureViewFactory">
518
        <diagramRunTimeClass
519
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
520
        <elementType
521
            xsi:type="gmfgen:SpecializationType"
522
            editHelperAdviceClassName="DiagramElementFigureEditHelperAdvice"/>
523
        <viewmap
524
            xsi:type="gmfgen:InnerClassViewmap"
525
            className="FigureConnectionFigure"
526
            classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class FigureConnectionFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public FigureConnectionFigure() {&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASHDOT);&#xD;&#xA;&#x9;&#x9;setTargetDecoration(createTargetDecoration());&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.PolylineDecoration createTargetDecoration() {&#xD;&#xA;org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();&#xD;&#xA;// dispatchNext?&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();&#xD;&#xA;&#x9;&#x9;pl.addPoint(-1, 1);&#xD;&#xA;&#x9;&#x9;pl.addPoint(0, 0);&#xD;&#xA;&#x9;&#x9;pl.addPoint(-1, -1);&#xD;&#xA;&#x9;&#x9;df.setTemplate(pl);&#xD;&#xA;&#x9;&#x9;df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return df;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
527
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
528
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
529
        </viewmap>
502
        <modelFacet
530
        <modelFacet
503
            xsi:type="gmfgen:FeatureLabelModelFacet">
531
            xsi:type="gmfgen:FeatureLinkModelFacet">
504
          <metaFeatures
532
          <metaFeature
505
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Identity/name"/>
533
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/DiagramElement/figure"/>
506
        </modelFacet>
534
        </modelFacet>
507
      </labels>
535
      </links>
508
    </topLevelNodes>
536
      <compartments
509
    <links
537
          visualID="7001"
510
        visualID="4001"
538
          editPartClassName="CompartmentVisualFacetsEditPart"
511
        editPartClassName="DiagramElementFigureEditPart"
539
          itemSemanticEditPolicyClassName="CompartmentVisualFacetsItemSemanticEditPolicy"
512
        itemSemanticEditPolicyClassName="DiagramElementFigureItemSemanticEditPolicy"
540
          notationViewFactoryClassName="CompartmentVisualFacetsViewFactory"
513
        notationViewFactoryClassName="DiagramElementFigureViewFactory">
541
          canonicalEditPolicyClassName="CompartmentVisualFacetsCanonicalEditPolicy"
514
      <diagramRunTimeClass
542
          title="VisualFacets"
515
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
543
          node="/0/@diagram/@topLevelNodes.0">
516
      <elementType
544
        <diagramRunTimeClass
517
          xsi:type="gmfgen:SpecializationType"
545
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
518
          editHelperAdviceClassName="DiagramElementFigureEditHelperAdvice"/>
546
        <viewmap
519
      <viewmap
547
            xsi:type="gmfgen:FigureViewmap"
520
          xsi:type="gmfgen:InnerClassViewmap"
548
            figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure">
521
          className="FigureConnectionFigure"
549
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
522
          classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class FigureConnectionFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public FigureConnectionFigure() {&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASHDOT);&#xD;&#xA;&#x9;&#x9;setTargetDecoration(createTargetDecoration());&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.PolylineDecoration createTargetDecoration() {&#xD;&#xA;org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();&#xD;&#xA;// dispatchNext?&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();&#xD;&#xA;&#x9;&#x9;pl.addPoint(-1, 1);&#xD;&#xA;&#x9;&#x9;pl.addPoint(0, 0);&#xD;&#xA;&#x9;&#x9;pl.addPoint(-1, -1);&#xD;&#xA;&#x9;&#x9;df.setTemplate(pl);&#xD;&#xA;&#x9;&#x9;df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return df;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#x9;&#xD;&#xA;">
550
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
523
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
551
        </viewmap>
524
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
552
      </compartments>
525
      </viewmap>
553
      <compartments
526
      <modelFacet
554
          visualID="7002"
527
          xsi:type="gmfgen:FeatureLinkModelFacet">
555
          editPartClassName="NodeVisualFacetsEditPart"
528
        <metaFeature
556
          itemSemanticEditPolicyClassName="NodeVisualFacetsItemSemanticEditPolicy"
529
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/DiagramElement/figure"/>
557
          notationViewFactoryClassName="NodeVisualFacetsViewFactory"
530
      </modelFacet>
558
          canonicalEditPolicyClassName="NodeVisualFacetsCanonicalEditPolicy"
531
    </links>
559
          title="VisualFacets"
532
    <compartments
560
          node="/0/@diagram/@topLevelNodes.1">
533
        visualID="7001"
561
        <diagramRunTimeClass
534
        editPartClassName="CompartmentVisualFacetsEditPart"
562
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
535
        itemSemanticEditPolicyClassName="CompartmentVisualFacetsItemSemanticEditPolicy"
563
        <viewmap
536
        notationViewFactoryClassName="CompartmentVisualFacetsViewFactory"
564
            xsi:type="gmfgen:FigureViewmap"
537
        canonicalEditPolicyClassName="CompartmentVisualFacetsCanonicalEditPolicy"
565
            figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure">
538
        title="VisualFacets"
566
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
539
        node="//@diagram/@topLevelNodes.0">
567
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
540
      <diagramRunTimeClass
568
        </viewmap>
541
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
569
      </compartments>
542
      <viewmap
570
      <compartments
543
          xsi:type="gmfgen:FigureViewmap"
571
          visualID="7003"
544
          figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure">
572
          editPartClassName="ConnectionVisualFacetsEditPart"
545
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
573
          itemSemanticEditPolicyClassName="ConnectionVisualFacetsItemSemanticEditPolicy"
546
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
574
          notationViewFactoryClassName="ConnectionVisualFacetsViewFactory"
547
      </viewmap>
575
          canonicalEditPolicyClassName="ConnectionVisualFacetsCanonicalEditPolicy"
548
    </compartments>
576
          title="VisualFacets"
549
    <compartments
577
          node="/0/@diagram/@topLevelNodes.2">
550
        visualID="7002"
578
        <diagramRunTimeClass
551
        editPartClassName="NodeVisualFacetsEditPart"
579
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
552
        itemSemanticEditPolicyClassName="NodeVisualFacetsItemSemanticEditPolicy"
580
        <viewmap
553
        notationViewFactoryClassName="NodeVisualFacetsViewFactory"
581
            xsi:type="gmfgen:FigureViewmap"
554
        canonicalEditPolicyClassName="NodeVisualFacetsCanonicalEditPolicy"
582
            figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure">
555
        title="VisualFacets"
583
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
556
        node="//@diagram/@topLevelNodes.1">
584
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
557
      <diagramRunTimeClass
585
        </viewmap>
558
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
586
      </compartments>
559
      <viewmap
587
      <compartments
560
          xsi:type="gmfgen:FigureViewmap"
588
          visualID="7004"
561
          figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure">
589
          editPartClassName="FigureGalleryFiguresEditPart"
562
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
590
          itemSemanticEditPolicyClassName="FigureGalleryFiguresItemSemanticEditPolicy"
563
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
591
          notationViewFactoryClassName="FigureGalleryFiguresViewFactory"
564
      </viewmap>
592
          canonicalEditPolicyClassName="FigureGalleryFiguresCanonicalEditPolicy"
565
    </compartments>
593
          childNodes="/0/@diagram/@childNodes.0 /0/@diagram/@childNodes.5 /0/@diagram/@childNodes.6 /0/@diagram/@childNodes.7"
566
    <compartments
567
        visualID="7003"
568
        editPartClassName="ConnectionVisualFacetsEditPart"
569
        itemSemanticEditPolicyClassName="ConnectionVisualFacetsItemSemanticEditPolicy"
570
        notationViewFactoryClassName="ConnectionVisualFacetsViewFactory"
571
        canonicalEditPolicyClassName="ConnectionVisualFacetsCanonicalEditPolicy"
572
        title="VisualFacets"
573
        node="//@diagram/@topLevelNodes.2">
574
      <diagramRunTimeClass
575
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
576
      <viewmap
577
          xsi:type="gmfgen:FigureViewmap"
578
          figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure">
579
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
580
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
581
      </viewmap>
582
    </compartments>
583
    <compartments
584
        visualID="7004"
585
        editPartClassName="FigureGalleryFiguresEditPart"
586
        itemSemanticEditPolicyClassName="FigureGalleryFiguresItemSemanticEditPolicy"
587
        notationViewFactoryClassName="FigureGalleryFiguresViewFactory"
588
        canonicalEditPolicyClassName="FigureGalleryFiguresCanonicalEditPolicy"
589
        childNodes="//@diagram/@childNodes.0 //@diagram/@childNodes.5 //@diagram/@childNodes.6 //@diagram/@childNodes.7"
590
        title="Figures"
591
        node="//@diagram/@topLevelNodes.3"
592
        listLayout="false">
593
      <diagramRunTimeClass
594
          href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
595
      <viewmap
596
          xsi:type="gmfgen:FigureViewmap"
597
          figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure">
598
        <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
599
        <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
600
      </viewmap>
601
    </compartments>
602
    <palette>
603
      <groups
604
          title="Diagram Elements"
605
          description="Can visualize domain model elements"
606
          collapse="true">
607
        <entries
608
            xsi:type="gmfgen:ToolEntry"
609
            title="Node"
610
            description="Create Diagram Element representing Top-level diagram Node"
611
            genNodes="//@diagram/@topLevelNodes.1"/>
612
        <entries
613
            xsi:type="gmfgen:ToolEntry"
614
            title="ChildNode"
615
            description="Create Diagram Element representing Child diagram Node"/>
616
        <entries
617
            xsi:type="gmfgen:ToolEntry"
618
            title="Compartment"
619
            description="Create Diagram Element representing Children Compartment"
620
            genNodes="//@diagram/@topLevelNodes.0"/>
621
        <entries
622
            xsi:type="gmfgen:ToolEntry"
623
            title="Connection"
624
            description="Create Diagram Element representing Connection"
625
            genNodes="//@diagram/@topLevelNodes.2"/>
626
        <entries
627
            xsi:type="gmfgen:ToolEntry"
628
            title="Figure Link"
629
            description="Link from the Diagram Element to the figure"
630
            genLinks="//@diagram/@links.0"/>
631
      </groups>
632
      <groups
633
          title="Figures"
594
          title="Figures"
634
          description="Can be references by Diagram Elements"
595
          node="/0/@diagram/@topLevelNodes.3"
635
          collapse="true">
596
          listLayout="false">
636
        <entries
597
        <diagramRunTimeClass
637
            xsi:type="gmfgen:ToolEntry"
598
            href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
638
            title="FigureGallery"
599
        <viewmap
639
            description="Create FigureGallery - physical container for figures"
600
            xsi:type="gmfgen:FigureViewmap"
640
            genNodes="//@diagram/@topLevelNodes.3"/>
601
            figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure">
641
        <entries
602
          <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
642
            xsi:type="gmfgen:ToolEntry"
603
          <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs>
643
            title="Rectangle"
604
        </viewmap>
644
            description="Create Rectangle"
605
      </compartments>
645
            genNodes="//@diagram/@childNodes.0 //@diagram/@childNodes.1"/>
606
      <palette>
646
        <entries
607
        <groups
647
            xsi:type="gmfgen:ToolEntry"
608
            title="Diagram Elements"
648
            title="Ellipse"
609
            description="Can visualize domain model elements"
649
            description="Create Ellipse"
610
            collapse="true">
650
            genNodes="//@diagram/@childNodes.2 //@diagram/@childNodes.5"/>
611
          <entries
651
        <entries
612
              xsi:type="gmfgen:ToolEntry"
652
            xsi:type="gmfgen:ToolEntry"
613
              title="Node"
653
            title="Rounded Rectangle"
614
              description="Create Diagram Element representing Top-level diagram Node"
654
            description="Create Rounded Rectangle"
615
              genNodes="/0/@diagram/@topLevelNodes.1"/>
655
            genNodes="//@diagram/@childNodes.3 //@diagram/@childNodes.6"/>
616
          <entries
656
        <entries
617
              xsi:type="gmfgen:ToolEntry"
657
            xsi:type="gmfgen:ToolEntry"
618
              title="ChildNode"
658
            title="Polyline"
619
              description="Create Diagram Element representing Child diagram Node"/>
659
            description="Create new PolylineConnection"
620
          <entries
660
            genNodes="//@diagram/@childNodes.4 //@diagram/@childNodes.7"/>
621
              xsi:type="gmfgen:ToolEntry"
661
      </groups>
622
              title="Compartment"
662
    </palette>
623
              description="Create Diagram Element representing Children Compartment"
663
    <preferencePages
624
              genNodes="/0/@diagram/@topLevelNodes.0"/>
664
        xsi:type="gmfgen:GenStandardPreferencePage"
625
          <entries
665
        iD="org.eclipse.gmf.graphdef.diagram.general"
626
              xsi:type="gmfgen:ToolEntry"
666
        name="GMFGraph Diagram">
627
              title="Connection"
667
      <children
628
              description="Create Diagram Element representing Connection"
668
          xsi:type="gmfgen:GenStandardPreferencePage"
629
              genNodes="/0/@diagram/@topLevelNodes.2"/>
669
          iD="org.eclipse.gmf.graphdef.diagram.appearance"
630
          <entries
670
          name="Appearance"
631
              xsi:type="gmfgen:ToolEntry"
671
          kind="Appearance"/>
632
              title="Figure Link"
672
      <children
633
              description="Link from the Diagram Element to the figure"
673
          xsi:type="gmfgen:GenStandardPreferencePage"
634
              genLinks="/0/@diagram/@links.0"/>
674
          iD="org.eclipse.gmf.graphdef.diagram.connections"
635
        </groups>
675
          name="Connections"
636
        <groups
676
          kind="Connections"/>
637
            title="Figures"
677
      <children
638
            description="Can be references by Diagram Elements"
678
          xsi:type="gmfgen:GenStandardPreferencePage"
639
            collapse="true">
679
          iD="org.eclipse.gmf.graphdef.diagram.printing"
640
          <entries
680
          name="Printing"
641
              xsi:type="gmfgen:ToolEntry"
681
          kind="Printing"/>
642
              title="FigureGallery"
682
      <children
643
              description="Create FigureGallery - physical container for figures"
683
          xsi:type="gmfgen:GenStandardPreferencePage"
644
              genNodes="/0/@diagram/@topLevelNodes.3"/>
684
          iD="org.eclipse.gmf.graphdef.diagram.rulersAndGrid"
645
          <entries
685
          name="Rulers And Grid"
646
              xsi:type="gmfgen:ToolEntry"
686
          kind="RulersAndGrid"/>
647
              title="Rectangle"
687
      <children
648
              description="Create Rectangle"
649
              genNodes="/0/@diagram/@childNodes.0 /0/@diagram/@childNodes.1"/>
650
          <entries
651
              xsi:type="gmfgen:ToolEntry"
652
              title="Ellipse"
653
              description="Create Ellipse"
654
              genNodes="/0/@diagram/@childNodes.2 /0/@diagram/@childNodes.5"/>
655
          <entries
656
              xsi:type="gmfgen:ToolEntry"
657
              title="Rounded Rectangle"
658
              description="Create Rounded Rectangle"
659
              genNodes="/0/@diagram/@childNodes.3 /0/@diagram/@childNodes.6"/>
660
          <entries
661
              xsi:type="gmfgen:ToolEntry"
662
              title="Polyline"
663
              description="Create new PolylineConnection"
664
              genNodes="/0/@diagram/@childNodes.4 /0/@diagram/@childNodes.7"/>
665
        </groups>
666
      </palette>
667
      <preferencePages
688
          xsi:type="gmfgen:GenStandardPreferencePage"
668
          xsi:type="gmfgen:GenStandardPreferencePage"
689
          iD="org.eclipse.gmf.graphdef.diagram.pathmaps"
669
          iD="org.eclipse.gmf.graphdef.diagram.general"
690
          name="Pathmaps"
670
          name="GMFGraph Diagram">
691
          kind="Pathmaps"/>
671
        <children
692
    </preferencePages>
672
            xsi:type="gmfgen:GenStandardPreferencePage"
693
  </diagram>
673
            iD="org.eclipse.gmf.graphdef.diagram.appearance"
694
  <plugin
674
            name="Appearance"
695
      iD="org.eclipse.gmf.graphdef.editor"
675
            kind="Appearance"/>
696
      name="gmfgraph Plugin"/>
676
        <children
697
  <editor/>
677
            xsi:type="gmfgen:GenStandardPreferencePage"
698
  <navigator>
678
            iD="org.eclipse.gmf.graphdef.diagram.connections"
699
    <childReferences
679
            name="Connections"
700
        child="//@diagram"/>
680
            kind="Connections"/>
701
    <childReferences
681
        <children
702
        parent="//@diagram"
682
            xsi:type="gmfgen:GenStandardPreferencePage"
703
        child="//@diagram/@topLevelNodes.0"/>
683
            iD="org.eclipse.gmf.graphdef.diagram.printing"
704
    <childReferences
684
            name="Printing"
705
        parent="//@diagram"
685
            kind="Printing"/>
706
        child="//@diagram/@topLevelNodes.1"/>
686
        <children
707
    <childReferences
687
            xsi:type="gmfgen:GenStandardPreferencePage"
708
        parent="//@diagram"
688
            iD="org.eclipse.gmf.graphdef.diagram.rulersAndGrid"
709
        child="//@diagram/@topLevelNodes.2"/>
689
            name="Rulers And Grid"
710
    <childReferences
690
            kind="RulersAndGrid"/>
711
        parent="//@diagram/@childNodes.1"
691
        <children
712
        child="//@diagram/@childNodes.1"/>
692
            xsi:type="gmfgen:GenStandardPreferencePage"
713
    <childReferences
693
            iD="org.eclipse.gmf.graphdef.diagram.pathmaps"
714
        parent="//@diagram/@childNodes.2"
694
            name="Pathmaps"
715
        child="//@diagram/@childNodes.1"/>
695
            kind="Pathmaps"/>
716
    <childReferences
696
      </preferencePages>
717
        parent="//@diagram/@childNodes.2"
697
    </diagram>
718
        child="//@diagram/@childNodes.2"/>
698
    <plugin
719
    <childReferences
699
        iD="org.eclipse.gmf.graphdef.editor"
720
        parent="//@diagram/@childNodes.3"
700
        name="gmfgraph Plugin"/>
721
        child="//@diagram/@childNodes.1"/>
701
    <editor/>
722
    <childReferences
702
    <navigator>
723
        parent="//@diagram/@childNodes.3"
703
      <childReferences
724
        child="//@diagram/@childNodes.2"/>
704
          child="/0/@diagram"/>
725
    <childReferences
705
      <childReferences
726
        parent="//@diagram/@childNodes.3"
706
          parent="/0/@diagram"
727
        child="//@diagram/@childNodes.3"/>
707
          child="/0/@diagram/@topLevelNodes.0"/>
728
    <childReferences
708
      <childReferences
729
        parent="//@diagram/@childNodes.3"
709
          parent="/0/@diagram"
730
        child="//@diagram/@childNodes.4"/>
710
          child="/0/@diagram/@topLevelNodes.1"/>
731
    <childReferences
711
      <childReferences
732
        parent="//@diagram/@childNodes.2"
712
          parent="/0/@diagram"
733
        child="//@diagram/@childNodes.3"/>
713
          child="/0/@diagram/@topLevelNodes.2"/>
734
    <childReferences
714
      <childReferences
735
        parent="//@diagram/@childNodes.2"
715
          parent="/0/@diagram/@childNodes.1"
736
        child="//@diagram/@childNodes.4"/>
716
          child="/0/@diagram/@childNodes.1"/>
737
    <childReferences
717
      <childReferences
738
        parent="//@diagram/@childNodes.1"
718
          parent="/0/@diagram/@childNodes.2"
739
        child="//@diagram/@childNodes.2"/>
719
          child="/0/@diagram/@childNodes.1"/>
740
    <childReferences
720
      <childReferences
741
        parent="//@diagram/@childNodes.1"
721
          parent="/0/@diagram/@childNodes.2"
742
        child="//@diagram/@childNodes.3"/>
722
          child="/0/@diagram/@childNodes.2"/>
743
    <childReferences
723
      <childReferences
744
        parent="//@diagram/@childNodes.1"
724
          parent="/0/@diagram/@childNodes.3"
745
        child="//@diagram/@childNodes.4"/>
725
          child="/0/@diagram/@childNodes.1"/>
746
    <childReferences
726
      <childReferences
747
        parent="//@diagram/@childNodes.0"
727
          parent="/0/@diagram/@childNodes.3"
748
        child="//@diagram/@childNodes.1"/>
728
          child="/0/@diagram/@childNodes.2"/>
749
    <childReferences
729
      <childReferences
750
        parent="//@diagram/@childNodes.0"
730
          parent="/0/@diagram/@childNodes.3"
751
        child="//@diagram/@childNodes.2"/>
731
          child="/0/@diagram/@childNodes.3"/>
752
    <childReferences
732
      <childReferences
753
        parent="//@diagram/@childNodes.0"
733
          parent="/0/@diagram/@childNodes.3"
754
        child="//@diagram/@childNodes.3"/>
734
          child="/0/@diagram/@childNodes.4"/>
755
    <childReferences
735
      <childReferences
756
        parent="//@diagram/@childNodes.0"
736
          parent="/0/@diagram/@childNodes.2"
757
        child="//@diagram/@childNodes.4"/>
737
          child="/0/@diagram/@childNodes.3"/>
758
    <childReferences
738
      <childReferences
759
        parent="//@diagram/@topLevelNodes.3"
739
          parent="/0/@diagram/@childNodes.2"
760
        child="//@diagram/@childNodes.0"/>
740
          child="/0/@diagram/@childNodes.4"/>
761
    <childReferences
741
      <childReferences
762
        parent="//@diagram/@childNodes.5"
742
          parent="/0/@diagram/@childNodes.1"
763
        child="//@diagram/@childNodes.1"/>
743
          child="/0/@diagram/@childNodes.2"/>
764
    <childReferences
744
      <childReferences
765
        parent="//@diagram/@childNodes.5"
745
          parent="/0/@diagram/@childNodes.1"
766
        child="//@diagram/@childNodes.2"/>
746
          child="/0/@diagram/@childNodes.3"/>
767
    <childReferences
747
      <childReferences
768
        parent="//@diagram/@childNodes.5"
748
          parent="/0/@diagram/@childNodes.1"
769
        child="//@diagram/@childNodes.3"/>
749
          child="/0/@diagram/@childNodes.4"/>
770
    <childReferences
750
      <childReferences
771
        parent="//@diagram/@childNodes.5"
751
          parent="/0/@diagram/@childNodes.0"
772
        child="//@diagram/@childNodes.4"/>
752
          child="/0/@diagram/@childNodes.1"/>
773
    <childReferences
753
      <childReferences
774
        parent="//@diagram/@topLevelNodes.3"
754
          parent="/0/@diagram/@childNodes.0"
775
        child="//@diagram/@childNodes.5"/>
755
          child="/0/@diagram/@childNodes.2"/>
776
    <childReferences
756
      <childReferences
777
        parent="//@diagram/@childNodes.6"
757
          parent="/0/@diagram/@childNodes.0"
778
        child="//@diagram/@childNodes.1"/>
758
          child="/0/@diagram/@childNodes.3"/>
779
    <childReferences
759
      <childReferences
780
        parent="//@diagram/@childNodes.6"
760
          parent="/0/@diagram/@childNodes.0"
781
        child="//@diagram/@childNodes.2"/>
761
          child="/0/@diagram/@childNodes.4"/>
782
    <childReferences
762
      <childReferences
783
        parent="//@diagram/@childNodes.6"
763
          parent="/0/@diagram/@topLevelNodes.3"
784
        child="//@diagram/@childNodes.3"/>
764
          child="/0/@diagram/@childNodes.0"/>
785
    <childReferences
765
      <childReferences
786
        parent="//@diagram/@childNodes.6"
766
          parent="/0/@diagram/@childNodes.5"
787
        child="//@diagram/@childNodes.4"/>
767
          child="/0/@diagram/@childNodes.1"/>
788
    <childReferences
768
      <childReferences
789
        parent="//@diagram/@topLevelNodes.3"
769
          parent="/0/@diagram/@childNodes.5"
790
        child="//@diagram/@childNodes.6"/>
770
          child="/0/@diagram/@childNodes.2"/>
791
    <childReferences
771
      <childReferences
792
        parent="//@diagram/@topLevelNodes.3"
772
          parent="/0/@diagram/@childNodes.5"
793
        child="//@diagram/@childNodes.7"/>
773
          child="/0/@diagram/@childNodes.3"/>
794
    <childReferences
774
      <childReferences
795
        parent="//@diagram"
775
          parent="/0/@diagram/@childNodes.5"
796
        child="//@diagram/@topLevelNodes.3"/>
776
          child="/0/@diagram/@childNodes.4"/>
797
    <childReferences
777
      <childReferences
798
        parent="//@diagram"
778
          parent="/0/@diagram/@topLevelNodes.3"
799
        child="//@diagram/@links.0"
779
          child="/0/@diagram/@childNodes.5"/>
800
        groupName="links"
780
      <childReferences
801
        groupIcon="icons/linksNavigatorGroup.gif"/>
781
          parent="/0/@diagram/@childNodes.6"
802
    <childReferences
782
          child="/0/@diagram/@childNodes.1"/>
803
        parent="//@diagram/@links.0"
783
      <childReferences
804
        child="//@diagram/@childNodes.0"
784
          parent="/0/@diagram/@childNodes.6"
805
        referenceType="out_taget"
785
          child="/0/@diagram/@childNodes.2"/>
806
        groupName="target"
786
      <childReferences
807
        groupIcon="icons/linkTargetNavigatorGroup.gif"/>
787
          parent="/0/@diagram/@childNodes.6"
808
    <childReferences
788
          child="/0/@diagram/@childNodes.3"/>
809
        parent="//@diagram/@childNodes.0"
789
      <childReferences
810
        child="//@diagram/@links.0"
790
          parent="/0/@diagram/@childNodes.6"
811
        referenceType="in_source"
791
          child="/0/@diagram/@childNodes.4"/>
812
        groupName="incoming links"
792
      <childReferences
813
        groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
793
          parent="/0/@diagram/@topLevelNodes.3"
814
    <childReferences
794
          child="/0/@diagram/@childNodes.6"/>
815
        parent="//@diagram/@links.0"
795
      <childReferences
816
        child="//@diagram/@childNodes.1"
796
          parent="/0/@diagram/@topLevelNodes.3"
817
        referenceType="out_taget"
797
          child="/0/@diagram/@childNodes.7"/>
818
        groupName="target"
798
      <childReferences
819
        groupIcon="icons/linkTargetNavigatorGroup.gif"/>
799
          parent="/0/@diagram"
820
    <childReferences
800
          child="/0/@diagram/@topLevelNodes.3"/>
821
        parent="//@diagram/@childNodes.1"
801
      <childReferences
822
        child="//@diagram/@links.0"
802
          parent="/0/@diagram"
823
        referenceType="in_source"
803
          child="/0/@diagram/@links.0"
824
        groupName="incoming links"
804
          groupName="links"
825
        groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
805
          groupIcon="icons/linksNavigatorGroup.gif"/>
826
    <childReferences
806
      <childReferences
827
        parent="//@diagram/@links.0"
807
          parent="/0/@diagram/@links.0"
828
        child="//@diagram/@childNodes.2"
808
          child="/0/@diagram/@childNodes.0"
829
        referenceType="out_taget"
809
          referenceType="out_taget"
830
        groupName="target"
810
          groupName="target"
831
        groupIcon="icons/linkTargetNavigatorGroup.gif"/>
811
          groupIcon="icons/linkTargetNavigatorGroup.gif"/>
832
    <childReferences
812
      <childReferences
833
        parent="//@diagram/@childNodes.2"
813
          parent="/0/@diagram/@childNodes.0"
834
        child="//@diagram/@links.0"
814
          child="/0/@diagram/@links.0"
835
        referenceType="in_source"
815
          referenceType="in_source"
836
        groupName="incoming links"
816
          groupName="incoming links"
837
        groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
817
          groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
838
    <childReferences
818
      <childReferences
839
        parent="//@diagram/@links.0"
819
          parent="/0/@diagram/@links.0"
840
        child="//@diagram/@childNodes.3"
820
          child="/0/@diagram/@childNodes.1"
841
        referenceType="out_taget"
821
          referenceType="out_taget"
842
        groupName="target"
822
          groupName="target"
843
        groupIcon="icons/linkTargetNavigatorGroup.gif"/>
823
          groupIcon="icons/linkTargetNavigatorGroup.gif"/>
844
    <childReferences
824
      <childReferences
845
        parent="//@diagram/@childNodes.3"
825
          parent="/0/@diagram/@childNodes.1"
846
        child="//@diagram/@links.0"
826
          child="/0/@diagram/@links.0"
847
        referenceType="in_source"
827
          referenceType="in_source"
848
        groupName="incoming links"
828
          groupName="incoming links"
849
        groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
829
          groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
850
    <childReferences
830
      <childReferences
851
        parent="//@diagram/@links.0"
831
          parent="/0/@diagram/@links.0"
852
        child="//@diagram/@childNodes.4"
832
          child="/0/@diagram/@childNodes.2"
853
        referenceType="out_taget"
833
          referenceType="out_taget"
854
        groupName="target"
834
          groupName="target"
855
        groupIcon="icons/linkTargetNavigatorGroup.gif"/>
835
          groupIcon="icons/linkTargetNavigatorGroup.gif"/>
856
    <childReferences
836
      <childReferences
857
        parent="//@diagram/@childNodes.4"
837
          parent="/0/@diagram/@childNodes.2"
858
        child="//@diagram/@links.0"
838
          child="/0/@diagram/@links.0"
859
        referenceType="in_source"
839
          referenceType="in_source"
860
        groupName="incoming links"
840
          groupName="incoming links"
861
        groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
841
          groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
862
    <childReferences
842
      <childReferences
863
        parent="//@diagram/@links.0"
843
          parent="/0/@diagram/@links.0"
864
        child="//@diagram/@childNodes.5"
844
          child="/0/@diagram/@childNodes.3"
865
        referenceType="out_taget"
845
          referenceType="out_taget"
866
        groupName="target"
846
          groupName="target"
867
        groupIcon="icons/linkTargetNavigatorGroup.gif"/>
847
          groupIcon="icons/linkTargetNavigatorGroup.gif"/>
868
    <childReferences
848
      <childReferences
869
        parent="//@diagram/@childNodes.5"
849
          parent="/0/@diagram/@childNodes.3"
870
        child="//@diagram/@links.0"
850
          child="/0/@diagram/@links.0"
871
        referenceType="in_source"
851
          referenceType="in_source"
872
        groupName="incoming links"
852
          groupName="incoming links"
873
        groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
853
          groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
874
    <childReferences
854
      <childReferences
875
        parent="//@diagram/@links.0"
855
          parent="/0/@diagram/@links.0"
876
        child="//@diagram/@childNodes.6"
856
          child="/0/@diagram/@childNodes.4"
877
        referenceType="out_taget"
857
          referenceType="out_taget"
878
        groupName="target"
858
          groupName="target"
879
        groupIcon="icons/linkTargetNavigatorGroup.gif"/>
859
          groupIcon="icons/linkTargetNavigatorGroup.gif"/>
880
    <childReferences
860
      <childReferences
881
        parent="//@diagram/@childNodes.6"
861
          parent="/0/@diagram/@childNodes.4"
882
        child="//@diagram/@links.0"
862
          child="/0/@diagram/@links.0"
883
        referenceType="in_source"
863
          referenceType="in_source"
884
        groupName="incoming links"
864
          groupName="incoming links"
885
        groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
865
          groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
886
    <childReferences
866
      <childReferences
887
        parent="//@diagram/@links.0"
867
          parent="/0/@diagram/@links.0"
888
        child="//@diagram/@childNodes.7"
868
          child="/0/@diagram/@childNodes.5"
889
        referenceType="out_taget"
869
          referenceType="out_taget"
890
        groupName="target"
870
          groupName="target"
891
        groupIcon="icons/linkTargetNavigatorGroup.gif"/>
871
          groupIcon="icons/linkTargetNavigatorGroup.gif"/>
892
    <childReferences
872
      <childReferences
893
        parent="//@diagram/@childNodes.7"
873
          parent="/0/@diagram/@childNodes.5"
894
        child="//@diagram/@links.0"
874
          child="/0/@diagram/@links.0"
895
        referenceType="in_source"
875
          referenceType="in_source"
896
        groupName="incoming links"
876
          groupName="incoming links"
897
        groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
877
          groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
898
    <childReferences
878
      <childReferences
899
        parent="//@diagram/@links.0"
879
          parent="/0/@diagram/@links.0"
900
        child="//@diagram/@topLevelNodes.0"
880
          child="/0/@diagram/@childNodes.6"
901
        referenceType="in_source"
881
          referenceType="out_taget"
902
        groupName="source"
882
          groupName="target"
903
        groupIcon="icons/linkSourceNavigatorGroup.gif"/>
883
          groupIcon="icons/linkTargetNavigatorGroup.gif"/>
904
    <childReferences
884
      <childReferences
905
        parent="//@diagram/@topLevelNodes.0"
885
          parent="/0/@diagram/@childNodes.6"
906
        child="//@diagram/@links.0"
886
          child="/0/@diagram/@links.0"
907
        referenceType="out_taget"
887
          referenceType="in_source"
908
        groupName="outgoing links"
888
          groupName="incoming links"
909
        groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
889
          groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
910
    <childReferences
890
      <childReferences
911
        parent="//@diagram/@links.0"
891
          parent="/0/@diagram/@links.0"
912
        child="//@diagram/@topLevelNodes.1"
892
          child="/0/@diagram/@childNodes.7"
913
        referenceType="in_source"
893
          referenceType="out_taget"
914
        groupName="source"
894
          groupName="target"
915
        groupIcon="icons/linkSourceNavigatorGroup.gif"/>
895
          groupIcon="icons/linkTargetNavigatorGroup.gif"/>
916
    <childReferences
896
      <childReferences
917
        parent="//@diagram/@topLevelNodes.1"
897
          parent="/0/@diagram/@childNodes.7"
918
        child="//@diagram/@links.0"
898
          child="/0/@diagram/@links.0"
919
        referenceType="out_taget"
899
          referenceType="in_source"
920
        groupName="outgoing links"
900
          groupName="incoming links"
921
        groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
901
          groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
922
    <childReferences
902
      <childReferences
923
        parent="//@diagram/@links.0"
903
          parent="/0/@diagram/@links.0"
924
        child="//@diagram/@topLevelNodes.2"
904
          child="/0/@diagram/@topLevelNodes.0"
925
        referenceType="in_source"
905
          referenceType="in_source"
926
        groupName="source"
906
          groupName="source"
927
        groupIcon="icons/linkSourceNavigatorGroup.gif"/>
907
          groupIcon="icons/linkSourceNavigatorGroup.gif"/>
928
    <childReferences
908
      <childReferences
929
        parent="//@diagram/@topLevelNodes.2"
909
          parent="/0/@diagram/@topLevelNodes.0"
930
        child="//@diagram/@links.0"
910
          child="/0/@diagram/@links.0"
931
        referenceType="out_taget"
911
          referenceType="out_taget"
932
        groupName="outgoing links"
912
          groupName="outgoing links"
933
        groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
913
          groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
934
  </navigator>
914
      <childReferences
935
  <propertySheet>
915
          parent="/0/@diagram/@links.0"
936
    <tabs
916
          child="/0/@diagram/@topLevelNodes.1"
937
        xsi:type="gmfgen:GenStandardPropertyTab"
917
          referenceType="in_source"
938
        iD="appearance"/>
918
          groupName="source"
939
    <tabs
919
          groupIcon="icons/linkSourceNavigatorGroup.gif"/>
940
        xsi:type="gmfgen:GenStandardPropertyTab"
920
      <childReferences
941
        iD="diagram"
921
          parent="/0/@diagram/@topLevelNodes.1"
942
        label="Rulers &amp; Grid"/>
922
          child="/0/@diagram/@links.0"
943
    <tabs
923
          referenceType="out_taget"
944
        xsi:type="gmfgen:GenCustomPropertyTab"
924
          groupName="outgoing links"
945
        iD="custom"
925
          groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
946
        label="Styles"
926
      <childReferences
947
        className="CustomPropertySection">
927
          parent="/0/@diagram/@links.0"
948
      <filter
928
          child="/0/@diagram/@topLevelNodes.2"
949
          xsi:type="gmfgen:CustomTabFilter"
929
          referenceType="in_source"
950
          className="PropertySectionFilters$ShapeFilter"/>
930
          groupName="source"
951
    </tabs>
931
          groupIcon="icons/linkSourceNavigatorGroup.gif"/>
952
    <tabs
932
      <childReferences
953
        xsi:type="gmfgen:GenCustomPropertyTab"
933
          parent="/0/@diagram/@topLevelNodes.2"
954
        iD="layout"
934
          child="/0/@diagram/@links.0"
955
        label="Layout"
935
          referenceType="out_taget"
956
        className="LayoutPropertySection">
936
          groupName="outgoing links"
957
      <filter
937
          groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
958
          xsi:type="gmfgen:CustomTabFilter"
938
    </navigator>
959
          className="PropertySectionFilters$LayoutableFilter"/>
939
    <propertySheet>
960
    </tabs>
940
      <tabs
961
    <tabs
941
          xsi:type="gmfgen:GenStandardPropertyTab"
962
        xsi:type="gmfgen:GenCustomPropertyTab"
942
          iD="appearance"/>
963
        iD="points"
943
      <tabs
964
        className="PointsPropertySection">
944
          xsi:type="gmfgen:GenStandardPropertyTab"
965
      <filter
945
          iD="diagram"
966
          xsi:type="gmfgen:CustomTabFilter"
946
          label="Rulers &amp; Grid"/>
967
          className="PropertySectionFilters$PolylineFilter"/>
947
      <tabs
968
    </tabs>
948
          xsi:type="gmfgen:GenCustomPropertyTab"
969
  </propertySheet>
949
          iD="points"
970
  <domainGenModel
950
          className="PointsPropertySection">
971
      href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#/"/>
951
        <filter
972
</gmfgen:GenEditorGenerator>
952
            xsi:type="gmfgen:CustomTabFilter"
953
            className="PropertySectionFilters$PolylineFilter"/>
954
      </tabs>
955
      <tabs
956
          xsi:type="gmfgen:GenCustomPropertyTab"
957
          iD="genStyles"
958
          label="Styles"
959
          className="GeneratedStylesPropertySection">
960
        <filter
961
            xsi:type="gmfgen:CustomTabFilter"
962
            className="PropertySectionFilters$ShapeFilter"/>
963
      </tabs>
964
      <tabs
965
          xsi:type="gmfgen:GenCustomPropertyTab"
966
          iD="layout"
967
          label="Layout (Old)"
968
          className="LayoutPropertySection">
969
        <filter
970
            xsi:type="gmfgen:CustomTabFilter"
971
            className="PropertySectionFilters$LayoutableFilter"/>
972
      </tabs>
973
      <!--tabs
974
          xsi:type="gmfgen:GenCustomPropertyTab"
975
          iD="custom"
976
          label="Styles (Old)"
977
          className="CustomPropertySection">
978
        <filter
979
            xsi:type="gmfgen:CustomTabFilter"
980
            className="PropertySectionFilters$ShapeFilter"/>
981
      </tabs>
982
      <tabs
983
          xsi:type="gmfgen:GenCustomPropertyTab"
984
          iD="genLayout"
985
          label="Layout"
986
          className="GeneratedLayoutPropertySection">
987
        <filter
988
            xsi:type="gmfgen:CustomTabFilter"
989
            className="PropertySectionFilters$LayoutableFilter"/>
990
      </tabs-->
991
    </propertySheet>
992
    <domainGenModel
993
        href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#/"/>
994
  </gmfgen:GenEditorGenerator>
995
  <propsheet:PropertySectionContainer>
996
    <customSections
997
        name="Generated Styles"
998
        genTab="/0/@propertySheet/@tabs.3">
999
      <target
1000
          xsi:type="genmodel:GenClass"
1001
          href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Shape"/>
1002
      <contents
1003
          xsi:type="propsheet:Group">
1004
        <text
1005
            overridedItemProviderText="Line Style"/>
1006
        <contents
1007
            xsi:type="propsheet:Radio"
1008
            iconPath="icons/line_solid.png">
1009
          <modelElement
1010
              xsi:type="propsheet:IsFeatureIsOfKindReference">
1011
            <feature
1012
                href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EEnumLiteral/value"/>
1013
            <isOfValue
1014
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/LineKind/LINE_SOLID"/>
1015
          </modelElement>
1016
        </contents>
1017
        <contents
1018
            xsi:type="propsheet:Radio"
1019
            iconPath="icons/line_dash.png">
1020
          <layoutConstraints
1021
              xsi:type="propsheet:FormLayoutConstraints"
1022
              anchorControl="/1/@customSections.0/@contents.0/@contents.0"
1023
              relativePosition="TOP"/>
1024
          <modelElement
1025
              xsi:type="propsheet:IsFeatureIsOfKindReference">
1026
            <feature
1027
                href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EEnumLiteral/value"/>
1028
            <isOfValue
1029
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/LineKind/LINE_DASH"/>
1030
          </modelElement>
1031
        </contents>
1032
        <contents
1033
            xsi:type="propsheet:Radio"
1034
            iconPath="icons/line_dot.png">
1035
          <layoutConstraints
1036
              xsi:type="propsheet:FormLayoutConstraints"
1037
              anchorControl="/1/@customSections.0/@contents.0/@contents.1"
1038
              relativePosition="TOP"/>
1039
          <modelElement
1040
              xsi:type="propsheet:IsFeatureIsOfKindReference">
1041
            <feature
1042
                href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EEnumLiteral/value"/>
1043
            <isOfValue
1044
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/LineKind/LINE_DOT"/>
1045
          </modelElement>
1046
        </contents>
1047
        <contents
1048
            xsi:type="propsheet:Radio"
1049
            iconPath="icons/line_dashdot.png">
1050
          <layoutConstraints
1051
              xsi:type="propsheet:FormLayoutConstraints"
1052
              anchorControl="/1/@customSections.0/@contents.0/@contents.2"
1053
              relativePosition="TOP"/>
1054
          <modelElement
1055
              xsi:type="propsheet:IsFeatureIsOfKindReference">
1056
            <feature
1057
                href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EEnumLiteral/value"/>
1058
            <isOfValue
1059
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/LineKind/LINE_DASHDOT"/>
1060
          </modelElement>
1061
        </contents>
1062
        <contents
1063
            xsi:type="propsheet:Radio"
1064
            name="myDashDotDotLineStyleRadio"
1065
            iconPath="icons/line_dashdotdot.png">
1066
          <layoutConstraints
1067
              xsi:type="propsheet:FormLayoutConstraints"
1068
              anchorControl="/1/@customSections.0/@contents.0/@contents.3"
1069
              relativePosition="TOP"/>
1070
          <modelElement
1071
              xsi:type="propsheet:IsFeatureIsOfKindReference">
1072
            <feature
1073
                href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EEnumLiteral/value"/>
1074
            <isOfValue
1075
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/LineKind/LINE_DASHDOTDOT"/>
1076
          </modelElement>
1077
        </contents>
1078
        <contents
1079
            xsi:type="propsheet:Radio"
1080
            name="myCustomLineStyleRadio"
1081
            iconPath="icons/line_custom.png">
1082
          <layoutConstraints
1083
              xsi:type="propsheet:FormLayoutConstraints"
1084
              anchorControl="/1/@customSections.0/@contents.0/@contents.4"
1085
              relativePosition="TOP"/>
1086
          <modelElement
1087
              xsi:type="propsheet:IsFeatureIsOfKindReference">
1088
            <feature
1089
                href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EEnumLiteral/value"/>
1090
            <isOfValue
1091
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/LineKind/LINE_CUSTOM"/>
1092
          </modelElement>
1093
        </contents>
1094
        <modelElement>
1095
          <feature
1096
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Shape/lineKind"/>
1097
        </modelElement>
1098
      </contents>
1099
      <contents
1100
          xsi:type="propsheet:Group">
1101
        <layoutConstraints
1102
            xsi:type="propsheet:FormLayoutConstraints"
1103
            anchorControl="/1/@customSections.0/@contents.0"/>
1104
        <text
1105
            overridedItemProviderText="Line Width"/>
1106
        <contents
1107
            xsi:type="propsheet:Spin"
1108
            max="999"
1109
            inc="1">
1110
          <modelElement>
1111
            <feature
1112
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Shape/lineWidth"/>
1113
          </modelElement>
1114
        </contents>
1115
      </contents>
1116
      <contents
1117
          xsi:type="propsheet:Group">
1118
        <layoutConstraints
1119
            xsi:type="propsheet:FormLayoutConstraints"
1120
            anchorControl="/1/@customSections.0/@contents.1"
1121
            relativePosition="TOP"/>
1122
        <text
1123
            overridedItemProviderText="Mix Styles"/>
1124
        <contents
1125
            xsi:type="propsheet:Checkbox">
1126
          <text/>
1127
          <modelElement>
1128
            <feature
1129
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Shape/fill"/>
1130
          </modelElement>
1131
        </contents>
1132
        <contents
1133
            xsi:type="propsheet:Checkbox">
1134
          <layoutConstraints
1135
              xsi:type="propsheet:FormLayoutConstraints"
1136
              anchorControl="/1/@customSections.0/@contents.2/@contents.0"
1137
              relativePosition="TOP"
1138
              lowermost="true"/>
1139
          <text/>
1140
          <modelElement>
1141
            <feature
1142
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Shape/outline"/>
1143
          </modelElement>
1144
        </contents>
1145
        <contents
1146
            xsi:type="propsheet:Checkbox">
1147
          <layoutConstraints
1148
              xsi:type="propsheet:FormLayoutConstraints"
1149
              anchorControl="/1/@customSections.0/@contents.2/@contents.0"
1150
              rightmost="true"/>
1151
          <text/>
1152
          <modelElement>
1153
            <feature
1154
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Shape/xorFill"/>
1155
          </modelElement>
1156
        </contents>
1157
        <contents
1158
            xsi:type="propsheet:Checkbox">
1159
          <layoutConstraints
1160
              xsi:type="propsheet:FormLayoutConstraints"
1161
              anchorControl="/1/@customSections.0/@contents.2/@contents.1"
1162
              rightmost="true"
1163
              lowermost="true"/>
1164
          <text/>
1165
          <modelElement>
1166
            <feature
1167
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Shape/xorOutline"/>
1168
          </modelElement>
1169
        </contents>
1170
      </contents>
1171
      <contents
1172
          xsi:type="propsheet:Group"
1173
          visibleOnlyForTargets="true">
1174
        <target
1175
            xsi:type="genmodel:GenClass"
1176
            href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/RoundedRectangle"/>
1177
        <layoutConstraints
1178
            xsi:type="propsheet:FormLayoutConstraints"
1179
            anchorControl="/1/@customSections.0/@contents.2"
1180
            relativePosition="TOP"/>
1181
        <text
1182
            overridedItemProviderText="Corner Dimensions"/>
1183
        <contents
1184
            xsi:type="propsheet:Label">
1185
          <text
1186
              overridedItemProviderText="Width"/>
1187
        </contents>
1188
        <contents
1189
            xsi:type="propsheet:Spin"
1190
            max="999"
1191
            inc="1">
1192
          <layoutConstraints
1193
              xsi:type="propsheet:FormLayoutConstraints"
1194
              anchorControl="/1/@customSections.0/@contents.3/@contents.0"/>
1195
          <modelElement>
1196
            <feature
1197
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/RoundedRectangle/cornerWidth"/>
1198
          </modelElement>
1199
        </contents>
1200
        <contents
1201
            xsi:type="propsheet:Label">
1202
          <layoutConstraints
1203
              xsi:type="propsheet:FormLayoutConstraints"
1204
              anchorControl="/1/@customSections.0/@contents.3/@contents.1"/>
1205
          <text
1206
              overridedItemProviderText="Height"/>
1207
        </contents>
1208
        <contents
1209
            xsi:type="propsheet:Spin"
1210
            max="999"
1211
            inc="1">
1212
          <layoutConstraints
1213
              xsi:type="propsheet:FormLayoutConstraints"
1214
              anchorControl="/1/@customSections.0/@contents.3/@contents.2"/>
1215
          <modelElement>
1216
            <feature
1217
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/RoundedRectangle/cornerHeight"/>
1218
          </modelElement>
1219
        </contents>
1220
      </contents>
1221
    </customSections>
1222
    <!--customSections
1223
        name="Generated Layout"
1224
        genTab="/0/@propertySheet/@tabs.6">
1225
      <target
1226
          xsi:type="genmodel:GenClass"
1227
          href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Layoutable"/>
1228
      <contents
1229
          xsi:type="propsheet:Group"
1230
          name="myLayoutGroup">
1231
        <text
1232
            overridedItemProviderText="Layout Manager"/>
1233
        <contents
1234
            xsi:type="propsheet:Group"
1235
            name="myLayoutKindGroup">
1236
          <layoutConstraints
1237
              xsi:type="propsheet:FormLayoutConstraints"
1238
              anchorControl="/1/@customSections.1/@contents.0"
1239
              rightmost="true"/>
1240
          <contents
1241
              xsi:type="propsheet:Radio"
1242
              name="myBorderLayoutRadio">
1243
            <text
1244
                overridedItemProviderText="Border Layout"/>
1245
            <modelElement
1246
                xsi:type="propsheet:IsFeatureOfTypeReference">
1247
              <feature
1248
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Layoutable/layout"/>
1249
              <isOfType
1250
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/BorderLayout"/>
1251
            </modelElement>
1252
          </contents>
1253
          <contents
1254
              xsi:type="propsheet:Radio"
1255
              name="myCustomLayoutRadio">
1256
            <layoutConstraints
1257
                xsi:type="propsheet:FormLayoutConstraints"
1258
                anchorControl="/1/@customSections.1/@contents.0/@contents.0/@contents.0"
1259
                relativePosition="TOP"/>
1260
            <text
1261
                overridedItemProviderText="Custom Layout"/>
1262
            <modelElement
1263
                xsi:type="propsheet:IsFeatureOfTypeReference">
1264
              <feature
1265
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Layoutable/layout"/>
1266
              <isOfType
1267
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/CustomLayout"/>
1268
            </modelElement>
1269
          </contents>
1270
          <contents
1271
              xsi:type="propsheet:Radio"
1272
              name="myGridLayoutRadio">
1273
            <layoutConstraints
1274
                xsi:type="propsheet:FormLayoutConstraints"
1275
                anchorControl="/1/@customSections.1/@contents.0/@contents.0/@contents.1"
1276
                relativePosition="TOP"/>
1277
            <text
1278
                overridedItemProviderText="Grid Layout"/>
1279
            <modelElement
1280
                xsi:type="propsheet:IsFeatureOfTypeReference">
1281
              <feature
1282
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Layoutable/layout"/>
1283
              <isOfType
1284
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/GridLayout"/>
1285
            </modelElement>
1286
          </contents>
1287
          <contents
1288
              xsi:type="propsheet:Radio"
1289
              name="myFlowLayoutRadio">
1290
            <layoutConstraints
1291
                xsi:type="propsheet:FormLayoutConstraints"
1292
                anchorControl="/1/@customSections.1/@contents.0/@contents.0/@contents.2"
1293
                relativePosition="TOP"/>
1294
            <text
1295
                overridedItemProviderText="Flow Layout"/>
1296
            <modelElement
1297
                xsi:type="propsheet:IsFeatureOfTypeReference">
1298
              <feature
1299
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Layoutable/layout"/>
1300
              <isOfType
1301
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/FlowLayout"/>
1302
            </modelElement>
1303
          </contents>
1304
          <contents
1305
              xsi:type="propsheet:Radio"
1306
              name="myStackLayoutRadio">
1307
            <layoutConstraints
1308
                xsi:type="propsheet:FormLayoutConstraints"
1309
                anchorControl="/1/@customSections.1/@contents.0/@contents.0/@contents.3"
1310
                relativePosition="TOP"/>
1311
            <text
1312
                overridedItemProviderText="Stack Layout"/>
1313
            <modelElement
1314
                xsi:type="propsheet:IsFeatureOfTypeReference">
1315
              <feature
1316
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Layoutable/layout"/>
1317
              <isOfType
1318
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/StackLayout"/>
1319
            </modelElement>
1320
          </contents>
1321
          <contents
1322
              xsi:type="propsheet:Radio"
1323
              name="myXYLayoutRadio">
1324
            <layoutConstraints
1325
                xsi:type="propsheet:FormLayoutConstraints"
1326
                anchorControl="/1/@customSections.1/@contents.0/@contents.0/@contents.4"
1327
                relativePosition="TOP"/>
1328
            <text
1329
                overridedItemProviderText="XY Layout"/>
1330
            <modelElement
1331
                xsi:type="propsheet:IsFeatureOfTypeReference">
1332
              <feature
1333
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Layoutable/layout"/>
1334
              <isOfType
1335
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/XYLayout"/>
1336
            </modelElement>
1337
          </contents>
1338
          <contents
1339
              xsi:type="propsheet:Radio"
1340
              name="myNoLayoutRadio">
1341
            <layoutConstraints
1342
                xsi:type="propsheet:FormLayoutConstraints"
1343
                anchorControl="/1/@customSections.1/@contents.0/@contents.0/@contents.5"
1344
                relativePosition="TOP"/>
1345
            <text
1346
                overridedItemProviderText="No Layout"/>
1347
            <modelElement
1348
                xsi:type="propsheet:IsFeatureOfTypeReference">
1349
              <feature
1350
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Layoutable/layout"/>
1351
            </modelElement>
1352
          </contents>
1353
        </contents>
1354
      </contents>
1355
      <contents
1356
          xsi:type="propsheet:Group"
1357
          name="myLayoutDataComposite">
1358
        <layoutConstraints
1359
            xsi:type="propsheet:FormLayoutConstraints"
1360
            anchorControl="/1/@customSections.1/@contents.0"
1361
            rightmost="true"/>
1362
        <contents
1363
            xsi:type="propsheet:Group"
1364
            name="myBorderLayoutDataGroup"
1365
            visibleOnlyForTargets="true">
1366
          <target
1367
              xsi:type="genmodel:GenClass"
1368
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/BorderLayoutData"/>
1369
          <text
1370
              overridedItemProviderText="Border Layout Data"/>
1371
          <contents
1372
              xsi:type="propsheet:Checkbox"
1373
              name="myIsVerticalCheckbox"
1374
              visibleOnlyForTargets="true">
1375
            <target
1376
                xsi:type="genmodel:GenClass"
1377
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/BorderLayoutData"/>
1378
            <text
1379
                overridedItemProviderText="vertical"/>
1380
            <modelElement>
1381
              <feature
1382
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/BorderLayoutData/vertical"/>
1383
            </modelElement>
1384
          </contents>
1385
        </contents>
1386
        <contents
1387
            xsi:type="propsheet:Group"
1388
            name="myXYLayoutDataGroup"
1389
            visibleOnlyForTargets="true">
1390
          <target
1391
              xsi:type="genmodel:GenClass"
1392
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/XYLayoutData"/>
1393
          <text
1394
              overridedItemProviderText="XY Layout Data"/>
1395
          <contents
1396
              xsi:type="propsheet:Group"
1397
              name="myXYDataTopLeftGroup">
1398
            <target
1399
                xsi:type="genmodel:GenClass"
1400
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/XYLayoutData"/>
1401
            <text
1402
                overridedItemProviderText="Top Left Position"/>
1403
            <contents
1404
                xsi:type="propsheet:Label"
1405
                name="myXYDataXLabel">
1406
              <text
1407
                  overridedItemProviderText="X"/>
1408
            </contents>
1409
            <contents
1410
                xsi:type="propsheet:Spin"
1411
                name="myXYDataXSpin"
1412
                max="999"
1413
                inc="1">
1414
              <layoutConstraints
1415
                  xsi:type="propsheet:FormLayoutConstraints"
1416
                  anchorControl="/1/@customSections.1/@contents.1/@contents.1/@contents.0/@contents.0"/>
1417
              <modelElement>
1418
                <feature
1419
                    href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/LabelOffsetFacet/x"/>
1420
              </modelElement>
1421
            </contents>
1422
            <contents
1423
                xsi:type="propsheet:Label"
1424
                name="myXYDataYLabel">
1425
              <layoutConstraints
1426
                  xsi:type="propsheet:FormLayoutConstraints"
1427
                  anchorControl="/1/@customSections.1/@contents.1/@contents.1/@contents.0/@contents.1"/>
1428
              <text
1429
                  overridedItemProviderText="Y"/>
1430
            </contents>
1431
            <contents
1432
                xsi:type="propsheet:Spin"
1433
                name="myXYDataYSpin"
1434
                max="999"
1435
                inc="1">
1436
              <layoutConstraints
1437
                  xsi:type="propsheet:FormLayoutConstraints"
1438
                  anchorControl="/1/@customSections.1/@contents.1/@contents.1/@contents.0/@contents.2"/>
1439
              <modelElement>
1440
                <feature
1441
                    href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/LabelOffsetFacet/y"/>
1442
              </modelElement>
1443
            </contents>
1444
            <modelElement>
1445
              <feature
1446
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/XYLayoutData/topLeft"/>
1447
            </modelElement>
1448
          </contents>
1449
          <contents
1450
              xsi:type="propsheet:Group"
1451
              name="myXYDataSizeGroup">
1452
            <target
1453
                xsi:type="genmodel:GenClass"
1454
                href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/XYLayoutData"/>
1455
            <layoutConstraints
1456
                xsi:type="propsheet:FormLayoutConstraints"
1457
                anchorControl="/1/@customSections.1/@contents.1/@contents.1/@contents.0"
1458
                relativePosition="TOP"/>
1459
            <text
1460
                overridedItemProviderText="Size Constraints"/>
1461
            <contents
1462
                xsi:type="propsheet:Label"
1463
                name="myXYDataSizeXLabel">
1464
              <text
1465
                  overridedItemProviderText="X"/>
1466
            </contents>
1467
            <contents
1468
                xsi:type="propsheet:Spin"
1469
                name="myXYDataSizeXSpin"
1470
                max="999"
1471
                inc="1">
1472
              <layoutConstraints
1473
                  xsi:type="propsheet:FormLayoutConstraints"
1474
                  anchorControl="/1/@customSections.1/@contents.1/@contents.1/@contents.1/@contents.0"/>
1475
              <modelElement>
1476
                <feature
1477
                    href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Dimension/dx"/>
1478
              </modelElement>
1479
            </contents>
1480
            <contents
1481
                xsi:type="propsheet:Label"
1482
                name="myXYDataSizeYLabel">
1483
              <layoutConstraints
1484
                  xsi:type="propsheet:FormLayoutConstraints"
1485
                  anchorControl="/1/@customSections.1/@contents.1/@contents.1/@contents.1/@contents.1"/>
1486
              <text
1487
                  overridedItemProviderText="Y"/>
1488
            </contents>
1489
            <contents
1490
                xsi:type="propsheet:Spin"
1491
                name="myXYDataSizeYSpin"
1492
                max="999"
1493
                inc="1">
1494
              <layoutConstraints
1495
                  xsi:type="propsheet:FormLayoutConstraints"
1496
                  anchorControl="/1/@customSections.1/@contents.1/@contents.1/@contents.1/@contents.2"/>
1497
              <modelElement>
1498
                <feature
1499
                    href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Dimension/dy"/>
1500
              </modelElement>
1501
            </contents>
1502
            <modelElement>
1503
              <feature
1504
                  href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/XYLayoutData/size"/>
1505
            </modelElement>
1506
          </contents>
1507
        </contents>
1508
        <modelElement>
1509
          <feature
1510
              href="../../../plugin/org.eclipse.gmf.graphdef/models/gmfgraph.genmodel#//gmfgraph/Layoutable/layoutData"/>
1511
        </modelElement>
1512
      </contents>
1513
    </customSections-->
1514
  </propsheet:PropertySectionContainer>
1515
</xmi:XMI>
(-)models/propsheet.ecore (+94 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ecore:EPackage xmi:version="2.0"
3
    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="propsheet"
5
    nsURI="http://www.eclipse.org/gmf/2007/GmfGraph/PropSheet" nsPrefix="propsheet">
6
  <eClassifiers xsi:type="ecore:EClass" name="PropertySectionContainer">
7
    <eStructuralFeatures xsi:type="ecore:EReference" name="customSections" upperBound="-1"
8
        eType="#//CustomPropertySection" containment="true"/>
9
  </eClassifiers>
10
  <eClassifiers xsi:type="ecore:EClass" name="CustomPropertySection" eSuperTypes="#//Group">
11
    <eStructuralFeatures xsi:type="ecore:EReference" name="genTab" eType="ecore:EClass platform:/plugin/org.eclipse.gmf.codegen/models/gmfgen.ecore#//GenCustomPropertyTab"/>
12
  </eClassifiers>
13
  <eClassifiers xsi:type="ecore:EClass" name="Sectionable" abstract="true">
14
    <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//Group"
15
        changeable="false" eOpposite="#//Group/contents"/>
16
    <eStructuralFeatures xsi:type="ecore:EReference" name="target" eType="ecore:EClass platform:/plugin/org.eclipse.emf.codegen.ecore/model/GenModel.ecore#//GenClassifier"/>
17
    <eStructuralFeatures xsi:type="ecore:EReference" name="layoutConstraints" eType="#//LayoutConstraints"
18
        containment="true"/>
19
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
20
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="visibleOnlyForTargets"
21
        eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/>
22
  </eClassifiers>
23
  <eClassifiers xsi:type="ecore:EClass" name="CustomControl" eSuperTypes="#//Sectionable">
24
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="implementationClass" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
25
  </eClassifiers>
26
  <eClassifiers xsi:type="ecore:EClass" name="Labeled" abstract="true" eSuperTypes="#//Sectionable">
27
    <eStructuralFeatures xsi:type="ecore:EReference" name="text" eType="#//Text" containment="true"/>
28
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="grayed" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/>
29
  </eClassifiers>
30
  <eClassifiers xsi:type="ecore:EClass" name="Iconed" eSuperTypes="#//Labeled">
31
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="iconPath" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
32
  </eClassifiers>
33
  <eClassifiers xsi:type="ecore:EClass" name="Group" eSuperTypes="#//Labeled">
34
    <eStructuralFeatures xsi:type="ecore:EReference" name="contents" upperBound="-1"
35
        eType="#//Sectionable" containment="true" eOpposite="#//Sectionable/parent"/>
36
    <eStructuralFeatures xsi:type="ecore:EReference" name="modelElement" eType="#//FeatureReference"
37
        containment="true"/>
38
  </eClassifiers>
39
  <eClassifiers xsi:type="ecore:EClass" name="Label" eSuperTypes="#//Iconed"/>
40
  <eClassifiers xsi:type="ecore:EClass" name="Checkbox" eSuperTypes="#//Iconed">
41
    <eStructuralFeatures xsi:type="ecore:EReference" name="modelElement" eType="#//BooleanCondition"
42
        containment="true"/>
43
  </eClassifiers>
44
  <eClassifiers xsi:type="ecore:EClass" name="Radio" eSuperTypes="#//Iconed">
45
    <eStructuralFeatures xsi:type="ecore:EReference" name="modelElement" eType="#//BooleanCondition"
46
        containment="true"/>
47
  </eClassifiers>
48
  <eClassifiers xsi:type="ecore:EClass" name="Spin" eSuperTypes="#//Labeled">
49
    <eStructuralFeatures xsi:type="ecore:EReference" name="modelElement" eType="#//IntValue"
50
        containment="true"/>
51
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="min" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt"/>
52
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="max" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt"
53
        defaultValueLiteral="999"/>
54
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="inc" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt"
55
        defaultValueLiteral="1"/>
56
  </eClassifiers>
57
  <eClassifiers xsi:type="ecore:EClass" name="TextField" eSuperTypes="#//Labeled">
58
    <eStructuralFeatures xsi:type="ecore:EReference" name="modelElement" eType="#//StringValue"
59
        containment="true"/>
60
  </eClassifiers>
61
  <eClassifiers xsi:type="ecore:EClass" name="LayoutConstraints" abstract="true"/>
62
  <eClassifiers xsi:type="ecore:EClass" name="FormLayoutConstraints" eSuperTypes="#//LayoutConstraints">
63
    <eStructuralFeatures xsi:type="ecore:EReference" name="anchorControl" eType="#//Sectionable"/>
64
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="relativePosition" eType="#//Positions"/>
65
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="rightmost" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/>
66
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="lowermost" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/>
67
  </eClassifiers>
68
  <eClassifiers xsi:type="ecore:EEnum" name="Positions">
69
    <eLiterals name="LEFT"/>
70
    <eLiterals name="RIGHT" value="1"/>
71
    <eLiterals name="TOP" value="2"/>
72
    <eLiterals name="BOTTOM" value="3"/>
73
  </eClassifiers>
74
  <eClassifiers xsi:type="ecore:EClass" name="Text">
75
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="overridedItemProviderText"
76
        eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
77
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="createLabel" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"
78
        defaultValueLiteral="true"/>
79
  </eClassifiers>
80
  <eClassifiers xsi:type="ecore:EClass" name="Reference" abstract="true"/>
81
  <eClassifiers xsi:type="ecore:EClass" name="FeatureReference" eSuperTypes="#//Reference">
82
    <eStructuralFeatures xsi:type="ecore:EReference" name="feature" lowerBound="1"
83
        eType="ecore:EClass platform:/plugin/org.eclipse.emf.codegen.ecore/model/GenModel.ecore#//GenFeature"/>
84
  </eClassifiers>
85
  <eClassifiers xsi:type="ecore:EClass" name="BooleanCondition" eSuperTypes="#//FeatureReference"/>
86
  <eClassifiers xsi:type="ecore:EClass" name="IntValue" eSuperTypes="#//FeatureReference"/>
87
  <eClassifiers xsi:type="ecore:EClass" name="StringValue" eSuperTypes="#//FeatureReference"/>
88
  <eClassifiers xsi:type="ecore:EClass" name="IsFeatureOfTypeReference" eSuperTypes="#//BooleanCondition">
89
    <eStructuralFeatures xsi:type="ecore:EReference" name="isOfType" eType="ecore:EClass platform:/plugin/org.eclipse.emf.codegen.ecore/model/GenModel.ecore#//GenClass"/>
90
  </eClassifiers>
91
  <eClassifiers xsi:type="ecore:EClass" name="IsFeatureIsOfKindReference" eSuperTypes="#//BooleanCondition">
92
    <eStructuralFeatures xsi:type="ecore:EReference" name="isOfValue" eType="ecore:EClass platform:/plugin/org.eclipse.emf.codegen.ecore/model/GenModel.ecore#//GenEnumLiteral"/>
93
  </eClassifiers>
94
</ecore:EPackage>
(-)src-extra/org/eclipse/gmf/graphdef/editor/sheet/CustomLayoutPropertySection.java (+2014 lines)
Added Link Here
1
/*
2
 *  Copyright (c) 2007 Borland Software Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Borland Software Corporation - initial API and implementation
10
 */
11
package org.eclipse.gmf.graphdef.editor.sheet;
12
13
import java.util.Iterator;
14
15
import org.eclipse.emf.common.util.EList;
16
import org.eclipse.gmf.gmfgraph.Alignment;
17
import org.eclipse.gmf.gmfgraph.BorderLayout;
18
import org.eclipse.gmf.gmfgraph.BorderLayoutData;
19
import org.eclipse.gmf.gmfgraph.CustomLayout;
20
import org.eclipse.gmf.gmfgraph.CustomLayoutData;
21
import org.eclipse.gmf.gmfgraph.Dimension;
22
import org.eclipse.gmf.gmfgraph.Figure;
23
import org.eclipse.gmf.gmfgraph.FlowLayout;
24
import org.eclipse.gmf.gmfgraph.GMFGraphFactory;
25
import org.eclipse.gmf.gmfgraph.GridLayout;
26
import org.eclipse.gmf.gmfgraph.GridLayoutData;
27
import org.eclipse.gmf.gmfgraph.Layout;
28
import org.eclipse.gmf.gmfgraph.LayoutData;
29
import org.eclipse.gmf.gmfgraph.Layoutable;
30
import org.eclipse.gmf.gmfgraph.Point;
31
import org.eclipse.gmf.gmfgraph.XYLayoutData;
32
import org.eclipse.swt.SWT;
33
import org.eclipse.swt.custom.CLabel;
34
import org.eclipse.swt.widgets.Button;
35
import org.eclipse.swt.widgets.Composite;
36
import org.eclipse.swt.widgets.Group;
37
import org.eclipse.swt.widgets.Spinner;
38
import org.eclipse.swt.widgets.Text;
39
import org.eclipse.swt.widgets.Widget;
40
import org.eclipse.ui.forms.widgets.ExpandableComposite;
41
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
42
43
public abstract class CustomLayoutPropertySection extends AbstractCustomSectionParent {
44
45
	// customizable:
46
	
47
	public static abstract class RunnableWithLayoutable implements Runnable {
48
49
		private Layoutable myLayoutable;
50
51
		public Layoutable getLayoutable() {
52
			return myLayoutable;
53
		}
54
55
		public void setTargetLayoutable(Layoutable shape) {
56
			myLayoutable = shape;
57
		}
58
	}
59
60
	protected void modifyModel(RunnableWithLayoutable runnable, String commandName) {
61
		java.util.ArrayList commands = new java.util.ArrayList();
62
		for (java.util.Iterator it = getSavedSelection().iterator(); it.hasNext();) {
63
			final org.eclipse.emf.ecore.EObject next = (org.eclipse.emf.ecore.EObject) it.next();
64
			if (next instanceof Layoutable) {
65
				final Layoutable layoutable = (Layoutable) next;
66
				runnable.setTargetLayoutable(layoutable);
67
				commands.add(createCommand(commandName, next, runnable));
68
			}
69
		}
70
		executeAsCompositeCommand(commandName, commands);
71
		refresh();
72
	}
73
74
	// TODO: move it out into the template
75
	
76
	public ModelUpdater createModelUpdater() {
77
		return new ModelUpdater() {
78
			public void applyChangesFrom(Widget widget, int kind) {
79
				CustomLayoutPropertySection.this.applyChangesFrom(widget, kind);
80
			}
81
		};
82
	}
83
84
	private static final int FLOW_FORCE_SINGLE_LINE = 102;
85
86
	private static final int FLOW_MATCH_MINOR_SIZE = 103;
87
88
	private static final int GRID_EQUAL_WIDTH = 104;
89
90
	private static final int GRID_DATA_GRAB_HORIZONTAL = 105;
91
92
	private static final int GRID_DATA_GRAB_VERTICAL = 106;
93
94
	private static final int BORDER_SPACING_HORIZONTAL = 201;
95
96
	private static final int BORDER_SPACING_VERTICAL = 202;
97
98
	private static final int GRID_NUM_COLUMNS = 204;
99
100
	private static final int GRID_MARGINS_HORIZONTAL = 205;
101
102
	private static final int GRID_MARGINS_VERTICAL = 206;
103
104
	private static final int GRID_SPACING_HORIZONTAL = 207;
105
106
	private static final int GRID_SPACING_VERTICAL = 208;
107
108
	private static final int XY_SIZE_X = 211;
109
110
	private static final int XY_SIZE_Y = 212;
111
112
	private static final int XY_TOPLEFT_X = 213;
113
114
	private static final int XY_TOPLEFT_Y = 214;
115
116
	private static final int FLOW_MINOR_SPACING = 221;
117
118
	private static final int FLOW_MAJOR_SPACING = 222;
119
120
	private static final int GRID_DATA_SPAN_HORIZONTAL = 231;
121
122
	private static final int GRID_DATA_SPAN_VERTICAL = 232;
123
124
	private static final int LAYOUT_BORDER = 301;
125
126
	private static final int LAYOUT_CUSTOM = 302;
127
128
	private static final int LAYOUT_FLOW = 303;
129
130
	private static final int LAYOUT_GRID = 304;
131
132
	private static final int LAYOUT_STACK = 305;
133
134
	private static final int LAYOUT_XY = 306;
135
136
	private static final int LAYOUT_NONE = -1;
137
138
	private static final int ALIGNMENT_NORTH = 1;
139
140
	private static final int ALIGNMENT_CENTER = 2;
141
142
	private static final int ALIGNMENT_FILL = 2;
143
144
	private static final int ALIGNMENT_SOUTH = 3;
145
146
	private static final int ALIGNMENT_WEST = 4;
147
148
	private static final int ALIGNMENT_EAST = 5;
149
150
	private static final int FLOW_MINOR_ALIGNMENT_BEGINNING = 321;
151
152
	private static final int FLOW_MINOR_ALIGNMENT_CENTER = 322;
153
154
	private static final int FLOW_MINOR_ALIGNMENT_END = 323;
155
156
	private static final int FLOW_MINOR_ALIGNMENT_EAST = 324;
157
158
	private static final int FLOW_MINOR_ALIGNMENT_WEST = 325;
159
160
	private static final int FLOW_MAJOR_ALIGNMENT_BEGINNING = 326;
161
162
	private static final int FLOW_MAJOR_ALIGNMENT_CENTER = 327;
163
164
	private static final int FLOW_MAJOR_ALIGNMENT_END = 328;
165
166
	private static final int FLOW_MAJOR_ALIGNMENT_EAST = 329;
167
168
	private static final int FLOW_MAJOR_ALIGNMENT_WEST = 330;
169
170
	private static final int GRID_DATA_ALIGNMENT_NORTH = 341;
171
172
	private static final int GRID_DATA_ALIGNMENT_EAST = 342;
173
174
	private static final int GRID_DATA_ALIGNMENT_CENTER = 343;
175
176
	private static final int GRID_DATA_ALIGNMENT_WEST = 344;
177
178
	private static final int GRID_DATA_ALIGNMENT_SOUTH = 345;
179
180
	private static final int CUSTOM_BUNDLE_NAME = 401;
181
182
	private static final int CUSTOM_QUALIFIED_CLASSNAME = 402;
183
184
	private static final int CUSTOM_DATA_BUNDLE_NAME = 403;
185
186
	private static final int CUSTOM_DATA_QUALIFIED_CLASSNAME = 404;
187
188
	private Composite mySectionComposite;
189
190
	private Composite myExpandBar;
191
192
	private Button myLayout_Border;
193
194
	private ExpandableComposite myLayout_Border_Group;
195
196
	private Spinner myBorderLayoutSpacingHorizontal;
197
198
	private Spinner myBorderLayoutSpacingVertical;
199
200
	private Button myLayout_Custom;
201
202
	private ExpandableComposite myLayout_Custom_Group;
203
204
	private Text myCustomLayoutBundleName;
205
206
	private Text myCustomLayoutQualifiedClassName;
207
208
	private Text myCustomLayoutDataBundleName;
209
210
	private Text myCustomLayoutDataQualifiedClassName;
211
212
	private Button myLayout_Grid;
213
214
	private ExpandableComposite myLayout_Grid_Group;
215
216
	private Button myGridEqualWidth;
217
218
	private Spinner myGridLayoutNumColumns;
219
220
	private Button myLayout_Flow;
221
222
	private ExpandableComposite myLayout_Flow_Group;
223
224
	private Button myFlowLayoutForceSingleLineCheckbox;
225
226
	private Button myLayout_Stack;
227
228
	private Button myLayout_XY;
229
230
	private Button myLayout_None;
231
232
	private Spinner myGridLayoutMarginsHorizontal;
233
234
	private Spinner myGridLayoutMarginsVertical;
235
236
	private Spinner myGridLayoutSpacingHorizontal;
237
238
	private Spinner myGridLayoutSpacingVertical;
239
240
	private Button myFlowLayoutMatchMinorSizeCheckbox;
241
242
	private Group myLayoutData_Border_Group;
243
244
	private Group myLayoutData_Custom_Group;
245
246
	private Group myLayoutData_Grid_Group;
247
248
	private Group myLayoutData_XY_Group;
249
250
	private Button myBorderDataAlignment_North;
251
252
	private Button myBorderDataAlignment_Center;
253
254
	private Button myBorderDataAlignment_South;
255
256
	private Button myBorderDataAlignment_West;
257
258
	private Button myBorderDataAlignment_East;
259
260
	private Spinner myXYLayoutSizeX;
261
262
	private Spinner myXYLayoutSizeY;
263
264
	private Spinner myXYLayoutTopLeftX;
265
266
	private Spinner myXYLayoutTopLeftY;
267
268
	private Spinner myFlowMinorSpacing;
269
270
	private Spinner myFlowMajorSpacing;
271
272
	private Button myFlowMinorAlignment_Beginning;
273
274
	private Button myFlowMinorAlignment_Center;
275
276
	private Button myFlowMinorAlignment_End;
277
278
	private Button myFlowMinorAlignment_East;
279
280
	private Button myFlowMinorAlignment_West;
281
282
	private Button myFlowMajorAlignment_Beginning;
283
284
	private Button myFlowMajorAlignment_Center;
285
286
	private Button myFlowMajorAlignment_End;
287
288
	private Button myFlowMajorAlignment_East;
289
290
	private Button myFlowMajorAlignment_West;
291
292
	private Button myGridLayoutDataGrabHorizontal;
293
294
	private Button myGridLayoutDataGrabVertical;
295
296
	private Spinner myGridLayoutDataSpanHorizontal;
297
298
	private Spinner myGridLayoutDataSpanVertical;
299
300
	private Button myGridLayoutDataAlignment_North;
301
302
	private Button myGridLayoutDataAlignment_East;
303
304
	private Button myGridLayoutDataAlignment_Center;
305
306
	private Button myGridLayoutDataAlignment_West;
307
308
	private Button myGridLayoutDataAlignment_South;
309
310
	public void doCreateControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
311
312
		mySectionComposite = getWidgetFactory().createFlatFormComposite(parent);
313
314
		Group layoutGroup = createGroup(mySectionComposite, getLayoutLabel());
315
316
		myLayout_Border = createRadio(layoutGroup, getBorderLayoutLabel(), LAYOUT_BORDER, null, 25);
317
		myLayout_Custom = createRadio(layoutGroup, getCustomLayoutLabel(), LAYOUT_CUSTOM, myLayout_Border, 25);
318
		myLayout_Grid = createRadio(layoutGroup, getGridLayoutLabel(), LAYOUT_GRID, myLayout_Custom, 25);
319
		myLayout_Flow = createRadio(layoutGroup, getFlowLayoutLabel(), LAYOUT_FLOW, myLayout_Grid, 25);
320
		myLayout_Stack = createRadio(layoutGroup, getStackLayoutLabel(), LAYOUT_STACK, myLayout_Flow, 25);
321
		myLayout_XY = createRadio(layoutGroup, getXYLayoutLabel(), LAYOUT_XY, myLayout_Stack, 25);
322
		myLayout_None = createRadio(layoutGroup, getNoLayoutLabel(), LAYOUT_NONE, myLayout_XY, 25);
323
324
		// myExpandBar = createLayoutParamsExpandBar(myLayoutGroup);
325
		// ScrolledComposite sc = createScrolledComposite(myLayoutGroup);
326
		//myExpandBar = createFlatFormComposite(layoutGroup, false);
327
		myExpandBar = createFlatFormComposite(layoutGroup, 25);
328
329
		myLayout_Border_Group = createLayoutParamsExpandableComposite(myExpandBar, getBorderLayoutLabel(), null, false);
330
		Group layoutBorderContainer = createGroup(myLayout_Border_Group, getBorderLayoutSpacingLabel(), true);
331
		CLabel spacingHorizontal = createLabelWidget(layoutBorderContainer, getBorderSpacingHorizonalLabel(), null);
332
		myBorderLayoutSpacingHorizontal = createSpinnerWidget(layoutBorderContainer, spacingHorizontal, null, false, BORDER_SPACING_HORIZONTAL, true);
333
		CLabel spacingVertical = createLabelWidget(layoutBorderContainer, getBorderSpacingVerticalLabel(), myBorderLayoutSpacingHorizontal, null);
334
		myBorderLayoutSpacingVertical = createSpinnerWidget(layoutBorderContainer, spacingVertical, null, true, BORDER_SPACING_VERTICAL, false);
335
		myLayout_Border_Group.setClient(layoutBorderContainer);
336
337
		myLayout_Flow_Group = createLayoutParamsExpandableComposite(myExpandBar, getFlowLayoutLabel(), myLayout_Border_Group, false);
338
		Group layoutFlowContainer = createGroup(myLayout_Flow_Group, getLayoutParamsLabel(), true);
339
		myFlowLayoutForceSingleLineCheckbox = createCheckbox(layoutFlowContainer, getFlowForceSingleLinePropertyNameLabel(), null, null, FLOW_FORCE_SINGLE_LINE);
340
		myFlowLayoutMatchMinorSizeCheckbox = createCheckbox(layoutFlowContainer, getMatchMinorSizePropertyNameLabel(), null, myFlowLayoutForceSingleLineCheckbox, FLOW_MATCH_MINOR_SIZE);
341
		Group spacingGroup = createGroup(layoutFlowContainer, getFlowLayoutSpacingsLabel(), null, myFlowLayoutForceSingleLineCheckbox);
342
		CLabel minorSpacing = createLabelWidget(spacingGroup, getFlowMinorSpacingLabel(), null, null);
343
		myFlowMinorSpacing = createSpinnerWidget(spacingGroup, minorSpacing, null, false, FLOW_MINOR_SPACING, true);
344
		CLabel majorSpacing = createLabelWidget(spacingGroup, getFlowMajorSpacingLabel(), myFlowMinorSpacing, null);
345
		myFlowMajorSpacing = createSpinnerWidget(spacingGroup, majorSpacing, null, true, FLOW_MAJOR_SPACING, false);
346
		Group minorAlignGroup = createGroup(layoutFlowContainer, getFlowMinorAlignmentLabel(), null, spacingGroup);
347
		myFlowMinorAlignment_Beginning = createRadio(minorAlignGroup, null, getAlignmentNorthLabel(), FLOW_MINOR_ALIGNMENT_BEGINNING, 33, 65, 0, false);
348
		myFlowMinorAlignment_East = createRadio(minorAlignGroup, null, getAlignmentEastLabel(), FLOW_MINOR_ALIGNMENT_EAST, 0, 33, myFlowMinorAlignment_Beginning, SWT.DEFAULT, false);
349
		myFlowMinorAlignment_Center = createRadio(minorAlignGroup, null, getAlignmentCenterLabel(), FLOW_MINOR_ALIGNMENT_CENTER, 33, 65, myFlowMinorAlignment_Beginning, SWT.DEFAULT, false);
350
		myFlowMinorAlignment_West = createRadio(minorAlignGroup, null, getAlignmentWestLabel(), FLOW_MINOR_ALIGNMENT_WEST, 65, 100, myFlowMinorAlignment_Beginning, SWT.DEFAULT, false);
351
		myFlowMinorAlignment_End = createRadio(minorAlignGroup, null, getAlignmentSouthLabel(), FLOW_MINOR_ALIGNMENT_END, 33, 65, myFlowMinorAlignment_Center, SWT.DEFAULT, true);
352
		Group majorAlignGroup = createGroup(layoutFlowContainer, getFlowMajorAlignmentLabel(), minorAlignGroup, spacingGroup);
353
		myFlowMajorAlignment_Beginning = createRadio(majorAlignGroup, null, getAlignmentNorthLabel(), FLOW_MAJOR_ALIGNMENT_BEGINNING, 33, 65, 0, false);
354
		myFlowMajorAlignment_East = createRadio(majorAlignGroup, null, getAlignmentEastLabel(), FLOW_MAJOR_ALIGNMENT_EAST, 0, 33, myFlowMajorAlignment_Beginning, SWT.DEFAULT, false);
355
		myFlowMajorAlignment_Center = createRadio(majorAlignGroup, null, getAlignmentCenterLabel(), FLOW_MAJOR_ALIGNMENT_CENTER, 33, 65, myFlowMajorAlignment_Beginning, SWT.DEFAULT, false);
356
		myFlowMajorAlignment_West = createRadio(majorAlignGroup, null, getAlignmentWestLabel(), FLOW_MAJOR_ALIGNMENT_WEST, 65, 100, myFlowMajorAlignment_Beginning, SWT.DEFAULT, false);
357
		myFlowMajorAlignment_End = createRadio(majorAlignGroup, null, getAlignmentSouthLabel(), FLOW_MAJOR_ALIGNMENT_END, 33, 65, myFlowMajorAlignment_Center, SWT.DEFAULT, true);
358
		myLayout_Flow_Group.setClient(layoutFlowContainer);
359
360
		myLayout_Grid_Group = createLayoutParamsExpandableComposite(myExpandBar, getGridLayoutLabel(), myLayout_Flow_Group, false);
361
		boolean isGridEnabled = false;
362
		Group layoutGridContainer = createGroup(myLayout_Grid_Group, getLayoutParamsLabel(), true);
363
		CLabel numColumns = createLabelWidget(layoutGridContainer, getNumColumnsLabel(), null, null);
364
		numColumns.setEnabled(isGridEnabled);
365
		myGridLayoutNumColumns = createSpinnerWidget(layoutGridContainer, numColumns, null, false, GRID_NUM_COLUMNS, false);
366
		myGridLayoutNumColumns.setEnabled(isGridEnabled);
367
		myGridEqualWidth = createCheckbox(layoutGridContainer, getEqualWidthLabel(), numColumns, null, GRID_EQUAL_WIDTH);
368
		myGridEqualWidth.setEnabled(isGridEnabled);
369
		Group gridMargins = createGroup(layoutGridContainer, getGridMarginsLabel(), null, myGridEqualWidth);
370
		CLabel marginsHorizontal = createLabelWidget(gridMargins, getMarginsHorizonalLabel(), null, null);
371
		marginsHorizontal.setEnabled(isGridEnabled);
372
		myGridLayoutMarginsHorizontal = createSpinnerWidget(gridMargins, marginsHorizontal, null, false, GRID_MARGINS_HORIZONTAL, true);
373
		myGridLayoutMarginsHorizontal.setEnabled(isGridEnabled);
374
		CLabel marginsVertical = createLabelWidget(gridMargins, getMarginsVerticalLabel(), myGridLayoutMarginsHorizontal, null);
375
		marginsVertical.setEnabled(isGridEnabled);
376
		myGridLayoutMarginsVertical = createSpinnerWidget(gridMargins, marginsVertical, null, true, GRID_MARGINS_VERTICAL, false);
377
		myGridLayoutMarginsVertical.setEnabled(isGridEnabled);
378
		Group gridSpacings = createGroup(layoutGridContainer, getGridSpacingsLabel(), null, gridMargins);
379
		CLabel gridSpacingHorizontal = createLabelWidget(gridSpacings, getGridSpacingHorizonalLabel(), null, null);
380
		gridSpacingHorizontal.setEnabled(isGridEnabled);
381
		myGridLayoutSpacingHorizontal = createSpinnerWidget(gridSpacings, gridSpacingHorizontal, null, false, GRID_SPACING_HORIZONTAL, true);
382
		myGridLayoutSpacingHorizontal.setEnabled(isGridEnabled);
383
		CLabel gridSpacingVertical = createLabelWidget(gridSpacings, getGridSpacingVerticalLabel(), myGridLayoutSpacingHorizontal, null);
384
		gridSpacingVertical.setEnabled(isGridEnabled);
385
		myGridLayoutSpacingVertical = createSpinnerWidget(gridSpacings, gridSpacingVertical, null, true, GRID_SPACING_VERTICAL, false);
386
		myGridLayoutSpacingVertical.setEnabled(isGridEnabled);
387
		myLayout_Grid_Group.setClient(layoutGridContainer);
388
389
		myLayout_Custom_Group = createLayoutParamsExpandableComposite(myExpandBar, getCustomLayoutLabel(), myLayout_Grid_Group, true);
390
		boolean isCustomEnabled = false;
391
		Group layoutCustomContainer = createGroup(myLayout_Custom_Group, getLayoutParamsLabel(), true);
392
		CLabel bundleName = createLabelWidget(layoutCustomContainer, getBundleNameLabel(), null);
393
		bundleName.setEnabled(isCustomEnabled);
394
		myCustomLayoutBundleName = createText(layoutCustomContainer, bundleName, null, "", CUSTOM_BUNDLE_NAME);
395
		myCustomLayoutBundleName.setEnabled(isCustomEnabled);
396
		CLabel qualifierClassName = createLabelWidget(layoutCustomContainer, getQualifiedClassNameLabel(), null, bundleName);
397
		qualifierClassName.setEnabled(isCustomEnabled);
398
		myCustomLayoutQualifiedClassName = createText(layoutCustomContainer, qualifierClassName, myCustomLayoutBundleName, "", CUSTOM_QUALIFIED_CLASSNAME);
399
		myCustomLayoutQualifiedClassName.setEnabled(isCustomEnabled);
400
		myLayout_Custom_Group.setClient(layoutCustomContainer);
401
402
		// sc.setContent(myExpandBar);
403
		// sc.setMinSize(myExpandBar.computeSize(SWT.DEFAULT, SWT.DEFAULT));
404
		// sc.setExpandHorizontal(true);
405
		// sc.setExpandVertical(true);
406
407
		myLayoutData_Border_Group = createGroup(mySectionComposite, getBorderLayoutDataLabel(), layoutGroup, null);
408
		myBorderDataAlignment_North = createRadio(myLayoutData_Border_Group, null, getAlignmentNorthLabel(), ALIGNMENT_NORTH, 33, 65, 0, false);
409
		myBorderDataAlignment_East = createRadio(myLayoutData_Border_Group, null, getAlignmentEastLabel(), ALIGNMENT_EAST, 0, 33, myBorderDataAlignment_North, SWT.DEFAULT, false);
410
		myBorderDataAlignment_Center = createRadio(myLayoutData_Border_Group, null, getAlignmentCenterLabel(), ALIGNMENT_CENTER, 33, 65, myBorderDataAlignment_North, SWT.DEFAULT, false);
411
		myBorderDataAlignment_West = createRadio(myLayoutData_Border_Group, null, getAlignmentWestLabel(), ALIGNMENT_WEST, 65, 100, myBorderDataAlignment_North, SWT.DEFAULT, false);
412
		myBorderDataAlignment_South = createRadio(myLayoutData_Border_Group, null, getAlignmentSouthLabel(), ALIGNMENT_SOUTH, 33, 65, myBorderDataAlignment_Center, SWT.DEFAULT, true);
413
414
		myLayoutData_Custom_Group = createGroup(mySectionComposite, getCustomLayoutDataLabel(), layoutGroup, null);
415
		boolean isCustomDataEnabled = false;
416
		CLabel dataBundleName = createLabelWidget(myLayoutData_Custom_Group, getBundleNameLabel(), null);
417
		dataBundleName.setEnabled(isCustomDataEnabled);
418
		myCustomLayoutDataBundleName = createText(myLayoutData_Custom_Group, dataBundleName, null, "", CUSTOM_DATA_BUNDLE_NAME);
419
		myCustomLayoutDataBundleName.setEnabled(isCustomDataEnabled);
420
		CLabel dataQualifierClassName = createLabelWidget(myLayoutData_Custom_Group, getQualifiedClassNameLabel(), null, dataBundleName);
421
		dataQualifierClassName.setEnabled(isCustomDataEnabled);
422
		myCustomLayoutDataQualifiedClassName = createText(myLayoutData_Custom_Group, dataQualifierClassName, myCustomLayoutDataBundleName, "", CUSTOM_DATA_QUALIFIED_CLASSNAME);
423
		myCustomLayoutDataQualifiedClassName.setEnabled(isCustomDataEnabled);
424
425
		myLayoutData_Grid_Group = createGroup(mySectionComposite, getGridLayoutDataLabel(), layoutGroup, null);
426
		boolean isGridDataEnabled = false;
427
		myGridLayoutDataGrabHorizontal = createCheckbox(myLayoutData_Grid_Group, getGridDataGrabHorizontalLabel(), null, null, GRID_DATA_GRAB_HORIZONTAL);
428
		myGridLayoutDataGrabHorizontal.setEnabled(isGridDataEnabled);
429
		myGridLayoutDataGrabVertical = createCheckbox(myLayoutData_Grid_Group, getGridDataGrabVerticalLabel(), null, myGridLayoutDataGrabHorizontal, GRID_DATA_GRAB_VERTICAL);
430
		myGridLayoutDataGrabVertical.setEnabled(isGridDataEnabled);
431
		Group spanGroup = createGroup(myLayoutData_Grid_Group, getGridDataSpanLabel(), null, myGridLayoutDataGrabVertical);
432
		CLabel spanHorizontal = createLabelWidget(spanGroup, getGridDataSpanHorizontalLabel(), null, null);
433
		spanHorizontal.setEnabled(isGridDataEnabled);
434
		myGridLayoutDataSpanHorizontal = createSpinnerWidget(spanGroup, spanHorizontal, null, false, GRID_DATA_SPAN_HORIZONTAL, true);
435
		myGridLayoutDataSpanHorizontal.setEnabled(isGridDataEnabled);
436
		CLabel spanVertical = createLabelWidget(spanGroup, getGridDataSpanVerticalLabel(), myGridLayoutDataSpanHorizontal, null);
437
		spanVertical.setEnabled(isGridDataEnabled);
438
		myGridLayoutDataSpanVertical = createSpinnerWidget(spanGroup, spanVertical, null, true, GRID_DATA_SPAN_VERTICAL, false);
439
		myGridLayoutDataSpanVertical.setEnabled(isGridDataEnabled);
440
		Group gridDataAlignGroup = createGroup(myLayoutData_Grid_Group, getGridDataAlignmentLabel(), null, spanGroup);
441
		myGridLayoutDataAlignment_North = createRadio(gridDataAlignGroup, null, getAlignmentNorthLabel(), GRID_DATA_ALIGNMENT_NORTH, 33, 65, 0, false);
442
		myGridLayoutDataAlignment_North.setEnabled(isGridDataEnabled);
443
		myGridLayoutDataAlignment_East = createRadio(gridDataAlignGroup, null, getAlignmentEastLabel(), GRID_DATA_ALIGNMENT_EAST, 0, 33, myGridLayoutDataAlignment_North, SWT.DEFAULT, false);
444
		myGridLayoutDataAlignment_East.setEnabled(isGridDataEnabled);
445
		myGridLayoutDataAlignment_Center = createRadio(gridDataAlignGroup, null, getAlignmentCenterLabel(), GRID_DATA_ALIGNMENT_CENTER, 33, 65, myGridLayoutDataAlignment_North, SWT.DEFAULT, false);
446
		myGridLayoutDataAlignment_Center.setEnabled(isGridDataEnabled);
447
		myGridLayoutDataAlignment_West = createRadio(gridDataAlignGroup, null, getAlignmentWestLabel(), GRID_DATA_ALIGNMENT_WEST, 65, 100, myGridLayoutDataAlignment_North, SWT.DEFAULT, false);
448
		myGridLayoutDataAlignment_West.setEnabled(isGridDataEnabled);
449
		myGridLayoutDataAlignment_South = createRadio(gridDataAlignGroup, null, getAlignmentSouthLabel(), GRID_DATA_ALIGNMENT_SOUTH, 33, 65, myGridLayoutDataAlignment_Center, SWT.DEFAULT, true);
450
		myGridLayoutDataAlignment_South.setEnabled(isGridDataEnabled);
451
452
		myLayoutData_XY_Group = createGroup(mySectionComposite, getXYLayoutDataLabel(), layoutGroup, null);
453
		Group sizeGroup = createGroup(myLayoutData_XY_Group, getXYDataSizeLabel(), null, null);
454
		CLabel xSize = createLabelWidget(sizeGroup, getXSizeLabel(), null, null);
455
		myXYLayoutSizeX = createSpinnerWidget(sizeGroup, xSize, null, false, XY_SIZE_X, true);
456
		CLabel ySize = createLabelWidget(sizeGroup, getYSizeLabel(), myXYLayoutSizeX, null);
457
		myXYLayoutSizeY = createSpinnerWidget(sizeGroup, ySize, null, true, XY_SIZE_Y, false);
458
		Group topLeftGroup = createGroup(myLayoutData_XY_Group, getXYDataTopLeftLabel(), null, sizeGroup);
459
		CLabel xTopLeft = createLabelWidget(topLeftGroup, getXTopLeftLabel(), null, null);
460
		myXYLayoutTopLeftX = createSpinnerWidget(topLeftGroup, xTopLeft, null, false, XY_TOPLEFT_X, true);
461
		CLabel yTopLeft = createLabelWidget(topLeftGroup, getYTopLeftLabel(), myXYLayoutTopLeftX, null);
462
		myXYLayoutTopLeftY = createSpinnerWidget(topLeftGroup, yTopLeft, null, true, XY_TOPLEFT_Y, false);
463
464
		myLayout_Border_Group.addExpansionListener(getExpansionListener(myExpandBar));
465
		myLayout_Flow_Group.addExpansionListener(getExpansionListener(myExpandBar));
466
		myLayout_Grid_Group.addExpansionListener(getExpansionListener(myExpandBar));
467
		myLayout_Custom_Group.addExpansionListener(getExpansionListener(myExpandBar));
468
469
		getListener().startListeningTo(myLayout_Border);
470
		getListener().startListeningTo(myLayout_Custom);
471
		getListener().startListeningTo(myLayout_Flow);
472
		getListener().startListeningTo(myLayout_Grid);
473
		getListener().startListeningTo(myLayout_Stack);
474
		getListener().startListeningTo(myLayout_XY);
475
		getListener().startListeningTo(myLayout_None);
476
		getListener().startListeningTo(myFlowLayoutForceSingleLineCheckbox);
477
		getListener().startListeningTo(myFlowLayoutMatchMinorSizeCheckbox);
478
		getListener().startListeningTo(myFlowMinorSpacing);
479
		getListener().startListeningTo(myFlowMajorSpacing);
480
		getListener().startListeningTo(myFlowMinorAlignment_Center);
481
		getListener().startListeningTo(myFlowMinorAlignment_Beginning);
482
		getListener().startListeningTo(myFlowMinorAlignment_End);
483
		getListener().startListeningTo(myFlowMinorAlignment_East);
484
		getListener().startListeningTo(myFlowMinorAlignment_West);
485
		getListener().startListeningTo(myFlowMajorAlignment_Center);
486
		getListener().startListeningTo(myFlowMajorAlignment_Beginning);
487
		getListener().startListeningTo(myFlowMajorAlignment_End);
488
		getListener().startListeningTo(myFlowMajorAlignment_East);
489
		getListener().startListeningTo(myFlowMajorAlignment_West);
490
		getListener().startListeningTo(myBorderLayoutSpacingHorizontal);
491
		getListener().startListeningTo(myBorderLayoutSpacingVertical);
492
		getListener().startListeningTo(myCustomLayoutBundleName);
493
		getListener().startListeningTo(myCustomLayoutQualifiedClassName);
494
		getListener().startListeningTo(myGridEqualWidth);
495
		getListener().startListeningTo(myGridLayoutNumColumns);
496
		getListener().startListeningTo(myGridLayoutMarginsHorizontal);
497
		getListener().startListeningTo(myGridLayoutMarginsVertical);
498
		getListener().startListeningTo(myGridLayoutSpacingHorizontal);
499
		getListener().startListeningTo(myGridLayoutSpacingVertical);
500
		getListener().startListeningTo(myBorderDataAlignment_North);
501
		getListener().startListeningTo(myBorderDataAlignment_South);
502
		getListener().startListeningTo(myBorderDataAlignment_Center);
503
		getListener().startListeningTo(myBorderDataAlignment_West);
504
		getListener().startListeningTo(myBorderDataAlignment_East);
505
		getListener().startListeningTo(myXYLayoutSizeX);
506
		getListener().startListeningTo(myXYLayoutSizeY);
507
		getListener().startListeningTo(myXYLayoutTopLeftX);
508
		getListener().startListeningTo(myXYLayoutTopLeftY);
509
	}
510
511
	public void doDispose() {
512
		myLayout_Border_Group.removeExpansionListener(getExpansionListener(myExpandBar));
513
		myLayout_Flow_Group.removeExpansionListener(getExpansionListener(myExpandBar));
514
		myLayout_Grid_Group.removeExpansionListener(getExpansionListener(myExpandBar));
515
		myLayout_Custom_Group.removeExpansionListener(getExpansionListener(myExpandBar));
516
517
		getListener().stopListeningTo(myLayout_Border);
518
		getListener().stopListeningTo(myLayout_Custom);
519
		getListener().stopListeningTo(myLayout_Flow);
520
		getListener().stopListeningTo(myLayout_Grid);
521
		getListener().stopListeningTo(myLayout_Stack);
522
		getListener().stopListeningTo(myLayout_XY);
523
		getListener().stopListeningTo(myLayout_None);
524
		getListener().stopListeningTo(myFlowLayoutForceSingleLineCheckbox);
525
		getListener().stopListeningTo(myFlowLayoutMatchMinorSizeCheckbox);
526
		getListener().stopListeningTo(myFlowMinorSpacing);
527
		getListener().stopListeningTo(myFlowMajorSpacing);
528
		getListener().stopListeningTo(myFlowMinorAlignment_Center);
529
		getListener().stopListeningTo(myFlowMinorAlignment_Beginning);
530
		getListener().stopListeningTo(myFlowMinorAlignment_End);
531
		getListener().stopListeningTo(myFlowMinorAlignment_East);
532
		getListener().stopListeningTo(myFlowMinorAlignment_West);
533
		getListener().stopListeningTo(myFlowMajorAlignment_Center);
534
		getListener().stopListeningTo(myFlowMajorAlignment_Beginning);
535
		getListener().stopListeningTo(myFlowMajorAlignment_End);
536
		getListener().stopListeningTo(myFlowMajorAlignment_East);
537
		getListener().stopListeningTo(myFlowMajorAlignment_West);
538
		getListener().stopListeningTo(myBorderLayoutSpacingHorizontal);
539
		getListener().stopListeningTo(myBorderLayoutSpacingVertical);
540
		getListener().stopListeningTo(myBorderDataAlignment_North);
541
		getListener().stopListeningTo(myBorderDataAlignment_South);
542
		getListener().stopListeningTo(myBorderDataAlignment_Center);
543
		getListener().stopListeningTo(myBorderDataAlignment_West);
544
		getListener().stopListeningTo(myBorderDataAlignment_East);
545
		getListener().stopListeningTo(myCustomLayoutBundleName);
546
		getListener().stopListeningTo(myCustomLayoutQualifiedClassName);
547
		getListener().stopListeningTo(myGridEqualWidth);
548
		getListener().stopListeningTo(myGridLayoutNumColumns);
549
		getListener().stopListeningTo(myGridLayoutMarginsHorizontal);
550
		getListener().stopListeningTo(myGridLayoutMarginsVertical);
551
		getListener().stopListeningTo(myGridLayoutSpacingHorizontal);
552
		getListener().stopListeningTo(myGridLayoutSpacingVertical);
553
		getListener().stopListeningTo(myXYLayoutSizeX);
554
		getListener().stopListeningTo(myXYLayoutSizeY);
555
		getListener().stopListeningTo(myXYLayoutTopLeftX);
556
		getListener().stopListeningTo(myXYLayoutTopLeftY);
557
	}
558
559
	private void applyChangesFrom(org.eclipse.swt.widgets.Widget widget, int kind) {
560
		if (widget instanceof org.eclipse.swt.widgets.Spinner) {
561
			int value = ((org.eclipse.swt.widgets.Spinner) widget).getSelection();
562
			switch (kind) {
563
			case BORDER_SPACING_HORIZONTAL: {
564
				setBorderSpacingHorizontal(value);
565
				break;
566
			}
567
			case BORDER_SPACING_VERTICAL: {
568
				setBorderSpacingVertical(value);
569
				break;
570
			}
571
			case FLOW_MINOR_SPACING: {
572
				setFlowMinorSpacing(value);
573
				break;
574
			}
575
			case FLOW_MAJOR_SPACING: {
576
				setFlowMajorSpacing(value);
577
				break;
578
			}
579
			case GRID_NUM_COLUMNS: {
580
				setGridNumOfColumns(value);
581
				break;
582
			}
583
			case GRID_MARGINS_HORIZONTAL: {
584
				setGridMarginsHorizontal(value);
585
				break;
586
			}
587
			case GRID_MARGINS_VERTICAL: {
588
				setGridMarginsVertical(value);
589
				break;
590
			}
591
			case GRID_SPACING_HORIZONTAL: {
592
				setGridSpacingHorizontal(value);
593
				break;
594
			}
595
			case GRID_SPACING_VERTICAL: {
596
				setGridSpacingVertical(value);
597
				break;
598
			}
599
			case XY_SIZE_X: {
600
				setXYDataSizeX(value);
601
				break;
602
			}
603
			case XY_SIZE_Y: {
604
				setXYDataSizeY(value);
605
				break;
606
			}
607
			case XY_TOPLEFT_X: {
608
				setXYDataTopLeftX(value);
609
				break;
610
			}
611
			case XY_TOPLEFT_Y: {
612
				setXYDataTopLeftY(value);
613
				break;
614
			}
615
			}
616
		} else if (widget instanceof org.eclipse.swt.widgets.Button) {
617
			boolean turnedOn = ((org.eclipse.swt.widgets.Button) widget).getSelection();
618
			switch (kind) {
619
			case LAYOUT_BORDER:
620
			case LAYOUT_CUSTOM:
621
			case LAYOUT_FLOW:
622
			case LAYOUT_GRID:
623
			case LAYOUT_STACK:
624
			case LAYOUT_XY:
625
			case LAYOUT_NONE: {
626
				setLayout(kind);
627
				break;
628
			}
629
			case GRID_EQUAL_WIDTH: {
630
				setGridEqualWidth(turnedOn);
631
				break;
632
			}
633
			case FLOW_MATCH_MINOR_SIZE: {
634
				setFlowMatchMinorSize(turnedOn);
635
				break;
636
			}
637
			case FLOW_FORCE_SINGLE_LINE: {
638
				setFlowForceSingleLine(turnedOn);
639
				break;
640
			}
641
			case ALIGNMENT_NORTH:
642
			case ALIGNMENT_WEST:
643
			case ALIGNMENT_EAST:
644
			case ALIGNMENT_SOUTH:
645
			case ALIGNMENT_CENTER: {
646
				setBorderDataAlignment(kind);
647
				break;
648
			}
649
			case FLOW_MINOR_ALIGNMENT_BEGINNING:
650
			case FLOW_MINOR_ALIGNMENT_WEST:
651
			case FLOW_MINOR_ALIGNMENT_EAST:
652
			case FLOW_MINOR_ALIGNMENT_END:
653
			case FLOW_MINOR_ALIGNMENT_CENTER: {
654
				setFlowMinorAlignment(convertFlowMinorAlignment(kind));
655
				break;
656
			}
657
			case FLOW_MAJOR_ALIGNMENT_BEGINNING:
658
			case FLOW_MAJOR_ALIGNMENT_WEST:
659
			case FLOW_MAJOR_ALIGNMENT_EAST:
660
			case FLOW_MAJOR_ALIGNMENT_END:
661
			case FLOW_MAJOR_ALIGNMENT_CENTER: {
662
				setFlowMajorAlignment(convertFlowMajorAlignment(kind));
663
				break;
664
			}
665
			}
666
		} else if (widget instanceof Text) {
667
			String value = ((Text) widget).getText();
668
			switch (kind) {
669
			case CUSTOM_BUNDLE_NAME: {
670
				setCustomBundleName(value);
671
				break;
672
			}
673
			case CUSTOM_QUALIFIED_CLASSNAME: {
674
				setCustomQualifiedClassname(value);
675
				break;
676
			}
677
			}
678
		}
679
	}
680
681
	public void refresh() {
682
		getListener().startNonUserChange();
683
		try {
684
			for (java.util.Iterator it = getSavedSelection().iterator(); it.hasNext();) {
685
				final Object next = it.next();
686
				executeAsReadAction(new Runnable() {
687
688
					public void run() {
689
						int layoutKind = getLayoutKind(next);
690
						myLayout_Border.setSelection(layoutKind == LAYOUT_BORDER);
691
						myLayout_Custom.setSelection(layoutKind == LAYOUT_CUSTOM);
692
						myLayout_Flow.setSelection(layoutKind == LAYOUT_FLOW);
693
						myLayout_Grid.setSelection(layoutKind == LAYOUT_GRID);
694
						myLayout_Stack.setSelection(layoutKind == LAYOUT_STACK);
695
						myLayout_XY.setSelection(layoutKind == LAYOUT_XY);
696
						myLayout_None.setSelection(layoutKind == LAYOUT_NONE);
697
698
						boolean isExpandedStateChanged = false;
699
						boolean wasExpanded = false;
700
701
						wasExpanded = myLayout_Border_Group.isExpanded();
702
						myLayout_Border_Group.setExpanded(myLayout_Border.getSelection());
703
						if (isExpandedStateChanged == false) {
704
							isExpandedStateChanged = wasExpanded != myLayout_Border_Group.isExpanded();
705
						}
706
						wasExpanded = myLayout_Custom_Group.isExpanded();
707
						myLayout_Custom_Group.setExpanded(myLayout_Custom.getSelection());
708
						if (isExpandedStateChanged == false) {
709
							isExpandedStateChanged = wasExpanded != myLayout_Custom_Group.isExpanded();
710
						}
711
						wasExpanded = myLayout_Flow_Group.isExpanded();
712
						myLayout_Flow_Group.setExpanded(myLayout_Flow.getSelection());
713
						if (isExpandedStateChanged == false) {
714
							isExpandedStateChanged = wasExpanded != myLayout_Flow_Group.isExpanded();
715
						}
716
						wasExpanded = myLayout_Grid_Group.isExpanded();
717
						myLayout_Grid_Group.setExpanded(myLayout_Grid.getSelection());
718
						if (isExpandedStateChanged == false) {
719
							isExpandedStateChanged = wasExpanded != myLayout_Grid_Group.isExpanded();
720
						}
721
722
						int spacingHorizontal = getBorderLayoutSpacingHorizontal(next);
723
						if (spacingHorizontal != -1) {
724
							myBorderLayoutSpacingHorizontal.setSelection(spacingHorizontal);
725
						}
726
						int spacingVertical = getBorderLayoutSpacingVertical(next);
727
						if (spacingVertical != -1) {
728
							myBorderLayoutSpacingVertical.setSelection(spacingVertical);
729
						}
730
731
						String customLayoutBundleName = getCustomLayoutBundleName(next);
732
						if (customLayoutBundleName != null) {
733
							myCustomLayoutBundleName.setText(customLayoutBundleName);
734
						}
735
736
						String customLayoutClassName = getCustomLayoutClassName(next);
737
						if (customLayoutClassName != null) {
738
							myCustomLayoutQualifiedClassName.setText(customLayoutClassName);
739
						}
740
741
						int gridNumLines = getGridLayoutNumLines(next);
742
						if (gridNumLines != -1) {
743
							myGridLayoutNumColumns.setSelection(gridNumLines);
744
						}
745
						myGridEqualWidth.setSelection(getGridLayoutEqualWidth(next));
746
						int gridMarginsHorizontal = getGridLayoutMarginsHorizontal(next);
747
						if (gridMarginsHorizontal != -1) {
748
							myGridLayoutMarginsHorizontal.setSelection(gridMarginsHorizontal);
749
						}
750
						int gridMarginsVertical = getGridLayoutMarginsVertical(next);
751
						if (gridMarginsVertical != -1) {
752
							myGridLayoutMarginsVertical.setSelection(gridMarginsVertical);
753
						}
754
						int gridSpacingHorizontal = getGridLayoutSpacingHorizontal(next);
755
						if (gridSpacingHorizontal != -1) {
756
							myGridLayoutSpacingHorizontal.setSelection(gridSpacingHorizontal);
757
						}
758
						int gridSpacingVertical = getGridLayoutSpacingVertical(next);
759
						if (gridSpacingVertical != -1) {
760
							myGridLayoutSpacingVertical.setSelection(gridSpacingVertical);
761
						}
762
763
						myFlowLayoutForceSingleLineCheckbox.setSelection(getFlowLayoutForceSingleLine(next));
764
						myFlowLayoutMatchMinorSizeCheckbox.setSelection(getFlowLayoutMatchMinorSize(next));
765
						int minorSpacing = getFlowMinorSpacing(next);
766
						if (minorSpacing != -1) {
767
							myFlowMinorSpacing.setSelection(minorSpacing);
768
						}
769
						int majorSpacing = getFlowMajorSpacing(next);
770
						if (majorSpacing != -1) {
771
							myFlowMajorSpacing.setSelection(majorSpacing);
772
						}
773
						int flowMinorAlignment = getFlowMinorAlignmentKind(next);
774
						myFlowMinorAlignment_Beginning.setSelection(flowMinorAlignment == ALIGNMENT_NORTH);
775
						myFlowMinorAlignment_End.setSelection(flowMinorAlignment == ALIGNMENT_SOUTH);
776
						myFlowMinorAlignment_Center.setSelection(flowMinorAlignment == ALIGNMENT_CENTER);
777
						myFlowMinorAlignment_East.setSelection(flowMinorAlignment == ALIGNMENT_EAST);
778
						myFlowMinorAlignment_West.setSelection(flowMinorAlignment == ALIGNMENT_WEST);
779
						int flowMajorAlignment = getFlowMajorAlignmentKind(next);
780
						myFlowMajorAlignment_Beginning.setSelection(flowMajorAlignment == ALIGNMENT_NORTH);
781
						myFlowMajorAlignment_End.setSelection(flowMajorAlignment == ALIGNMENT_SOUTH);
782
						myFlowMajorAlignment_Center.setSelection(flowMajorAlignment == ALIGNMENT_CENTER);
783
						myFlowMajorAlignment_East.setSelection(flowMajorAlignment == ALIGNMENT_EAST);
784
						myFlowMajorAlignment_West.setSelection(flowMajorAlignment == ALIGNMENT_WEST);
785
786
						int layoutDataKind = getLayoutDataKind(next);
787
						myLayoutData_Border_Group.setVisible(layoutDataKind == LAYOUT_BORDER);
788
						myLayoutData_Custom_Group.setVisible(layoutDataKind == LAYOUT_CUSTOM);
789
						myLayoutData_Grid_Group.setVisible(layoutDataKind == LAYOUT_GRID);
790
						myLayoutData_XY_Group.setVisible(layoutDataKind == LAYOUT_XY);
791
						switch (layoutDataKind) {
792
						case LAYOUT_BORDER: {
793
							int alignment = getAlignmentKind(next);
794
							myBorderDataAlignment_North.setSelection(alignment == ALIGNMENT_NORTH);
795
							myBorderDataAlignment_South.setSelection(alignment == ALIGNMENT_SOUTH);
796
							myBorderDataAlignment_Center.setSelection(alignment == ALIGNMENT_CENTER);
797
							myBorderDataAlignment_West.setSelection(alignment == ALIGNMENT_WEST);
798
							myBorderDataAlignment_East.setSelection(alignment == ALIGNMENT_EAST);
799
							break;
800
						}
801
						case LAYOUT_CUSTOM: {
802
							String customLayoutDataBundleName = getCustomLayoutDataBundleName(next);
803
							if (customLayoutDataBundleName != null) {
804
								myCustomLayoutDataBundleName.setText(customLayoutDataBundleName);
805
							}
806
807
							String customLayoutDataClassName = getCustomLayoutDataClassName(next);
808
							if (customLayoutDataClassName != null) {
809
								myCustomLayoutDataQualifiedClassName.setText(customLayoutDataClassName);
810
							}
811
							break;
812
						}
813
						case LAYOUT_GRID: {
814
							boolean grabHorizontal = getGridDataGrabHorizontal(next);
815
							myGridLayoutDataGrabHorizontal.setEnabled(grabHorizontal);
816
							boolean grabVertical = getGridDataGrabVertical(next);
817
							myGridLayoutDataGrabVertical.setEnabled(grabVertical);
818
							int spanHorizontal = getGridDataHorizontalSpan(next);
819
							if (spanHorizontal != -1) {
820
								myGridLayoutDataSpanHorizontal.setSelection(spanHorizontal);
821
							}
822
							int spanVertical = getGridDataVerticalSpan(next);
823
							if (spanVertical != -1) {
824
								myGridLayoutDataSpanVertical.setSelection(spanVertical);
825
							}
826
							int alignment = getGridDataAlignmentKind(next);
827
							myGridLayoutDataAlignment_North.setSelection(alignment == ALIGNMENT_NORTH);
828
							myGridLayoutDataAlignment_South.setSelection(alignment == ALIGNMENT_SOUTH);
829
							myGridLayoutDataAlignment_Center.setSelection(alignment == ALIGNMENT_CENTER);
830
							myGridLayoutDataAlignment_West.setSelection(alignment == ALIGNMENT_WEST);
831
							myGridLayoutDataAlignment_East.setSelection(alignment == ALIGNMENT_EAST);
832
							break;
833
						}
834
						case LAYOUT_XY: {
835
							int sizeX = getSizeX(next);
836
							if (sizeX != -1) {
837
								myXYLayoutSizeX.setSelection(sizeX);
838
							}
839
							int sizeY = getSizeY(next);
840
							if (sizeY != -1) {
841
								myXYLayoutSizeY.setSelection(sizeY);
842
							}
843
							int topLeftX = getTopLeftX(next);
844
							if (topLeftX != -1) {
845
								myXYLayoutTopLeftX.setSelection(topLeftX);
846
							}
847
							int topLeftY = getTopLeftY(next);
848
							if (topLeftY != -1) {
849
								myXYLayoutTopLeftY.setSelection(topLeftY);
850
							}
851
							break;
852
						}
853
						}
854
855
						if (isExpandedStateChanged) {
856
							relayoutExpandBar(myExpandBar);
857
						}
858
859
					}
860
861
				});
862
			}
863
		} finally {
864
			getListener().finishNonUserChange();
865
		}
866
	}
867
868
	protected org.eclipse.gmf.gmfgraph.Layout getLayout(int layoutKind) {
869
		switch (layoutKind) {
870
		case LAYOUT_BORDER:
871
			return GMFGraphFactory.eINSTANCE.createBorderLayout();
872
		case LAYOUT_CUSTOM:
873
			return GMFGraphFactory.eINSTANCE.createCustomLayout();
874
		case LAYOUT_FLOW:
875
			return GMFGraphFactory.eINSTANCE.createFlowLayout();
876
		case LAYOUT_GRID:
877
			return GMFGraphFactory.eINSTANCE.createGridLayout();
878
		case LAYOUT_STACK:
879
			return GMFGraphFactory.eINSTANCE.createStackLayout();
880
		case LAYOUT_XY:
881
			return GMFGraphFactory.eINSTANCE.createXYLayout();
882
		case LAYOUT_NONE:
883
			return null;
884
		}
885
		return null;
886
	}
887
888
	protected int getLayoutKind(Object object) {
889
		if (object instanceof Layoutable) {
890
			org.eclipse.gmf.gmfgraph.Layout layout = ((Layoutable) object).getLayout();
891
			if (layout instanceof org.eclipse.gmf.gmfgraph.BorderLayout)
892
				return LAYOUT_BORDER;
893
			if (layout instanceof org.eclipse.gmf.gmfgraph.CustomLayout)
894
				return LAYOUT_CUSTOM;
895
			if (layout instanceof org.eclipse.gmf.gmfgraph.FlowLayout)
896
				return LAYOUT_FLOW;
897
			if (layout instanceof org.eclipse.gmf.gmfgraph.GridLayout)
898
				return LAYOUT_GRID;
899
			if (layout instanceof org.eclipse.gmf.gmfgraph.StackLayout)
900
				return LAYOUT_STACK;
901
			if (layout instanceof org.eclipse.gmf.gmfgraph.XYLayout)
902
				return LAYOUT_XY;
903
		}
904
		return LAYOUT_NONE;
905
	}
906
907
	protected static int convertAlignment(Alignment alignment, boolean horizontal) {
908
		if (alignment == null)
909
			return Alignment.CENTER;
910
		switch (alignment.getValue()) {
911
		case Alignment.BEGINNING:
912
			return horizontal ? ALIGNMENT_EAST : ALIGNMENT_NORTH;
913
		case Alignment.END:
914
			return horizontal ? ALIGNMENT_WEST : ALIGNMENT_SOUTH;
915
		case Alignment.CENTER:
916
			return ALIGNMENT_CENTER;
917
		case Alignment.FILL:
918
			return ALIGNMENT_FILL;
919
		}
920
		return Alignment.CENTER;
921
	}
922
923
	protected static int convertFlowMinorAlignment(int flowMinorAlignmentKind) {
924
		switch (flowMinorAlignmentKind) {
925
		case FLOW_MINOR_ALIGNMENT_BEGINNING:
926
			return ALIGNMENT_NORTH;
927
		case FLOW_MINOR_ALIGNMENT_EAST:
928
			return ALIGNMENT_EAST;
929
		case FLOW_MINOR_ALIGNMENT_WEST:
930
			return ALIGNMENT_WEST;
931
		case FLOW_MINOR_ALIGNMENT_END:
932
			return ALIGNMENT_SOUTH;
933
		case FLOW_MINOR_ALIGNMENT_CENTER:
934
			return ALIGNMENT_CENTER;
935
		}
936
		return ALIGNMENT_CENTER;
937
	}
938
939
	protected static int convertFlowMajorAlignment(int flowMajorAlignmentKind) {
940
		switch (flowMajorAlignmentKind) {
941
		case FLOW_MAJOR_ALIGNMENT_BEGINNING:
942
			return ALIGNMENT_NORTH;
943
		case FLOW_MAJOR_ALIGNMENT_EAST:
944
			return ALIGNMENT_EAST;
945
		case FLOW_MAJOR_ALIGNMENT_WEST:
946
			return ALIGNMENT_WEST;
947
		case FLOW_MAJOR_ALIGNMENT_END:
948
			return ALIGNMENT_SOUTH;
949
		case FLOW_MAJOR_ALIGNMENT_CENTER:
950
			return ALIGNMENT_CENTER;
951
		}
952
		return ALIGNMENT_CENTER;
953
	}
954
955
	protected String getLayoutDataName(int layoutDataKind) {
956
		switch (layoutDataKind) {
957
		case LAYOUT_BORDER:
958
			return getBorderLayoutDataLabel();
959
		case LAYOUT_CUSTOM:
960
			return getCustomLayoutDataLabel();
961
		case LAYOUT_GRID:
962
			return getGridLayoutDataLabel();
963
		case LAYOUT_XY:
964
			return getXYLayoutDataLabel();
965
		}
966
		return "";
967
	}
968
969
	protected static int getLayoutDataKind(Object object) {
970
		if (object instanceof Layoutable) {
971
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
972
			if (layoutData instanceof BorderLayoutData)
973
				return LAYOUT_BORDER;
974
			if (layoutData instanceof CustomLayoutData)
975
				return LAYOUT_CUSTOM;
976
			if (layoutData instanceof GridLayoutData)
977
				return LAYOUT_GRID;
978
			if (layoutData instanceof XYLayoutData)
979
				return LAYOUT_XY;
980
		}
981
		return LAYOUT_NONE;
982
	}
983
984
	protected static Alignment getAlignment(int alignmentKind) {
985
		switch (alignmentKind) {
986
		case ALIGNMENT_NORTH:
987
			return Alignment.BEGINNING_LITERAL;
988
		case ALIGNMENT_SOUTH:
989
			return Alignment.END_LITERAL;
990
		case ALIGNMENT_CENTER:
991
			return Alignment.CENTER_LITERAL;
992
		case ALIGNMENT_WEST:
993
			return Alignment.END_LITERAL;
994
		case ALIGNMENT_EAST:
995
			return Alignment.BEGINNING_LITERAL;
996
		}
997
		return Alignment.CENTER_LITERAL;
998
	}
999
1000
	protected boolean isHorizontal(int alignmentKind) {
1001
		switch (alignmentKind) {
1002
		case ALIGNMENT_EAST:
1003
		case FLOW_MINOR_ALIGNMENT_EAST:
1004
		case FLOW_MAJOR_ALIGNMENT_EAST:
1005
		case ALIGNMENT_WEST:
1006
		case FLOW_MINOR_ALIGNMENT_WEST:
1007
		case FLOW_MAJOR_ALIGNMENT_WEST:
1008
			return true;
1009
		}
1010
		return false;
1011
	}
1012
1013
	protected boolean isCenter(int alignmentKind) {
1014
		switch (alignmentKind) {
1015
		case ALIGNMENT_CENTER:
1016
		case FLOW_MINOR_ALIGNMENT_CENTER:
1017
		case FLOW_MAJOR_ALIGNMENT_CENTER:
1018
			return true;
1019
		}
1020
		return false;
1021
	}
1022
1023
1024
	/*#################### labels ####################*/
1025
	
1026
	private String getGridDataAlignmentLabel() {
1027
		return "Alignment";
1028
	}
1029
1030
	private String getGridDataSpanVerticalLabel() {
1031
		return "Vertical";
1032
	}
1033
1034
	private String getGridDataSpanHorizontalLabel() {
1035
		return "Horizontal";
1036
	}
1037
1038
	private String getGridDataSpanLabel() {
1039
		return "Spannings";
1040
	}
1041
1042
	private String getGridDataGrabVerticalLabel() {
1043
		return "Grab Vertical";
1044
	}
1045
1046
	private String getGridDataGrabHorizontalLabel() {
1047
		return "Grab Horizontal";
1048
	}
1049
1050
	private String getLayoutParamsLabel() {
1051
		return "Layout Parameters";
1052
	}
1053
1054
	private String getFlowMajorAlignmentLabel() {
1055
		return "Major Alignment";
1056
	}
1057
1058
	private String getFlowMinorAlignmentLabel() {
1059
		return "Minor Alignment";
1060
	}
1061
1062
	private String getFlowMajorSpacingLabel() {
1063
		return "Major";
1064
	}
1065
1066
	private String getFlowMinorSpacingLabel() {
1067
		return "Minor";
1068
	}
1069
1070
	private String getFlowLayoutSpacingsLabel() {
1071
		return "Spacings";
1072
	}
1073
1074
	private String getYTopLeftLabel() {
1075
		return "Y";
1076
	}
1077
1078
	private String getXTopLeftLabel() {
1079
		return "X";
1080
	}
1081
1082
	private String getYSizeLabel() {
1083
		return "Y";
1084
	}
1085
1086
	private String getXSizeLabel() {
1087
		return "X";
1088
	}
1089
1090
	private String getXYDataTopLeftLabel() {
1091
		return "Top Left Position";
1092
	}
1093
1094
	private String getXYDataSizeLabel() {
1095
		return "Size Constraints";
1096
	}
1097
1098
	private String getGridSpacingsLabel() {
1099
		return "Spacing";
1100
	}
1101
1102
	private String getGridSpacingVerticalLabel() {
1103
		return "Vertical";
1104
	}
1105
1106
	private String getGridSpacingHorizonalLabel() {
1107
		return "Horizontal";
1108
	}
1109
1110
	private String getGridMarginsLabel() {
1111
		return "Margins";
1112
	}
1113
1114
	private String getMarginsVerticalLabel() {
1115
		return "Vertical";
1116
	}
1117
1118
	private String getMarginsHorizonalLabel() {
1119
		return "Horizontal";
1120
	}
1121
1122
	private String getLayoutDataNameLabel() {
1123
		return "Layout Data Kind";
1124
	}
1125
1126
	private String getLayoutDataLabel() {
1127
		return "Layout Data";
1128
	}
1129
1130
	private String getQualifiedClassNameLabel() {
1131
		return "Qualified Class Name";
1132
	}
1133
1134
	private String getBundleNameLabel() {
1135
		return "Bundle Name";
1136
	}
1137
1138
	private String getNumColumnsLabel() {
1139
		return "Number of Columns";
1140
	}
1141
1142
	private String getNoLayoutLabel() {
1143
		return "No Layout";
1144
	}
1145
1146
	private String getXYLayoutLabel() {
1147
		return "XY Layout";
1148
	}
1149
1150
	private String getStackLayoutLabel() {
1151
		return "Stack Layout";
1152
	}
1153
1154
	private String getGridLayoutLabel() {
1155
		return "Grid Layout";
1156
	}
1157
1158
	private String getFlowLayoutLabel() {
1159
		return "Flow Layout";
1160
	}
1161
1162
	private String getCustomLayoutLabel() {
1163
		return "Custom Layout";
1164
	}
1165
1166
	private String getBorderLayoutLabel() {
1167
		return "Border Layout";
1168
	}
1169
1170
	private String getXYLayoutDataLabel() {
1171
		return "XY Layout Data";
1172
	}
1173
1174
	private String getGridLayoutDataLabel() {
1175
		return "Grid Layout Data";
1176
	}
1177
1178
	private String getCustomLayoutDataLabel() {
1179
		return "Custom Layout Data";
1180
	}
1181
1182
	private String getBorderLayoutDataLabel() {
1183
		return "Border Layout Data";
1184
	}
1185
1186
	private String getBorderLayoutSpacingLabel() {
1187
		return "Spacing";
1188
	}
1189
1190
	private String getBorderSpacingHorizonalLabel() {
1191
		return "Horizontal";
1192
	}
1193
1194
	private String getBorderSpacingVerticalLabel() {
1195
		return "Vertical";
1196
	}
1197
1198
	private String getEqualWidthLabel() {
1199
		return "Make Columns Equal Width";
1200
	}
1201
1202
	private String getLayoutLabel() {
1203
		return "Layout Manager";
1204
	}
1205
1206
	private String getFlowForceSingleLinePropertyNameLabel() {
1207
		return "Force Single Line";
1208
	}
1209
1210
	private String getFlowVerticalPropertyNameLabel() {
1211
		return "Vertical";
1212
	}
1213
1214
	private String getMatchMinorSizePropertyNameLabel() {
1215
		return "Match Minor Size";
1216
	}
1217
1218
	private String getAlignmentBeginningLabel() {
1219
		return "<- Beginning";
1220
	}
1221
1222
	private String getAlignmentFillLabel() {
1223
		return "<- Center ->";
1224
	}
1225
1226
	private String getAlignmentEndLabel() {
1227
		return "End ->";
1228
	}
1229
1230
	private String getAlignmentNorthLabel() {
1231
		return "N";
1232
	}
1233
1234
	private String getAlignmentCenterLabel() {
1235
		return "C";
1236
	}
1237
1238
	private String getAlignmentSouthLabel() {
1239
		return "S";
1240
	}
1241
1242
	private String getAlignmentEastLabel() {
1243
		return "E";
1244
	}
1245
1246
	private String getAlignmentWestLabel() {
1247
		return "W";
1248
	}
1249
1250
	/*#################### composite setters ####################*/
1251
	
1252
	protected void setLayout(final int layoutKind) {
1253
		modifyModel(new RunnableWithLayoutable() {
1254
1255
			public void run() {
1256
				org.eclipse.gmf.gmfgraph.Layout layout = getLayout(layoutKind);
1257
				getLayoutable().setLayout(layout);
1258
				if (getLayoutable() instanceof Figure) {
1259
					setLayoutDataToChildren(((Figure) getLayoutable()).getChildren(), layoutKind);
1260
				}
1261
			}
1262
		}, "Setting layout manager");
1263
	}
1264
1265
	protected void setLayoutDataToChildren(EList children, int layoutKind) {
1266
		for (Iterator it = children.iterator(); it.hasNext();) {
1267
			Object next = it.next();
1268
			int haveKind = getLayoutDataKind(next);
1269
			if ((haveKind == LAYOUT_NONE || haveKind != layoutKind) && next instanceof Layoutable) {
1270
				Layoutable layoutable = (Layoutable) next;
1271
				LayoutData newData = createAppropriateLayoutData(layoutKind, layoutable);
1272
				if (newData != null) {
1273
					layoutable.setLayoutData(newData);
1274
				}
1275
			}
1276
		}
1277
1278
	}
1279
1280
	private LayoutData createAppropriateLayoutData(int layoutKind, Layoutable layoutable) {
1281
		switch (layoutKind) {
1282
		case LAYOUT_BORDER: {
1283
			BorderLayoutData data = GMFGraphFactory.eINSTANCE.createBorderLayoutData();
1284
			int rnd = (int) Math.round(Math.random()*5);
1285
			data.setAlignment(getAlignment(rnd));
1286
			if (!isCenter(rnd)) {
1287
				boolean horizontal = isHorizontal(rnd);
1288
				data.setVertical(!horizontal);
1289
			}
1290
			return data;
1291
		}
1292
		case LAYOUT_CUSTOM: {
1293
			CustomLayoutData data = GMFGraphFactory.eINSTANCE.createCustomLayoutData();
1294
			return data;
1295
		}
1296
		case LAYOUT_FLOW: {
1297
			return null;
1298
		}
1299
		case LAYOUT_GRID: {
1300
			GridLayoutData data = GMFGraphFactory.eINSTANCE.createGridLayoutData();
1301
			return data;
1302
		}
1303
		case LAYOUT_STACK: {
1304
			return null;
1305
		}
1306
		case LAYOUT_XY: {
1307
			XYLayoutData data = GMFGraphFactory.eINSTANCE.createXYLayoutData();
1308
			if (layoutable instanceof Figure) {
1309
				Figure figure = (Figure) layoutable;
1310
				data.setSize(figure.getPreferredSize());
1311
				data.setTopLeft(figure.getLocation());
1312
			}
1313
			return data;
1314
		}
1315
		case LAYOUT_NONE: {
1316
			return null;
1317
		}
1318
		}
1319
		return null;
1320
	}
1321
1322
	/*#################### setters ####################*/
1323
	
1324
	protected void setGridEqualWidth(final boolean value) {
1325
		modifyModel(new RunnableWithLayoutable() {
1326
1327
			public void run() {
1328
				Layout lay = getLayoutable().getLayout();
1329
				if (lay instanceof GridLayout) {
1330
					GridLayout layout = (GridLayout) lay;
1331
					layout.setEqualWidth(value);
1332
				}
1333
			}
1334
		}, "Turning equal width on for the Grid Layout");
1335
	}
1336
1337
	public void setXYDataTopLeftY(final int topLeftY) {
1338
		modifyModel(new RunnableWithLayoutable() {
1339
1340
			public void run() {
1341
				LayoutData data = getLayoutable().getLayoutData();
1342
				if (data instanceof XYLayoutData) {
1343
					XYLayoutData xyData = (XYLayoutData) data;
1344
					Point pnt = GMFGraphFactory.eINSTANCE.createPoint();
1345
					pnt.setY(topLeftY);
1346
					if (xyData.getTopLeft() != null) {
1347
						pnt.setX(xyData.getTopLeft().getX());
1348
					}
1349
					xyData.setTopLeft(pnt);
1350
				}
1351
			}
1352
		}, "Setting y for top left position of the XY Layout Data");
1353
	}
1354
1355
	public void setXYDataTopLeftX(final int topLeftX) {
1356
		modifyModel(new RunnableWithLayoutable() {
1357
1358
			public void run() {
1359
				LayoutData data = getLayoutable().getLayoutData();
1360
				if (data instanceof XYLayoutData) {
1361
					XYLayoutData xyData = (XYLayoutData) data;
1362
					Point pnt = GMFGraphFactory.eINSTANCE.createPoint();
1363
					pnt.setX(topLeftX);
1364
					if (xyData.getTopLeft() != null) {
1365
						pnt.setY(xyData.getTopLeft().getY());
1366
					}
1367
					xyData.setTopLeft(pnt);
1368
				}
1369
			}
1370
		}, "Setting x for top left position of the XY Layout Data");
1371
	}
1372
1373
	public void setXYDataSizeY(final int sizeY) {
1374
		modifyModel(new RunnableWithLayoutable() {
1375
1376
			public void run() {
1377
				LayoutData data = getLayoutable().getLayoutData();
1378
				if (data instanceof XYLayoutData) {
1379
					XYLayoutData xyData = (XYLayoutData) data;
1380
					Dimension dim = GMFGraphFactory.eINSTANCE.createDimension();
1381
					dim.setDy(sizeY);
1382
					if (xyData.getSize() != null) {
1383
						dim.setDx(xyData.getSize().getDx());
1384
					}
1385
					xyData.setSize(dim);
1386
				}
1387
			}
1388
		}, "Setting y for size of the XY Layout Data");
1389
	}
1390
1391
	public void setXYDataSizeX(final int sizeX) {
1392
		modifyModel(new RunnableWithLayoutable() {
1393
1394
			public void run() {
1395
				LayoutData data = getLayoutable().getLayoutData();
1396
				if (data instanceof XYLayoutData) {
1397
					XYLayoutData xyData = (XYLayoutData) data;
1398
					Dimension dim = GMFGraphFactory.eINSTANCE.createDimension();
1399
					dim.setDx(sizeX);
1400
					if (xyData.getSize() != null) {
1401
						dim.setDy(xyData.getSize().getDy());
1402
					}
1403
					xyData.setSize(dim);
1404
				}
1405
			}
1406
		}, "Setting x for size of the XY Layout Data");
1407
	}
1408
1409
	protected void setGridNumOfColumns(final int numOfColumns) {
1410
		modifyModel(new RunnableWithLayoutable() {
1411
1412
			public void run() {
1413
				Layout lay = getLayoutable().getLayout();
1414
				if (lay instanceof GridLayout) {
1415
					GridLayout layout = (GridLayout) lay;
1416
					layout.setNumColumns(numOfColumns);
1417
				}
1418
			}
1419
		}, "Setting number of columns for the Grid Layout");
1420
	}
1421
1422
	public void setGridMarginsVertical(final int verticalMargins) {
1423
		modifyModel(new RunnableWithLayoutable() {
1424
1425
			public void run() {
1426
				Layout lay = getLayoutable().getLayout();
1427
				if (lay instanceof GridLayout) {
1428
					GridLayout layout = (GridLayout) lay;
1429
					Dimension dim = GMFGraphFactory.eINSTANCE.createDimension();
1430
					dim.setDy(verticalMargins);
1431
					if (layout.getMargins() != null) {
1432
						dim.setDx(layout.getMargins().getDx());
1433
					}
1434
					layout.setMargins(dim);
1435
				}
1436
			}
1437
		}, "Setting vertical margins for the Grid Layout");
1438
	}
1439
1440
	public void setGridMarginsHorizontal(final int horizontalMargins) {
1441
		modifyModel(new RunnableWithLayoutable() {
1442
1443
			public void run() {
1444
				Layout lay = getLayoutable().getLayout();
1445
				if (lay instanceof GridLayout) {
1446
					GridLayout layout = (GridLayout) lay;
1447
					Dimension dim = GMFGraphFactory.eINSTANCE.createDimension();
1448
					dim.setDx(horizontalMargins);
1449
					if (layout.getMargins() != null) {
1450
						dim.setDy(layout.getMargins().getDy());
1451
					}
1452
					layout.setMargins(dim);
1453
				}
1454
			}
1455
		}, "Setting horizontal margins for the Grid Layout");
1456
	}
1457
1458
	public void setGridSpacingHorizontal(final int horizontalSpacing) {
1459
		modifyModel(new RunnableWithLayoutable() {
1460
1461
			public void run() {
1462
				Layout lay = getLayoutable().getLayout();
1463
				if (lay instanceof GridLayout) {
1464
					GridLayout layout = (GridLayout) lay;
1465
					Dimension dim = GMFGraphFactory.eINSTANCE.createDimension();
1466
					dim.setDx(horizontalSpacing);
1467
					if (layout.getSpacing() != null) {
1468
						dim.setDy(layout.getSpacing().getDy());
1469
					}
1470
					layout.setSpacing(dim);
1471
				}
1472
			}
1473
		}, "Setting horizontal spacing for the Grid Layout");
1474
	}
1475
1476
	public void setGridSpacingVertical(final int verticalSpacing) {
1477
		modifyModel(new RunnableWithLayoutable() {
1478
1479
			public void run() {
1480
				Layout lay = getLayoutable().getLayout();
1481
				if (lay instanceof GridLayout) {
1482
					GridLayout layout = (GridLayout) lay;
1483
					Dimension dim = GMFGraphFactory.eINSTANCE.createDimension();
1484
					dim.setDy(verticalSpacing);
1485
					if (layout.getSpacing() != null) {
1486
						dim.setDx(layout.getSpacing().getDx());
1487
					}
1488
					layout.setSpacing(dim);
1489
				}
1490
			}
1491
		}, "Setting vertical spacing for the Grid Layout");
1492
	}
1493
1494
	public void setCustomQualifiedClassname(final String qualifiedClassname) {
1495
		modifyModel(new RunnableWithLayoutable() {
1496
1497
			public void run() {
1498
				Layout lay = getLayoutable().getLayout();
1499
				if (lay instanceof CustomLayout) {
1500
					CustomLayout layout = (CustomLayout) lay;
1501
					layout.setQualifiedClassName(qualifiedClassname);
1502
				}
1503
			}
1504
		}, "Setting custom layout qualified class name");
1505
	}
1506
1507
	public void setCustomBundleName(final String bundleName) {
1508
		modifyModel(new RunnableWithLayoutable() {
1509
1510
			public void run() {
1511
				Layout lay = getLayoutable().getLayout();
1512
				if (lay instanceof CustomLayout) {
1513
					CustomLayout layout = (CustomLayout) lay;
1514
					layout.setBundleName(bundleName);
1515
				}
1516
			}
1517
		}, "Setting custom layout bundle name");
1518
	}
1519
1520
	protected void setFlowMatchMinorSize(final boolean value) {
1521
		modifyModel(new RunnableWithLayoutable() {
1522
1523
			public void run() {
1524
				Layout lay = getLayoutable().getLayout();
1525
				if (lay instanceof FlowLayout) {
1526
					FlowLayout layout = (FlowLayout) lay;
1527
					layout.setMatchMinorSize(value);
1528
				}
1529
			}
1530
		}, "Turning match minor size on for the Flow Layout");
1531
	}
1532
1533
	protected void setFlowForceSingleLine(final boolean value) {
1534
		modifyModel(new RunnableWithLayoutable() {
1535
1536
			public void run() {
1537
				Layout lay = getLayoutable().getLayout();
1538
				if (lay instanceof FlowLayout) {
1539
					FlowLayout layout = (FlowLayout) lay;
1540
					layout.setForceSingleLine(value);
1541
				}
1542
			}
1543
		}, "Turning force single line on for the Flow Layout");
1544
	}
1545
1546
	protected void setBorderSpacingHorizontal(final int horizontalSpacing) {
1547
		modifyModel(new RunnableWithLayoutable() {
1548
1549
			public void run() {
1550
				Layout lay = getLayoutable().getLayout();
1551
				if (lay instanceof BorderLayout) {
1552
					BorderLayout layout = (BorderLayout) lay;
1553
					org.eclipse.gmf.gmfgraph.Dimension dimension = GMFGraphFactory.eINSTANCE.createDimension();
1554
					dimension.setDx(horizontalSpacing);
1555
					dimension.setDy(layout.getSpacing() == null ? 0 : layout.getSpacing().getDy());
1556
					layout.setSpacing(dimension);
1557
				}
1558
			}
1559
		}, "Setting horizontal spacing for Border layout");
1560
	}
1561
1562
	protected void setBorderSpacingVertical(final int verticalSpacing) {
1563
		modifyModel(new RunnableWithLayoutable() {
1564
1565
			public void run() {
1566
				Layout lay = getLayoutable().getLayout();
1567
				if (lay instanceof BorderLayout) {
1568
					BorderLayout layout = (BorderLayout) lay;
1569
					org.eclipse.gmf.gmfgraph.Dimension dimension = GMFGraphFactory.eINSTANCE.createDimension();
1570
					dimension.setDx(layout.getSpacing() == null ? 0 : layout.getSpacing().getDx());
1571
					dimension.setDy(verticalSpacing);
1572
					layout.setSpacing(dimension);
1573
				}
1574
			}
1575
		}, "Setting vertical spacing for Border layout");
1576
	}
1577
1578
	public void setBorderDataAlignment(final int alignmentKind) {
1579
		modifyModel(new RunnableWithLayoutable() {
1580
1581
			public void run() {
1582
				LayoutData data = getLayoutable().getLayoutData();
1583
				if (data instanceof BorderLayoutData) {
1584
					BorderLayoutData layoutData = (BorderLayoutData) data;
1585
					Alignment alignment = getAlignment(alignmentKind);
1586
					layoutData.setAlignment(alignment);
1587
					boolean center = isCenter(alignmentKind);
1588
					if (!center) {
1589
						boolean horizontal = isHorizontal(alignmentKind);
1590
						layoutData.setVertical(!horizontal);
1591
					}
1592
				}
1593
			}
1594
		}, "Setting alignment for Border layout data");
1595
	}
1596
1597
	protected void setFlowMinorSpacing(final int minorSpacing) {
1598
		modifyModel(new RunnableWithLayoutable() {
1599
1600
			public void run() {
1601
				Layout lay = getLayoutable().getLayout();
1602
				if (lay instanceof FlowLayout) {
1603
					FlowLayout layout = (FlowLayout) lay;
1604
					layout.setMinorSpacing(minorSpacing);
1605
				}
1606
			}
1607
		}, "Setting minor spacing for Flow layout");
1608
	}
1609
1610
	protected void setFlowMajorSpacing(final int majorSpacing) {
1611
		modifyModel(new RunnableWithLayoutable() {
1612
1613
			public void run() {
1614
				Layout lay = getLayoutable().getLayout();
1615
				if (lay instanceof FlowLayout) {
1616
					FlowLayout layout = (FlowLayout) lay;
1617
					layout.setMajorSpacing(majorSpacing);
1618
				}
1619
			}
1620
		}, "Setting major spacing for Flow layout");
1621
	}
1622
1623
	protected void setFlowMinorAlignment(final int alignmentKind) {
1624
		modifyModel(new RunnableWithLayoutable() {
1625
1626
			public void run() {
1627
				Layout layout = getLayoutable().getLayout();
1628
				if (layout instanceof FlowLayout) {
1629
					FlowLayout flowLayout = (FlowLayout) layout;
1630
					Alignment alignment = getAlignment(alignmentKind);
1631
					flowLayout.setMinorAlignment(alignment);
1632
					boolean center = isCenter(alignmentKind);
1633
					if (!center) {
1634
						boolean horizontal = isHorizontal(alignmentKind);
1635
						flowLayout.setVertical(!horizontal);
1636
					}
1637
				}
1638
			}
1639
		}, "Setting minor alignment for Flow layout");
1640
	}
1641
1642
	protected void setFlowMajorAlignment(final int alignmentKind) {
1643
		modifyModel(new RunnableWithLayoutable() {
1644
1645
			public void run() {
1646
				Layout layout = getLayoutable().getLayout();
1647
				if (layout instanceof FlowLayout) {
1648
					FlowLayout flowLayout = (FlowLayout) layout;
1649
					Alignment alignment = getAlignment(alignmentKind);
1650
					flowLayout.setMajorAlignment(alignment);
1651
					boolean center = isCenter(alignmentKind);
1652
					if (!center) {
1653
						boolean horizontal = isHorizontal(alignmentKind);
1654
						flowLayout.setVertical(!horizontal);
1655
					}
1656
				}
1657
			}
1658
		}, "Setting major alignment for Flow layout");
1659
	}
1660
	
1661
	/*#################### getters ####################*/
1662
1663
	private boolean getFlowLayoutMatchMinorSize(Object object) {
1664
		if (object instanceof Layoutable) {
1665
			Layout layout = ((Layoutable) object).getLayout();
1666
			if (layout instanceof FlowLayout) {
1667
				FlowLayout flowLayout = (FlowLayout) layout;
1668
				return flowLayout.isMatchMinorSize();
1669
			}
1670
		}
1671
		return false;
1672
	}
1673
1674
	private boolean getFlowLayoutForceSingleLine(Object object) {
1675
		if (object instanceof Layoutable) {
1676
			Layout layout = ((Layoutable) object).getLayout();
1677
			if (layout instanceof FlowLayout) {
1678
				FlowLayout flowLayout = (FlowLayout) layout;
1679
				return flowLayout.isForceSingleLine();
1680
			}
1681
		}
1682
		return false;
1683
	}
1684
1685
	private int getBorderLayoutSpacingHorizontal(Object object) {
1686
		if (object instanceof Layoutable) {
1687
			Layout layout = ((Layoutable) object).getLayout();
1688
			if (layout instanceof BorderLayout) {
1689
				BorderLayout borderLayout = (BorderLayout) layout;
1690
				Dimension dim = borderLayout.getSpacing();
1691
				if (dim != null) {
1692
					return dim.getDx();
1693
				}
1694
			}
1695
		}
1696
		return -1;
1697
	}
1698
1699
	private int getBorderLayoutSpacingVertical(Object object) {
1700
		if (object instanceof Layoutable) {
1701
			Layout layout = ((Layoutable) object).getLayout();
1702
			if (layout instanceof BorderLayout) {
1703
				BorderLayout borderLayout = (BorderLayout) layout;
1704
				Dimension dim = borderLayout.getSpacing();
1705
				if (dim != null) {
1706
					return dim.getDy();
1707
				}
1708
			}
1709
		}
1710
		return -1;
1711
	}
1712
1713
	private String getCustomLayoutDataClassName(Object object) {
1714
		if (object instanceof Layoutable) {
1715
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
1716
			if (layoutData instanceof CustomLayoutData) {
1717
				CustomLayoutData customLayoutData = (CustomLayoutData) layoutData;
1718
				return customLayoutData.getQualifiedClassName();
1719
			}
1720
		}
1721
		return null;
1722
	}
1723
1724
	private String getCustomLayoutDataBundleName(Object object) {
1725
		if (object instanceof Layoutable) {
1726
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
1727
			if (layoutData instanceof CustomLayoutData) {
1728
				CustomLayoutData customLayoutData = (CustomLayoutData) layoutData;
1729
				return customLayoutData.getBundleName();
1730
			}
1731
		}
1732
		return null;
1733
	}
1734
1735
	private String getCustomLayoutClassName(Object object) {
1736
		if (object instanceof Layoutable) {
1737
			Layout layout = ((Layoutable) object).getLayout();
1738
			if (layout instanceof CustomLayout) {
1739
				CustomLayout customLayout = (CustomLayout) layout;
1740
				return customLayout.getQualifiedClassName();
1741
			}
1742
		}
1743
		return null;
1744
	}
1745
1746
	private String getCustomLayoutBundleName(Object object) {
1747
		if (object instanceof Layoutable) {
1748
			Layout layout = ((Layoutable) object).getLayout();
1749
			if (layout instanceof CustomLayout) {
1750
				CustomLayout customLayout = (CustomLayout) layout;
1751
				return customLayout.getBundleName();
1752
			}
1753
		}
1754
		return null;
1755
	}
1756
1757
	protected boolean getGridLayoutEqualWidth(Object object) {
1758
		if (object instanceof Layoutable) {
1759
			Layout layout = ((Layoutable) object).getLayout();
1760
			if (layout instanceof org.eclipse.gmf.gmfgraph.GridLayout) {
1761
				GridLayout gridLayout = (GridLayout) layout;
1762
				return gridLayout.isEqualWidth();
1763
			}
1764
		}
1765
		return false;
1766
	}
1767
1768
	protected int getGridLayoutNumLines(Object object) {
1769
		if (object instanceof Layoutable) {
1770
			Layout layout = ((Layoutable) object).getLayout();
1771
			if (layout instanceof GridLayout) {
1772
				GridLayout gridLayout = (GridLayout) layout;
1773
				return gridLayout.getNumColumns();
1774
			}
1775
		}
1776
		return -1;
1777
	}
1778
1779
	private int getGridLayoutSpacingVertical(Object object) {
1780
		if (object instanceof Layoutable) {
1781
			Layout layout = ((Layoutable) object).getLayout();
1782
			if (layout instanceof GridLayout) {
1783
				GridLayout gridLayout = (GridLayout) layout;
1784
				Dimension dim = gridLayout.getSpacing();
1785
				if (dim != null) {
1786
					return dim.getDy();
1787
				}
1788
			}
1789
		}
1790
		return -1;
1791
	}
1792
1793
	private int getGridLayoutSpacingHorizontal(Object object) {
1794
		if (object instanceof Layoutable) {
1795
			Layout layout = ((Layoutable) object).getLayout();
1796
			if (layout instanceof GridLayout) {
1797
				GridLayout gridLayout = (GridLayout) layout;
1798
				Dimension dim = gridLayout.getSpacing();
1799
				if (dim != null) {
1800
					return dim.getDx();
1801
				}
1802
			}
1803
		}
1804
		return -1;
1805
	}
1806
1807
	private int getGridLayoutMarginsVertical(Object object) {
1808
		if (object instanceof Layoutable) {
1809
			Layout layout = ((Layoutable) object).getLayout();
1810
			if (layout instanceof GridLayout) {
1811
				GridLayout gridLayout = (GridLayout) layout;
1812
				Dimension dim = gridLayout.getMargins();
1813
				if (dim != null) {
1814
					return dim.getDy();
1815
				}
1816
			}
1817
		}
1818
		return -1;
1819
	}
1820
1821
	private int getGridLayoutMarginsHorizontal(Object object) {
1822
		if (object instanceof Layoutable) {
1823
			Layout layout = ((Layoutable) object).getLayout();
1824
			if (layout instanceof GridLayout) {
1825
				GridLayout gridLayout = (GridLayout) layout;
1826
				Dimension dim = gridLayout.getMargins();
1827
				if (dim != null) {
1828
					return dim.getDx();
1829
				}
1830
			}
1831
		}
1832
		return -1;
1833
	}
1834
1835
	protected int getFlowMinorSpacing(Object object) {
1836
		if (object instanceof Layoutable) {
1837
			Layout layout = ((Layoutable) object).getLayout();
1838
			if (layout instanceof FlowLayout) {
1839
				FlowLayout flowLayout = (FlowLayout) layout;
1840
				return flowLayout.getMinorSpacing();
1841
			}
1842
		}
1843
		return -1;
1844
	}
1845
1846
	protected int getFlowMajorSpacing(Object object) {
1847
		if (object instanceof Layoutable) {
1848
			Layout layout = ((Layoutable) object).getLayout();
1849
			if (layout instanceof FlowLayout) {
1850
				FlowLayout flowLayout = (FlowLayout) layout;
1851
				return flowLayout.getMajorSpacing();
1852
			}
1853
		}
1854
		return -1;
1855
	}
1856
1857
	protected int getFlowMajorAlignmentKind(Object object) {
1858
		if (object instanceof Layoutable) {
1859
			Layout layout = ((Layoutable) object).getLayout();
1860
			if (layout instanceof FlowLayout) {
1861
				FlowLayout flowLayout = (FlowLayout) layout;
1862
				boolean vertical = flowLayout.isVertical();
1863
				return convertAlignment(flowLayout.getMajorAlignment(), !vertical);
1864
			}
1865
		}
1866
		return ALIGNMENT_CENTER;
1867
	}
1868
1869
	protected int getFlowMinorAlignmentKind(Object object) {
1870
		if (object instanceof Layoutable) {
1871
			Layout layout = ((Layoutable) object).getLayout();
1872
			if (layout instanceof FlowLayout) {
1873
				FlowLayout flowLayout = (FlowLayout) layout;
1874
				boolean vertical = flowLayout.isVertical();
1875
				return convertAlignment(flowLayout.getMinorAlignment(), !vertical);
1876
			}
1877
		}
1878
		return ALIGNMENT_CENTER;
1879
	}
1880
1881
	protected int getTopLeftY(Object object) {
1882
		if (object instanceof Layoutable) {
1883
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
1884
			if (layoutData instanceof XYLayoutData) {
1885
				XYLayoutData xyData = (XYLayoutData) layoutData;
1886
				Point topLeft = xyData.getTopLeft();
1887
				if (topLeft != null) {
1888
					return topLeft.getY();
1889
				}
1890
			}
1891
		}
1892
		return 0;
1893
	}
1894
1895
	protected int getTopLeftX(Object object) {
1896
		if (object instanceof Layoutable) {
1897
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
1898
			if (layoutData instanceof XYLayoutData) {
1899
				XYLayoutData xyData = (XYLayoutData) layoutData;
1900
				Point topLeft = xyData.getTopLeft();
1901
				if (topLeft != null) {
1902
					return topLeft.getX();
1903
				}
1904
			}
1905
		}
1906
		return 0;
1907
	}
1908
1909
	protected int getSizeY(Object object) {
1910
		if (object instanceof Layoutable) {
1911
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
1912
			if (layoutData instanceof XYLayoutData) {
1913
				XYLayoutData xyData = (XYLayoutData) layoutData;
1914
				Dimension size = xyData.getSize();
1915
				if (size != null) {
1916
					return size.getDy();
1917
				}
1918
			}
1919
		}
1920
		return 0;
1921
	}
1922
1923
	protected int getSizeX(Object object) {
1924
		if (object instanceof Layoutable) {
1925
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
1926
			if (layoutData instanceof XYLayoutData) {
1927
				XYLayoutData xyData = (XYLayoutData) layoutData;
1928
				Dimension size = xyData.getSize();
1929
				if (size != null) {
1930
					return size.getDx();
1931
				}
1932
			}
1933
		}
1934
		return 0;
1935
	}
1936
1937
	protected int getAlignmentKind(Object object) {
1938
		if (object instanceof Layoutable) {
1939
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
1940
			if (layoutData instanceof BorderLayoutData) {
1941
				BorderLayoutData borderData = (BorderLayoutData) layoutData;
1942
				boolean vertical = borderData.isVertical();
1943
				return convertAlignment(borderData.getAlignment(), !vertical);
1944
			}
1945
		}
1946
		return ALIGNMENT_CENTER;
1947
	}
1948
1949
	protected int getGridDataAlignmentKind(Object object) {
1950
		if (object instanceof Layoutable) {
1951
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
1952
			if (layoutData instanceof GridLayoutData) {
1953
				GridLayoutData gridData = (GridLayoutData) layoutData;
1954
				int horizontalAlignmentKind = convertAlignment(gridData.getHorizontalAlignment(), true);
1955
				int verticalAlignmentKind = convertAlignment(gridData.getVerticalAlignment(), true);
1956
				if (isCenter(horizontalAlignmentKind)) {
1957
					return convertAlignment(gridData.getVerticalAlignment(), false);
1958
				}
1959
				if (isCenter(verticalAlignmentKind)) {
1960
					return horizontalAlignmentKind;
1961
				}
1962
				if (horizontalAlignmentKind == verticalAlignmentKind) {
1963
					return horizontalAlignmentKind;
1964
				}
1965
			}
1966
		}
1967
		return ALIGNMENT_CENTER;
1968
	}
1969
1970
	protected int getGridDataVerticalSpan(Object object) {
1971
		if (object instanceof Layoutable) {
1972
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
1973
			if (layoutData instanceof GridLayoutData) {
1974
				GridLayoutData gridData = (GridLayoutData) layoutData;
1975
				return gridData.getVerticalSpan();
1976
			}
1977
		}
1978
		return -1;
1979
	}
1980
1981
	protected int getGridDataHorizontalSpan(Object object) {
1982
		if (object instanceof Layoutable) {
1983
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
1984
			if (layoutData instanceof GridLayoutData) {
1985
				GridLayoutData gridData = (GridLayoutData) layoutData;
1986
				return gridData.getHorizontalSpan();
1987
			}
1988
		}
1989
		return -1;
1990
	}
1991
1992
	protected boolean getGridDataGrabVertical(Object object) {
1993
		if (object instanceof Layoutable) {
1994
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
1995
			if (layoutData instanceof GridLayoutData) {
1996
				GridLayoutData gridData = (GridLayoutData) layoutData;
1997
				return gridData.isGrabExcessVerticalSpace();
1998
			}
1999
		}
2000
		return false;
2001
	}
2002
2003
	protected boolean getGridDataGrabHorizontal(Object object) {
2004
		if (object instanceof Layoutable) {
2005
			LayoutData layoutData = ((Layoutable) object).getLayoutData();
2006
			if (layoutData instanceof GridLayoutData) {
2007
				GridLayoutData gridData = (GridLayoutData) layoutData;
2008
				return gridData.isGrabExcessHorizontalSpace();
2009
			}
2010
		}
2011
		return false;
2012
	}
2013
2014
}
(-)src-extra/org/eclipse/gmf/graphdef/editor/sheet/AbstractCustomSectionParent.java (+417 lines)
Added Link Here
1
/*
2
 *  Copyright (c) 2007 Borland Software Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Borland Software Corporation - initial API and implementation
10
 */
11
package org.eclipse.gmf.graphdef.editor.sheet;
12
13
import java.util.Collection;
14
15
import org.eclipse.emf.ecore.EObject;
16
import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AbstractModelerPropertySection;
17
import org.eclipse.swt.SWT;
18
import org.eclipse.swt.custom.CLabel;
19
import org.eclipse.swt.events.ModifyEvent;
20
import org.eclipse.swt.events.ModifyListener;
21
import org.eclipse.swt.events.SelectionEvent;
22
import org.eclipse.swt.events.SelectionListener;
23
import org.eclipse.swt.graphics.Image;
24
import org.eclipse.swt.graphics.Point;
25
import org.eclipse.swt.layout.FormAttachment;
26
import org.eclipse.swt.layout.FormData;
27
import org.eclipse.swt.layout.FormLayout;
28
import org.eclipse.swt.widgets.Button;
29
import org.eclipse.swt.widgets.Composite;
30
import org.eclipse.swt.widgets.Control;
31
import org.eclipse.swt.widgets.Group;
32
import org.eclipse.swt.widgets.Layout;
33
import org.eclipse.swt.widgets.Spinner;
34
import org.eclipse.swt.widgets.Text;
35
import org.eclipse.swt.widgets.Widget;
36
import org.eclipse.ui.forms.events.ExpansionEvent;
37
import org.eclipse.ui.forms.events.IExpansionListener;
38
import org.eclipse.ui.forms.widgets.ExpandableComposite;
39
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
40
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
41
42
public abstract class AbstractCustomSectionParent extends AbstractModelerPropertySection {
43
	public abstract Collection getSavedSelection();
44
	public abstract void doCreateControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage);
45
	public abstract void doDispose();
46
	protected abstract ModelUpdater createModelUpdater();
47
48
	protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
49
	private static final String KIND_KEY = "kind"; //$NON-NLS-1$
50
	
51
	private TabbedPropertySheetPage myTabbedPropertySheetPage;
52
	private boolean areControlsCreated;
53
	private IExpansionListener myExpansionListener;
54
	private ModelUpdater myListener;
55
56
	public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
57
		super.createControls(parent, tabbedPropertySheetPage);
58
		myTabbedPropertySheetPage = tabbedPropertySheetPage;
59
		doCreateControls(parent, tabbedPropertySheetPage);
60
		areControlsCreated = true;
61
	}
62
	
63
	public void dispose() {
64
		if (areControlsCreated) {
65
			doDispose();
66
		}
67
	}
68
	
69
	protected EObject getEObject() {
70
		if (getSavedSelection() != null && !getSavedSelection().isEmpty()) {
71
			return (EObject) getSavedSelection().iterator().next();
72
		}
73
		return super.getEObject();
74
	}
75
	
76
	protected ModelUpdater getListener() {
77
		if (myListener == null) {
78
			myListener = createModelUpdater();
79
		}
80
		return myListener;
81
	}
82
83
	public static abstract class ModelUpdater implements ModifyListener, SelectionListener {
84
		public abstract void applyChangesFrom(Widget widget, int kind);
85
86
		private boolean nonUserChange;
87
88
		public boolean isNonUserChange() {
89
			return nonUserChange;
90
		}
91
92
		public void modifyText(ModifyEvent e) {
93
			if (!isNonUserChange()) {
94
				Integer kind = (Integer) e.widget.getData(KIND_KEY);
95
				applyChangesFrom(e.widget, kind.intValue());
96
			}
97
		}
98
99
		public void widgetDefaultSelected(SelectionEvent e) {
100
			widgetSelected(e);
101
		}
102
103
		public void widgetSelected(SelectionEvent e) {
104
			if (!isNonUserChange()) {
105
				Integer kind = (Integer) e.widget.getData(KIND_KEY);
106
				applyChangesFrom(e.widget, kind.intValue());
107
			}
108
		}
109
110
		public void startListeningTo(Spinner spinner) {
111
			spinner.addModifyListener(this);
112
			spinner.addSelectionListener(this);
113
		}
114
115
		public void stopListeningTo(Spinner spinner) {
116
			spinner.removeModifyListener(this);
117
			spinner.removeSelectionListener(this);
118
		}
119
120
		public void startListeningTo(Text text) {
121
			text.addModifyListener(this);
122
			text.addSelectionListener(this);
123
		}
124
125
		public void stopListeningTo(Text text) {
126
			text.removeModifyListener(this);
127
			text.removeSelectionListener(this);
128
		}
129
130
		public void startListeningTo(Button button) {
131
			button.addSelectionListener(this);
132
		}
133
134
		public void stopListeningTo(Button button) {
135
			button.removeSelectionListener(this);
136
		}
137
138
		public void startNonUserChange() {
139
			nonUserChange = true;
140
		}
141
142
		public void finishNonUserChange() {
143
			nonUserChange = false;
144
		}
145
	}
146
147
	protected IExpansionListener getExpansionListener(final Composite parent) {
148
		if (myExpansionListener == null) {
149
			myExpansionListener = new IExpansionListener() {
150
151
				public void expansionStateChanged(ExpansionEvent e) {
152
					relayoutExpandBar(parent);
153
				}
154
155
				public void expansionStateChanging(ExpansionEvent e) {
156
				}
157
			};
158
		}
159
		return myExpansionListener;
160
	}
161
162
	protected void relayoutExpandBar(Composite expandBar) {
163
		Control control = myTabbedPropertySheetPage.getControl();
164
		Point size = control.getSize();
165
		control.setSize(size.x, size.y - 1);
166
		control.setSize(size.x, size.y);
167
	}
168
169
	// helpers used by old handwritten custom sections
170
171
	protected Layout createStandardFormLayout() {
172
		FormLayout layout = new FormLayout();
173
		layout.marginWidth = ITabbedPropertyConstants.HSPACE + 2;
174
		layout.marginHeight = ITabbedPropertyConstants.VSPACE;
175
		layout.spacing = ITabbedPropertyConstants.VMARGIN + 1;
176
		return layout;
177
	}
178
179
	protected static FormData createFormData(Control leftControl, Control topControl, boolean lowermost) {
180
		return createFormData(leftControl, topControl, null, lowermost);
181
	}
182
183
	protected static FormData createFormData(Control leftControl, Control topControl, Control rightControl, boolean lowermost) {
184
		return createFormData(leftControl, topControl, rightControl, null, true, true, lowermost, false);
185
	}
186
187
	protected static FormData createFormData(Control leftControl, Control topControl, Control rightControl, Control bottomControl, boolean defaultIsLeft, boolean defaultIsTop, boolean lowermost, boolean rightmost) {
188
		FormData data = new FormData();
189
		if (leftControl != null) {
190
			data.left = new FormAttachment(leftControl);
191
		} else if (defaultIsLeft) {
192
			data.left = new FormAttachment(0);
193
		}
194
		if (topControl != null) {
195
			data.top = new FormAttachment(topControl);
196
		} else if (defaultIsTop) {
197
			data.top = new FormAttachment(0);
198
		}
199
		if (rightControl != null) {
200
			data.right = new FormAttachment(rightControl);
201
		} else if (rightmost) {
202
			data.right = new FormAttachment(100);
203
		}
204
		if (lowermost) {
205
			data.bottom = new FormAttachment(100);
206
		}
207
		return data;
208
	}
209
210
	protected Composite createFlatFormComposite(Composite parent, int leftPosition) {
211
		return createFlatFormComposite(parent, leftPosition, false);
212
	}
213
214
	protected Composite createFlatFormComposite(Composite parent, int leftPosition, boolean noData) {
215
		return createFlatFormComposite(parent, null, null, null, null, false, true, false, true, leftPosition, noData);
216
	}
217
218
	protected Composite createFlatFormComposite(Composite parent, Control leftControl, Control topControl, Control rightControl, Control bottomControl, boolean defaultIsLeft, boolean defaultIsTop, boolean lowermost, boolean rightmost, int leftPosition, boolean noData) {
219
		Composite pane = getWidgetFactory().createFlatFormComposite(parent);
220
		if (!noData) {
221
			FormData data = createFormData(leftControl, topControl, rightControl, bottomControl, defaultIsLeft, defaultIsTop, lowermost, rightmost);
222
			if (leftPosition != SWT.DEFAULT) {
223
				data.left = new FormAttachment(leftPosition);
224
			}
225
			pane.setLayoutData(data);
226
		}
227
		return pane;
228
	}
229
	
230
	protected ExpandableComposite createLayoutParamsExpandableComposite(Composite parent, String label, Control topControl, boolean rightmost) {
231
		return createExpandableComposite(parent, label, null, topControl, false, rightmost);
232
	}
233
	
234
	protected ExpandableComposite createExpandableComposite(Composite parent, String label, Control leftControl, Control topControl, boolean lowermost, boolean rightmost) {
235
		ExpandableComposite expandable = getWidgetFactory().createExpandableComposite(parent, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.TITLE_BAR);
236
		expandable.setText(label);
237
		expandable.setBackground(getWidgetFactory().getHyperlinkGroup().getBackground());
238
		expandable.setActiveToggleColor(getWidgetFactory().getHyperlinkGroup().getActiveForeground());
239
		expandable.setTitleBarForeground(getWidgetFactory().getHyperlinkGroup().getForeground());
240
		FormData data = createFormData(leftControl, topControl, null, null, true, true, lowermost, rightmost);
241
		expandable.setLayoutData(data);
242
		return expandable;
243
	}
244
245
	protected Group createGroup(Composite parent, String label) {
246
		return createGroup(parent, label, false);
247
	}
248
249
	protected Group createGroup(Composite parent, String label, boolean noData) {
250
		return createGroup(parent, label, null, null, noData);
251
	}
252
253
	protected Group createGroup(Composite parent, String label, Control leftComposite, Control topComposite) {
254
		return createGroup(parent, label, leftComposite, topComposite, false);
255
	}
256
	
257
	protected Group createGroup(Composite parent, String label, Control leftComposite, Control topComposite, boolean noData) {
258
		return createGroup(parent, label, leftComposite, topComposite, true, true, false, noData);
259
	}
260
261
	protected Group createGroup(Composite parent, String label, Control leftComposite, Control topComposite, boolean defaultIsTop, boolean defaultIsLeft, boolean lowermost, boolean noData) {
262
		Group group = getWidgetFactory().createGroup(parent, label);
263
		if (!noData) {
264
			FormData data = createFormData(leftComposite, topComposite, null, null, defaultIsLeft, defaultIsTop, lowermost, false);
265
			if (leftComposite == null && topComposite != null && !defaultIsLeft) {
266
				Object sd = topComposite.getLayoutData();
267
				if (sd instanceof FormData) {
268
					FormData topData = (FormData) sd;
269
					FormAttachment topLeft = topData.left;
270
					if (topLeft != null) {
271
						data.left = topLeft;
272
					}
273
				}
274
			}
275
			group.setLayoutData(data);
276
		}
277
		group.setLayout(createStandardFormLayout());
278
		return group;
279
	}
280
281
	protected Button createRadio(Composite parent, Control topControl, boolean lowermost, Image image, int kind) {
282
		return createRadio(parent, image, EMPTY_STRING, kind, 0, SWT.DEFAULT, topControl, 0, lowermost);
283
	}
284
285
	protected Button createRadio(Composite parent, String label, int kind, Control topControl, int rightAlignment) {
286
		return createRadio(parent, null, label, kind, 0, rightAlignment, topControl, SWT.DEFAULT, false);
287
	}
288
289
	protected Button createRadio(Composite parent, String label, int kind, Control topControl, boolean lowermost) {
290
		return createRadio(parent, null, label, kind, 0, SWT.DEFAULT, topControl, SWT.DEFAULT, lowermost);
291
	}
292
293
	protected Button createRadio(Composite parent, Image image, String label, int kind, int leftAlignment, int rightAlignment, int topAlignment, boolean lowermost) {
294
		return createRadio(parent, image, label, kind, leftAlignment, rightAlignment, null, topAlignment, lowermost);
295
	}
296
	
297
	protected Button createRadio(Composite parent, Image image, String label, int kind, int leftAlignment, int rightAlignment, Control topControl, int topAlignment, boolean lowermost) {
298
		Button radio = getWidgetFactory().createButton(parent, label == null ? EMPTY_STRING : label, SWT.RADIO);
299
		if (image != null) {
300
			radio.setImage(image);
301
		}
302
		radio.setData(KIND_KEY, Integer.valueOf(kind));
303
		FormData data = createFormData(null, topControl, null, null, true, true, lowermost, false);
304
		data.left = new FormAttachment(leftAlignment);
305
		if (topControl == null && SWT.DEFAULT != topAlignment) {
306
			data.top = new FormAttachment(topAlignment);
307
		}
308
		if (SWT.DEFAULT != rightAlignment) {
309
			data.right = new FormAttachment(rightAlignment);
310
		}
311
		radio.setLayoutData(data);
312
		return radio;
313
	}
314
315
	protected Button createCheckbox(Composite parent, String label, Control topControl, Control leftControl, int kind) {
316
		return createCheckbox(parent, label, topControl, leftControl, kind, false);
317
	}
318
319
	protected Button createCheckbox(Composite parent, String label, Control topControl, Control leftControl, int kind, boolean lowermost) {
320
		return createCheckbox(parent, label, topControl, leftControl, kind, true, true, lowermost, SWT.DEFAULT);
321
	}
322
323
	protected Button createCheckbox(Composite parent, String label, Control topControl, Control leftControl, int kind, boolean defaultIsTop, boolean defaultIsLeft, boolean lowermost, int leftAlignment) {
324
		Button checkbox = getWidgetFactory().createButton(parent, label, SWT.CHECK);
325
		checkbox.setData(KIND_KEY, Integer.valueOf(kind));
326
		FormData data = createFormData(leftControl, topControl, null, null, defaultIsLeft, defaultIsTop, lowermost, false);
327
		if (leftAlignment != SWT.DEFAULT) {
328
			data.left = new FormAttachment(leftAlignment);
329
		}
330
		checkbox.setLayoutData(data);
331
		return checkbox;
332
	}
333
334
	protected Spinner createSpinnerWidget(Composite parent, Control leftWidget, int kind) {
335
		return createSpinnerWidget(parent, leftWidget, null, false, kind, false);
336
	}
337
338
	protected Spinner createSpinnerWidget(Composite parent, Control leftWidget, Control topWidget, boolean rightlast, int kind, boolean horizontalNotVertical) {
339
		return createSpinnerWidget(parent, leftWidget, topWidget, false, rightlast, kind, horizontalNotVertical, 1, 999, 1, 100);
340
	}
341
	
342
	protected Spinner createSpinnerWidget(Composite parent, Control leftControl, Control topControl, boolean lowermost, boolean rightmost, int kind, boolean horizontalNotVertical, int min, int max, int inc, int pageInc) {
343
		Spinner spinner = new Spinner(parent, SWT.BORDER | (horizontalNotVertical ? SWT.H_SCROLL : SWT.V_SCROLL));
344
		spinner.setMinimum(min);
345
		spinner.setMaximum(max);
346
		spinner.setIncrement(inc);
347
		spinner.setPageIncrement(pageInc);
348
		spinner.setBackground(parent.getBackground());
349
		spinner.setForeground(parent.getForeground());
350
		spinner.setData(KIND_KEY, Integer.valueOf(kind));
351
		FormData data = createFormData(leftControl, topControl, null, null, true, true, lowermost, rightmost);
352
		spinner.setLayoutData(data);
353
		return spinner;
354
	}
355
356
	protected Text createText(Composite parent, Control leftWidget, Control topWidget, String initialText, int kind) {
357
		return createText(parent, leftWidget, topWidget, initialText, kind, true, true, false, true);
358
	}
359
	
360
	protected Text createText(Composite parent, Control leftControl, Control topControl, String initialText, int kind, boolean defaultIsTop, boolean defaultIsLeft, boolean lowermost, boolean rightmost) {
361
		Text text = getWidgetFactory().createText(parent, initialText, SWT.BORDER);
362
		text.setData(KIND_KEY, Integer.valueOf(kind));
363
		FormData data = createFormData(leftControl, topControl, null, null, defaultIsLeft, defaultIsTop, lowermost, rightmost);
364
		text.setLayoutData(data);
365
		return text;
366
	}
367
368
	protected CLabel createLabelWidget(Composite parent, String labelText, Control leftWidget) {
369
		return createLabelWidget(parent, labelText, leftWidget, null);
370
	}
371
372
	protected CLabel createLabelWidget(Composite parent, String labelText, Control leftWidget, Control topWidget) {
373
		CLabel label = getWidgetFactory().createCLabel(parent, labelText);
374
		FormData data = createFormData(leftWidget, topWidget, null, false);
375
		label.setLayoutData(data);
376
		return label;
377
	}
378
	
379
	// these ones are used in model customization example templates!
380
381
	public Composite createMainWidget(Composite parent) {
382
		return createFlatFormComposite(parent, 0, true);
383
	}
384
385
	public Composite createCompositeWidget(Composite parent, String label, Control leftControl, Control topControl, Control rightControl, Control bottomControl, boolean defaultIsLeft, boolean defaultIsTop, boolean lowermost, boolean rightmost) {
386
		return createFlatFormComposite(parent, leftControl, topControl, rightControl, bottomControl, defaultIsLeft, defaultIsTop, lowermost, rightmost, SWT.DEFAULT, false);
387
	}
388
389
	public ExpandableComposite createExpandableComposite(Composite parent, String label, Control leftControl, Control topControl, Control rightControl, Control bottomControl, boolean defaultIsLeft, boolean defaultIsTop, boolean lowermost, boolean rightmost) {
390
		return createExpandableComposite(parent, label, leftControl, topControl, lowermost, rightmost);
391
	}
392
393
	public Group createGroupWidget(Composite parent, String label, Control leftControl, Control topControl, Control rightControl, Control bottomControl, boolean defaultIsLeft, boolean defaultIsTop, boolean lowermost, boolean rightmost) {
394
		return createGroup(parent, label, leftControl, topControl, defaultIsTop, defaultIsLeft, lowermost, false);
395
	}
396
397
	public Button createRadioButton(Composite parent, String label, Control leftControl, Control topControl, Control rightControl, Control bottomControl, boolean defaultIsLeft, boolean defaultIsTop, boolean lowermost, boolean rightmost) {
398
		return createRadio(parent, label, 0, topControl, lowermost);
399
	}
400
401
	public Button createCheckboxButton(Composite parent, String label, Control leftControl, Control topControl, Control rightControl, Control bottomControl, boolean defaultIsLeft, boolean defaultIsTop, boolean lowermost, boolean rightmost) {
402
		return createCheckbox(parent, label, topControl, leftControl, 0, defaultIsTop, defaultIsLeft, lowermost, SWT.DEFAULT);
403
	}
404
	
405
	public Spinner createSpinnerWidget(Composite parent, String label, int min, int max, int inc, int pageInc, Control leftControl, Control topControl, Control rightControl, Control bottomControl, boolean defaultIsLeft, boolean defaultIsTop, boolean lowermost, boolean rightmost) {
406
		return createSpinnerWidget(parent, leftControl, topControl, lowermost, rightmost, 0, false, min, max, inc, pageInc);
407
	}
408
	
409
	public Text createTextWidget(Composite parent, String label, Control leftControl, Control topControl, Control rightControl, Control bottomControl, boolean defaultIsLeft, boolean defaultIsTop, boolean lowermost, boolean rightmost) {
410
		return createText(parent, leftControl, topControl, label, 0, defaultIsTop, defaultIsLeft, lowermost, rightmost);
411
	}
412
413
	public CLabel createLabelWidget(Composite parent, String label, Control leftControl, Control topControl, Control rightControl, Control bottomControl, boolean defaultIsLeft, boolean defaultIsTop, boolean lowermost, boolean rightmost) {
414
		return createLabelWidget(parent, label, leftControl, topControl);
415
	}
416
417
}
(-)models/propsheet.genmodel (+85 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<genmodel:GenModel xmi:version="2.0"
3
    xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
4
    xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.gmf.graphdef.propsheet/src"
5
    editDirectory="/org.eclipse.gmf.graphdef.propsheet.edit/src" editorDirectory="/org.eclipse.gmf.graphdef.propsheet.edit/src"
6
    modelPluginID="org.eclipse.gmf.graphdef.propsheet" modelName="Propsheet" importerID="org.eclipse.emf.importer.ecore"
7
    usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore platform:/plugin/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel#//genmodel platform:/plugin/org.eclipse.gmf.codegen/models/gmfgen.genmodel#//gmfgen">
8
  <foreignModel>propsheet.ecore</foreignModel>
9
  <genPackages prefix="Propsheet" basePackage="org.eclipse.gmf.graphdef" disposableProviderFactory="true"
10
      ecorePackage="propsheet.ecore#/">
11
    <genEnums typeSafeEnumCompatible="false" ecoreEnum="propsheet.ecore#//Positions">
12
      <genEnumLiterals ecoreEnumLiteral="propsheet.ecore#//Positions/LEFT"/>
13
      <genEnumLiterals ecoreEnumLiteral="propsheet.ecore#//Positions/RIGHT"/>
14
      <genEnumLiterals ecoreEnumLiteral="propsheet.ecore#//Positions/TOP"/>
15
      <genEnumLiterals ecoreEnumLiteral="propsheet.ecore#//Positions/BOTTOM"/>
16
    </genEnums>
17
    <genClasses ecoreClass="propsheet.ecore#//PropertySectionContainer">
18
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference propsheet.ecore#//PropertySectionContainer/customSections"/>
19
    </genClasses>
20
    <genClasses image="false" ecoreClass="propsheet.ecore#//CustomPropertySection">
21
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference propsheet.ecore#//CustomPropertySection/genTab"/>
22
    </genClasses>
23
    <genClasses ecoreClass="propsheet.ecore#//Sectionable">
24
      <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference propsheet.ecore#//Sectionable/parent"/>
25
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference propsheet.ecore#//Sectionable/target"/>
26
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference propsheet.ecore#//Sectionable/layoutConstraints"/>
27
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//Sectionable/name"/>
28
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//Sectionable/visibleOnlyForTargets"/>
29
    </genClasses>
30
    <genClasses ecoreClass="propsheet.ecore#//CustomControl">
31
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//CustomControl/implementationClass"/>
32
    </genClasses>
33
    <genClasses ecoreClass="propsheet.ecore#//Labeled">
34
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference propsheet.ecore#//Labeled/text"/>
35
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//Labeled/grayed"/>
36
    </genClasses>
37
    <genClasses ecoreClass="propsheet.ecore#//Iconed">
38
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//Iconed/iconPath"/>
39
    </genClasses>
40
    <genClasses ecoreClass="propsheet.ecore#//Group">
41
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference propsheet.ecore#//Group/contents"/>
42
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference propsheet.ecore#//Group/modelElement"/>
43
    </genClasses>
44
    <genClasses ecoreClass="propsheet.ecore#//Label"/>
45
    <genClasses ecoreClass="propsheet.ecore#//Checkbox">
46
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference propsheet.ecore#//Checkbox/modelElement"/>
47
    </genClasses>
48
    <genClasses ecoreClass="propsheet.ecore#//Radio">
49
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference propsheet.ecore#//Radio/modelElement"/>
50
    </genClasses>
51
    <genClasses ecoreClass="propsheet.ecore#//Spin">
52
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference propsheet.ecore#//Spin/modelElement"/>
53
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//Spin/min"/>
54
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//Spin/max"/>
55
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//Spin/inc"/>
56
    </genClasses>
57
    <genClasses ecoreClass="propsheet.ecore#//TextField">
58
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference propsheet.ecore#//TextField/modelElement"/>
59
    </genClasses>
60
    <genClasses image="false" ecoreClass="propsheet.ecore#//LayoutConstraints"/>
61
    <genClasses ecoreClass="propsheet.ecore#//FormLayoutConstraints">
62
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference propsheet.ecore#//FormLayoutConstraints/anchorControl"/>
63
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//FormLayoutConstraints/relativePosition"/>
64
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//FormLayoutConstraints/rightmost"/>
65
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//FormLayoutConstraints/lowermost"/>
66
    </genClasses>
67
    <genClasses ecoreClass="propsheet.ecore#//Text">
68
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//Text/overridedItemProviderText"/>
69
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute propsheet.ecore#//Text/createLabel"/>
70
    </genClasses>
71
    <genClasses image="false" ecoreClass="propsheet.ecore#//Reference"/>
72
    <genClasses ecoreClass="propsheet.ecore#//FeatureReference">
73
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference propsheet.ecore#//FeatureReference/feature"/>
74
    </genClasses>
75
    <genClasses image="false" ecoreClass="propsheet.ecore#//BooleanCondition"/>
76
    <genClasses ecoreClass="propsheet.ecore#//IntValue"/>
77
    <genClasses ecoreClass="propsheet.ecore#//StringValue"/>
78
    <genClasses ecoreClass="propsheet.ecore#//IsFeatureOfTypeReference">
79
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference propsheet.ecore#//IsFeatureOfTypeReference/isOfType"/>
80
    </genClasses>
81
    <genClasses ecoreClass="propsheet.ecore#//IsFeatureIsOfKindReference">
82
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference propsheet.ecore#//IsFeatureIsOfKindReference/isOfValue"/>
83
    </genClasses>
84
  </genPackages>
85
</genmodel:GenModel>
(-)src-extra/org/eclipse/gmf/graphdef/editor/sheet/CustomStylesPropertySection.java (+432 lines)
Added Link Here
1
/*
2
 *  Copyright (c) 2007 Borland Software Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Borland Software Corporation - initial API and implementation
10
 */
11
package org.eclipse.gmf.graphdef.editor.sheet;
12
13
import org.eclipse.swt.widgets.Composite;
14
import org.eclipse.swt.widgets.Widget;
15
16
public abstract class CustomStylesPropertySection extends AbstractCustomSectionParent {
17
18
	public abstract java.util.Collection getSavedSelection();
19
20
	public abstract org.eclipse.jface.resource.ImageRegistry getImageRegistry();
21
22
	private static final int FILL = 101;
23
24
	private static final int OUTLINE = 102;
25
26
	private static final int XOR_FILL = 103;
27
28
	private static final int XOR_OUTLINE = 104;
29
30
	private static final int CORNER_WIDTH = 201;
31
32
	private static final int CORNER_HEIGHT = 202;
33
34
	private static final int LINE_WIDTH = 203;
35
36
	private org.eclipse.swt.widgets.Group myLineStyleGroup;
37
38
	private org.eclipse.swt.widgets.Group myLineWidthGroup;
39
40
	private org.eclipse.swt.widgets.Group myFillOutlineGroup;
41
42
	private org.eclipse.swt.widgets.Group myCornerGroup;
43
44
	private org.eclipse.swt.widgets.Spinner myLineWidthSpinner;
45
46
	private org.eclipse.swt.widgets.Button myLineStyle_Solid;
47
48
	private org.eclipse.swt.widgets.Button myLineStyle_Dash;
49
50
	private org.eclipse.swt.widgets.Button myLineStyle_Dot;
51
52
	private org.eclipse.swt.widgets.Button myLineStyle_DashDot;
53
54
	private org.eclipse.swt.widgets.Button myLineStyle_DashDotDot;
55
56
	private org.eclipse.swt.widgets.Button myLineStyle_Custom;
57
58
	private org.eclipse.swt.widgets.Button myFillCheckbox;
59
60
	private org.eclipse.swt.widgets.Button myOutlineCheckbox;
61
62
	private org.eclipse.swt.widgets.Button myXorFillCheckbox;
63
64
	private org.eclipse.swt.widgets.Button myXorOutlineCheckbox;
65
66
	private org.eclipse.swt.widgets.Spinner myCornerWidthSpinner;
67
68
	private org.eclipse.swt.widgets.Spinner myCornerHeightSpinner;
69
70
	public void doCreateControls(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage tabbedPropertySheetPage) {
71
		Composite mainComposite = getWidgetFactory().createFlatFormComposite(parent);
72
		myLineStyleGroup = createGroup(mainComposite, getLineStyleLabel(), null, null);
73
		myLineStyle_Solid = createRadio(myLineStyleGroup, null, false, getImageRegistry().get(org.eclipse.gmf.gmfgraph.LineKind.LINE_SOLID_LITERAL.getLiteral()),
74
				org.eclipse.swt.SWT.LINE_SOLID);
75
		myLineStyle_Dash = createRadio(myLineStyleGroup, myLineStyle_Solid, false, getImageRegistry().get(org.eclipse.gmf.gmfgraph.LineKind.LINE_DASH_LITERAL.getLiteral()),
76
				org.eclipse.swt.SWT.LINE_DASH);
77
		myLineStyle_Dot = createRadio(myLineStyleGroup, myLineStyle_Dash, false, getImageRegistry().get(org.eclipse.gmf.gmfgraph.LineKind.LINE_DOT_LITERAL.getLiteral()),
78
				org.eclipse.swt.SWT.LINE_DOT);
79
		myLineStyle_DashDot = createRadio(myLineStyleGroup, myLineStyle_Dot, false, getImageRegistry().get(org.eclipse.gmf.gmfgraph.LineKind.LINE_DASHDOT_LITERAL.getLiteral()),
80
				org.eclipse.swt.SWT.LINE_DASHDOT);
81
		myLineStyle_DashDotDot = createRadio(myLineStyleGroup, myLineStyle_DashDot, false, getImageRegistry().get(org.eclipse.gmf.gmfgraph.LineKind.LINE_DASHDOTDOT_LITERAL.getLiteral()),
82
				org.eclipse.swt.SWT.LINE_DASHDOTDOT);
83
		myLineStyle_Custom = createRadio(myLineStyleGroup, myLineStyle_DashDotDot, true, getImageRegistry().get(org.eclipse.gmf.gmfgraph.LineKind.LINE_CUSTOM_LITERAL.getLiteral()),
84
				org.eclipse.swt.SWT.LINE_CUSTOM);
85
86
		myLineWidthGroup = createGroup(mainComposite, getLineWidthLabel(), myLineStyleGroup, null);
87
		// org.eclipse.swt.custom.CLabel lineWidthLabel =
88
		// createLabelWidget(myLineWidthGroup, getLineWidthLabel(), null);
89
		myLineWidthSpinner = createSpinnerWidget(myLineWidthGroup, null, LINE_WIDTH);
90
91
		myFillOutlineGroup = createGroup(mainComposite, getFillOutlineLabel(), myLineStyleGroup, myLineWidthGroup);
92
		myFillCheckbox = createCheckbox(myFillOutlineGroup, getFillPropertyNameLabel(), null, null, FILL);
93
		myOutlineCheckbox = createCheckbox(myFillOutlineGroup, getOutlinePropertyNameLabel(), myFillCheckbox, null, OUTLINE);
94
		myXorFillCheckbox = createCheckbox(myFillOutlineGroup, getXorFillPropertyNameLabel(), null, myFillCheckbox, XOR_FILL);
95
		myXorOutlineCheckbox = createCheckbox(myFillOutlineGroup, getXorOutlinePropertyNameLabel(), myXorFillCheckbox, myOutlineCheckbox, XOR_OUTLINE);
96
97
		myCornerGroup = createGroup(mainComposite, getCornerDimensionsLabel(), myLineStyleGroup, myFillOutlineGroup);
98
		org.eclipse.swt.custom.CLabel cornerWidthLabel = createLabelWidget(myCornerGroup, getCornerWidthLabel(), null);
99
		myCornerWidthSpinner = createSpinnerWidget(myCornerGroup, cornerWidthLabel, CORNER_WIDTH);
100
		org.eclipse.swt.custom.CLabel cornerHeigthLabel = createLabelWidget(myCornerGroup, getCornerHeightLabel(), myCornerWidthSpinner);
101
		myCornerHeightSpinner = createSpinnerWidget(myCornerGroup, cornerHeigthLabel, CORNER_HEIGHT);
102
103
		getListener().startListeningTo(myLineWidthSpinner);
104
		getListener().startListeningTo(myLineStyle_Solid);
105
		getListener().startListeningTo(myLineStyle_Dash);
106
		getListener().startListeningTo(myLineStyle_Dot);
107
		getListener().startListeningTo(myLineStyle_DashDot);
108
		getListener().startListeningTo(myLineStyle_DashDotDot);
109
		getListener().startListeningTo(myLineStyle_Custom);
110
		getListener().startListeningTo(myFillCheckbox);
111
		getListener().startListeningTo(myOutlineCheckbox);
112
		getListener().startListeningTo(myXorFillCheckbox);
113
		getListener().startListeningTo(myXorOutlineCheckbox);
114
		getListener().startListeningTo(myCornerWidthSpinner);
115
		getListener().startListeningTo(myCornerHeightSpinner);
116
	}
117
118
	public void doDispose() {
119
		getListener().stopListeningTo(myLineWidthSpinner);
120
		getListener().stopListeningTo(myLineStyle_Solid);
121
		getListener().stopListeningTo(myLineStyle_Dash);
122
		getListener().stopListeningTo(myLineStyle_Dot);
123
		getListener().stopListeningTo(myLineStyle_DashDot);
124
		getListener().stopListeningTo(myLineStyle_DashDotDot);
125
		getListener().stopListeningTo(myLineStyle_Custom);
126
		getListener().stopListeningTo(myFillCheckbox);
127
		getListener().stopListeningTo(myOutlineCheckbox);
128
		getListener().stopListeningTo(myXorFillCheckbox);
129
		getListener().stopListeningTo(myXorOutlineCheckbox);
130
		getListener().stopListeningTo(myCornerWidthSpinner);
131
		getListener().stopListeningTo(myCornerHeightSpinner);
132
	}
133
134
	private String getCornerDimensionsLabel() {
135
		return "Corner Dimensions";
136
	}
137
138
	private String getCornerWidthLabel() {
139
		return "Corner Width";
140
	}
141
142
	private String getCornerHeightLabel() {
143
		return "Corner Height";
144
	}
145
146
	private String getFillPropertyNameLabel() {
147
		return "Fill";
148
	}
149
150
	private String getOutlinePropertyNameLabel() {
151
		return "Outline";
152
	}
153
154
	private String getXorFillPropertyNameLabel() {
155
		return "XOR Fill";
156
	}
157
158
	private String getXorOutlinePropertyNameLabel() {
159
		return "XOR Outline";
160
	}
161
162
	private String getFillOutlineLabel() {
163
		return "Mix Styles";
164
	}
165
166
	private String getLineStyleLabel() {
167
		return "Line Style";
168
	}
169
170
	private String getLineWidthLabel() {
171
		return "Line Width";
172
	}
173
174
	protected void setLineWidth(final int lineWidth) {
175
		modifyModel(new RunnableWithShape() {
176
177
			public void run() {
178
				getShape().setLineWidth(lineWidth);
179
			}
180
		}, "Setting line width");
181
	}
182
183
	protected void setLineKind(final int lineKind) {
184
		modifyModel(new RunnableWithShape() {
185
186
			public void run() {
187
				getShape().setLineKind(org.eclipse.gmf.gmfgraph.LineKind.get(lineKind));
188
			}
189
		}, "Setting line style");
190
	}
191
192
	protected void setFill(final boolean value) {
193
		modifyModel(new RunnableWithShape() {
194
195
			public void run() {
196
				getShape().setFill(value);
197
			}
198
		}, "Setting shape fill");
199
	}
200
201
	protected void setOutline(final boolean value) {
202
		modifyModel(new RunnableWithShape() {
203
204
			public void run() {
205
				getShape().setOutline(value);
206
			}
207
		}, "Setting shape outline");
208
	}
209
210
	protected void setXorFill(final boolean value) {
211
		modifyModel(new RunnableWithShape() {
212
213
			public void run() {
214
				getShape().setXorFill(value);
215
			}
216
		}, "Setting shape XOR fill");
217
	}
218
219
	protected void setXorOutline(final boolean value) {
220
		modifyModel(new RunnableWithShape() {
221
222
			public void run() {
223
				getShape().setXorOutline(value);
224
			}
225
		}, "Setting shape XOR outline");
226
	}
227
228
	protected void setCornerWidth(final int cornerWidth) {
229
		modifyModel(new RunnableWithShape() {
230
231
			public void run() {
232
				((org.eclipse.gmf.gmfgraph.RoundedRectangle) getShape()).setCornerWidth(cornerWidth);
233
			}
234
		}, "Setting corner width");
235
	}
236
237
	protected void setCornerHeight(final int cornerHeight) {
238
		modifyModel(new RunnableWithShape() {
239
240
			public void run() {
241
				((org.eclipse.gmf.gmfgraph.RoundedRectangle) getShape()).setCornerHeight(cornerHeight);
242
			}
243
		}, "Setting corner height");
244
	}
245
246
	public static abstract class RunnableWithShape implements Runnable {
247
248
		private org.eclipse.gmf.gmfgraph.Shape myShape;
249
250
		public org.eclipse.gmf.gmfgraph.Shape getShape() {
251
			return myShape;
252
		}
253
254
		public void setTargetShape(org.eclipse.gmf.gmfgraph.Shape shape) {
255
			myShape = shape;
256
		}
257
	}
258
259
	protected void modifyModel(RunnableWithShape runnable, String commandName) {
260
		java.util.ArrayList commands = new java.util.ArrayList();
261
		for (java.util.Iterator it = getSavedSelection().iterator(); it.hasNext();) {
262
			final org.eclipse.emf.ecore.EObject next = (org.eclipse.emf.ecore.EObject) it.next();
263
			if (next instanceof org.eclipse.gmf.gmfgraph.Shape) {
264
				final org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) next;
265
				runnable.setTargetShape(shape);
266
				commands.add(createCommand(commandName, next, runnable));
267
			}
268
		}
269
		executeAsCompositeCommand(commandName, commands);
270
		refresh();
271
	}
272
273
	public ModelUpdater createModelUpdater() {
274
		return new ModelUpdater() {
275
276
			public void applyChangesFrom(Widget widget, int kind) {
277
				if (widget instanceof org.eclipse.swt.widgets.Spinner) {
278
					int value = ((org.eclipse.swt.widgets.Spinner) widget).getSelection();
279
					switch (kind) {
280
					case CORNER_WIDTH: {
281
						setCornerWidth(value);
282
						break;
283
					}
284
					case CORNER_HEIGHT: {
285
						setCornerHeight(value);
286
						break;
287
					}
288
					case LINE_WIDTH: {
289
						setLineWidth(value);
290
						break;
291
					}
292
					}
293
				} else if (widget instanceof org.eclipse.swt.widgets.Button) {
294
					boolean turnedOn = ((org.eclipse.swt.widgets.Button) widget).getSelection();
295
					switch (kind) {
296
					case org.eclipse.swt.SWT.LINE_SOLID:
297
					case org.eclipse.swt.SWT.LINE_DASH:
298
					case org.eclipse.swt.SWT.LINE_DOT:
299
					case org.eclipse.swt.SWT.LINE_DASHDOT:
300
					case org.eclipse.swt.SWT.LINE_DASHDOTDOT:
301
					case org.eclipse.swt.SWT.LINE_CUSTOM: {
302
						setLineKind(kind);
303
						break;
304
					}
305
					case FILL: {
306
						setFill(turnedOn);
307
						break;
308
					}
309
					case OUTLINE: {
310
						setOutline(turnedOn);
311
						break;
312
					}
313
					case XOR_FILL: {
314
						setXorFill(turnedOn);
315
						break;
316
					}
317
					case XOR_OUTLINE: {
318
						setXorOutline(turnedOn);
319
						break;
320
					}
321
					}
322
				}
323
			}
324
		};
325
	}
326
327
	private int getLineKind(Object object) {
328
		if (object instanceof org.eclipse.gmf.gmfgraph.Shape) {
329
			org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) object;
330
			return shape.getLineKind().getValue();
331
		}
332
		return -1;
333
	}
334
335
	private int getLineWidth(Object object) {
336
		if (object instanceof org.eclipse.gmf.gmfgraph.Shape) {
337
			org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) object;
338
			return shape.getLineWidth();
339
		}
340
		return -1;
341
	}
342
343
	private boolean getFill(Object object) {
344
		if (object instanceof org.eclipse.gmf.gmfgraph.Shape) {
345
			org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) object;
346
			return shape.isFill();
347
		}
348
		return false;
349
	}
350
351
	private boolean getOutline(Object object) {
352
		if (object instanceof org.eclipse.gmf.gmfgraph.Shape) {
353
			org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) object;
354
			return shape.isOutline();
355
		}
356
		return false;
357
	}
358
359
	private boolean getXorFill(Object object) {
360
		if (object instanceof org.eclipse.gmf.gmfgraph.Shape) {
361
			org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) object;
362
			return shape.isXorFill();
363
		}
364
		return false;
365
	}
366
367
	private boolean getXorOutline(Object object) {
368
		if (object instanceof org.eclipse.gmf.gmfgraph.Shape) {
369
			org.eclipse.gmf.gmfgraph.Shape shape = (org.eclipse.gmf.gmfgraph.Shape) object;
370
			return shape.isXorOutline();
371
		}
372
		return false;
373
	}
374
375
	private int getCornerWidth(Object object) {
376
		if (object instanceof org.eclipse.gmf.gmfgraph.RoundedRectangle) {
377
			org.eclipse.gmf.gmfgraph.RoundedRectangle cornered = (org.eclipse.gmf.gmfgraph.RoundedRectangle) object;
378
			return cornered.getCornerWidth();
379
		}
380
		return -1;
381
	}
382
383
	private int getCornerHeight(Object object) {
384
		if (object instanceof org.eclipse.gmf.gmfgraph.RoundedRectangle) {
385
			org.eclipse.gmf.gmfgraph.RoundedRectangle cornered = (org.eclipse.gmf.gmfgraph.RoundedRectangle) object;
386
			return cornered.getCornerHeight();
387
		}
388
		return -1;
389
	}
390
391
	public void refresh() {
392
		getListener().startNonUserChange();
393
		try {
394
			for (java.util.Iterator it = getSavedSelection().iterator(); it.hasNext();) {
395
				final Object next = it.next();
396
				executeAsReadAction(new Runnable() {
397
398
					public void run() {
399
						int lineWidth = getLineWidth(next);
400
						if (lineWidth != -1) {
401
							myLineWidthSpinner.setSelection(lineWidth);
402
						}
403
						int lineKind = getLineKind(next);
404
						myLineStyle_Solid.setSelection(lineKind == org.eclipse.swt.SWT.LINE_SOLID);
405
						myLineStyle_Dash.setSelection(lineKind == org.eclipse.swt.SWT.LINE_DASH);
406
						myLineStyle_Dot.setSelection(lineKind == org.eclipse.swt.SWT.LINE_DOT);
407
						myLineStyle_DashDot.setSelection(lineKind == org.eclipse.swt.SWT.LINE_DASHDOT);
408
						myLineStyle_DashDotDot.setSelection(lineKind == org.eclipse.swt.SWT.LINE_DASHDOTDOT);
409
						myLineStyle_Custom.setSelection(lineKind == org.eclipse.swt.SWT.LINE_CUSTOM);
410
						myFillCheckbox.setSelection(getFill(next));
411
						myOutlineCheckbox.setSelection(getOutline(next));
412
						myXorFillCheckbox.setSelection(getXorFill(next));
413
						myXorOutlineCheckbox.setSelection(getXorOutline(next));
414
						myCornerGroup.setVisible(next instanceof org.eclipse.gmf.gmfgraph.RoundedRectangle);
415
						if (myCornerGroup.isVisible()) {
416
							int cornerWidth = getCornerWidth(next);
417
							if (cornerWidth != -1) {
418
								myCornerWidthSpinner.setSelection(cornerWidth);
419
							}
420
							int cornerHeight = getCornerHeight(next);
421
							if (cornerHeight != -1) {
422
								myCornerHeightSpinner.setSelection(cornerHeight);
423
							}
424
						}
425
					}
426
				});
427
			}
428
		} finally {
429
			getListener().finishNonUserChange();
430
		}
431
	}
432
}

Return to bug 173499