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

Collapse All | Expand All

(-)src/org/eclipse/gmf/bridge/genmodel/DefaultViewmapProducer.java (+27 lines)
Lines 14-19 Link Here
14
import org.eclipse.gmf.codegen.gmfgen.FigureViewmap;
14
import org.eclipse.gmf.codegen.gmfgen.FigureViewmap;
15
import org.eclipse.gmf.codegen.gmfgen.GMFGenFactory;
15
import org.eclipse.gmf.codegen.gmfgen.GMFGenFactory;
16
import org.eclipse.gmf.codegen.gmfgen.ResizeConstraints;
16
import org.eclipse.gmf.codegen.gmfgen.ResizeConstraints;
17
import org.eclipse.gmf.codegen.gmfgen.StyleAttributes;
17
import org.eclipse.gmf.codegen.gmfgen.Viewmap;
18
import org.eclipse.gmf.codegen.gmfgen.Viewmap;
18
import org.eclipse.gmf.codegen.gmfgen.ViewmapLayoutType;
19
import org.eclipse.gmf.codegen.gmfgen.ViewmapLayoutType;
19
import org.eclipse.gmf.gmfgraph.Canvas;
20
import org.eclipse.gmf.gmfgraph.Canvas;
Lines 21-26 Link Here
21
import org.eclipse.gmf.gmfgraph.Connection;
22
import org.eclipse.gmf.gmfgraph.Connection;
22
import org.eclipse.gmf.gmfgraph.DiagramLabel;
23
import org.eclipse.gmf.gmfgraph.DiagramLabel;
23
import org.eclipse.gmf.gmfgraph.Direction;
24
import org.eclipse.gmf.gmfgraph.Direction;
25
import org.eclipse.gmf.gmfgraph.Figure;
24
import org.eclipse.gmf.gmfgraph.FigureHandle;
26
import org.eclipse.gmf.gmfgraph.FigureHandle;
25
import org.eclipse.gmf.gmfgraph.FlowLayout;
27
import org.eclipse.gmf.gmfgraph.FlowLayout;
26
import org.eclipse.gmf.gmfgraph.Layout;
28
import org.eclipse.gmf.gmfgraph.Layout;
Lines 87-92 Link Here
87
		ViewmapLayoutType type = myLayoutTypeSwitch.getLayoutType(((Layoutable) figure).getLayout());
89
		ViewmapLayoutType type = myLayoutTypeSwitch.getLayoutType(((Layoutable) figure).getLayout());
88
		viewmap.setLayoutType(type);
90
		viewmap.setLayoutType(type);
89
	}
91
	}
92
	
93
	protected final void setupGeneratedProperties(Viewmap viewmap, FigureHandle handle){
94
		if (viewmap == null || false == handle instanceof Figure){
95
			return;
96
		}
97
		Figure figure = (Figure)handle;
98
		StyleAttributes attributes = GMFGenFactory.eINSTANCE.createStyleAttributes();
99
		boolean fixedSomething = false;
100
		if (figure.getFont() != null){
101
			attributes.setFixedFont(true);
102
			fixedSomething = true;
103
		}
104
		if (figure.getForegroundColor() != null){
105
			attributes.setFixedForeground(true);
106
			fixedSomething = true;
107
		}
108
		if (figure.getBackgroundColor() != null){
109
			attributes.setFixedBackground(true);
110
			fixedSomething = true;
111
		}
112
		
113
		if (fixedSomething){
114
			viewmap.getAttributes().add(attributes);
115
		}
116
	}
90
117
91
	private static class LayoutTypeSwitch extends GMFGraphSwitch {
118
	private static class LayoutTypeSwitch extends GMFGraphSwitch {
92
		
119
		
(-)src/org/eclipse/gmf/bridge/genmodel/InnerClassViewmapProducer.java (-5 / +9 lines)
Lines 98-104 Link Here
98
		return createViewmap(compartment.getFigure());
98
		return createViewmap(compartment.getFigure());
99
	}
99
	}
100
	
100
	
101
	private Viewmap createViewmap(Figure figure) {
101
	private Viewmap createFigureViewmap(Figure figure) {
102
		Viewmap result;
102
		Viewmap result;
103
		if (EcoreUtil.isAncestor(processedFigures, figure.getParent())) {
103
		if (EcoreUtil.isAncestor(processedFigures, figure.getParent())) {
104
			// we generated code for parent, thus (if figure generation logic not changed)
104
			// we generated code for parent, thus (if figure generation logic not changed)
Lines 132-146 Link Here
132
	}
132
	}
133
133
134
	private Viewmap createViewmap(FigureHandle figure) {
134
	private Viewmap createViewmap(FigureHandle figure) {
135
		Viewmap result;
135
		if (figure instanceof Figure) {
136
		if (figure instanceof Figure) {
136
			return createViewmap((Figure) figure);
137
			result = createFigureViewmap((Figure) figure);
137
		} else if (figure instanceof FigureAccessor) {
138
		} else if (figure instanceof FigureAccessor) {
138
			return createViewmap((FigureAccessor) figure);
139
			result = createFigureAccessorViewmap((FigureAccessor) figure);
140
		} else {
141
			throw new IllegalStateException();
139
		}
142
		}
140
		throw new IllegalStateException();
143
		setupGeneratedProperties(result, figure);
144
		return result;
141
	}
145
	}
142
146
143
	private Viewmap createViewmap(FigureAccessor figureAccess) {
147
	private Viewmap createFigureAccessorViewmap(FigureAccessor figureAccess) {
144
		ParentAssignedViewmap v = GMFGenFactory.eINSTANCE.createParentAssignedViewmap();
148
		ParentAssignedViewmap v = GMFGenFactory.eINSTANCE.createParentAssignedViewmap();
145
		v.setGetterName(figureAccess.getAccessor());
149
		v.setGetterName(figureAccess.getAccessor());
146
		if (figureAccess.getTypedFigure() != null) {
150
		if (figureAccess.getTypedFigure() != null) {
(-)src/org/eclipse/gmf/codegen/gmfgen/provider/GMFGenItemProviderAdapterFactory.java (+23 lines)
Lines 602-607 Link Here
602
	}
602
	}
603
603
604
	/**
604
	/**
605
	 * This keeps track of the one adapter used for all {@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes} instances.
606
	 * <!-- begin-user-doc -->
607
	 * <!-- end-user-doc -->
608
	 * @generated
609
	 */
610
	protected StyleAttributesItemProvider styleAttributesItemProvider;
611
612
	/**
613
	 * This creates an adapter for a {@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes}.
614
	 * <!-- begin-user-doc -->
615
	 * <!-- end-user-doc -->
616
	 * @generated
617
	 */
618
	public Adapter createStyleAttributesAdapter() {
619
		if (styleAttributesItemProvider == null) {
620
			styleAttributesItemProvider = new StyleAttributesItemProvider(this);
621
		}
622
623
		return styleAttributesItemProvider;
624
	}
625
626
	/**
605
	 * This keeps track of the one adapter used for all {@link org.eclipse.gmf.codegen.gmfgen.ResizeConstraints} instances.
627
	 * This keeps track of the one adapter used for all {@link org.eclipse.gmf.codegen.gmfgen.ResizeConstraints} instances.
606
	 * <!-- begin-user-doc -->
628
	 * <!-- begin-user-doc -->
607
	 * <!-- end-user-doc -->
629
	 * <!-- end-user-doc -->
Lines 1337-1342 Link Here
1337
		if (compositeFeatureLabelModelFacetItemProvider != null) compositeFeatureLabelModelFacetItemProvider.dispose();
1359
		if (compositeFeatureLabelModelFacetItemProvider != null) compositeFeatureLabelModelFacetItemProvider.dispose();
1338
		if (designLabelModelFacetItemProvider != null) designLabelModelFacetItemProvider.dispose();
1360
		if (designLabelModelFacetItemProvider != null) designLabelModelFacetItemProvider.dispose();
1339
		if (colorAttributesItemProvider != null) colorAttributesItemProvider.dispose();
1361
		if (colorAttributesItemProvider != null) colorAttributesItemProvider.dispose();
1362
		if (styleAttributesItemProvider != null) styleAttributesItemProvider.dispose();
1340
		if (resizeConstraintsItemProvider != null) resizeConstraintsItemProvider.dispose();
1363
		if (resizeConstraintsItemProvider != null) resizeConstraintsItemProvider.dispose();
1341
		if (defaultSizeAttributesItemProvider != null) defaultSizeAttributesItemProvider.dispose();
1364
		if (defaultSizeAttributesItemProvider != null) defaultSizeAttributesItemProvider.dispose();
1342
		if (labelOffsetAttributesItemProvider != null) labelOffsetAttributesItemProvider.dispose();
1365
		if (labelOffsetAttributesItemProvider != null) labelOffsetAttributesItemProvider.dispose();
(-)src/org/eclipse/gmf/codegen/gmfgen/provider/ViewmapItemProvider.java (+5 lines)
Lines 183-188 Link Here
183
		newChildDescriptors.add
183
		newChildDescriptors.add
184
			(createChildParameter
184
			(createChildParameter
185
				(GMFGenPackage.eINSTANCE.getViewmap_Attributes(),
185
				(GMFGenPackage.eINSTANCE.getViewmap_Attributes(),
186
				 GMFGenFactory.eINSTANCE.createStyleAttributes()));
187
188
		newChildDescriptors.add
189
			(createChildParameter
190
				(GMFGenPackage.eINSTANCE.getViewmap_Attributes(),
186
				 GMFGenFactory.eINSTANCE.createResizeConstraints()));
191
				 GMFGenFactory.eINSTANCE.createResizeConstraints()));
187
192
188
		newChildDescriptors.add
193
		newChildDescriptors.add
(-)plugin.properties (-1 / +5 lines)
Lines 450-454 Link Here
450
_UI_GenLanguage_nregexp_literal = nregexp
450
_UI_GenLanguage_nregexp_literal = nregexp
451
451
452
452
453
_UI_BatchValidation_validationDecoratorProviderPriority_feature = Validation Decorator Provider Priority
453
_UI_BatchValidation_validationDecoratorProviderPriority_feature = Validation Decorator Provider Priority
454
_UI_DesignLabelModelFacet_type = Design Label Model Facet
454
_UI_DesignLabelModelFacet_type = Design Label Model Facet
455
_UI_StyleAttributes_type = Style Attributes
456
_UI_StyleAttributes_fixedFont_feature = Fixed Font
457
_UI_StyleAttributes_fixedForeground_feature = Fixed Foreground
458
_UI_StyleAttributes_fixedBackground_feature = Fixed Background
(-)src/org/eclipse/gmf/codegen/gmfgen/provider/StyleAttributesItemProvider.java (+202 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.gmf.codegen.gmfgen.provider;
8
9
10
import java.util.Collection;
11
import java.util.List;
12
13
import org.eclipse.emf.common.notify.AdapterFactory;
14
import org.eclipse.emf.common.notify.Notification;
15
16
import org.eclipse.emf.common.util.ResourceLocator;
17
18
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
19
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
20
import org.eclipse.emf.edit.provider.IItemLabelProvider;
21
import org.eclipse.emf.edit.provider.IItemPropertySource;
22
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
23
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
24
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
25
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
26
import org.eclipse.emf.edit.provider.ViewerNotification;
27
28
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
29
import org.eclipse.gmf.codegen.gmfgen.StyleAttributes;
30
31
import org.eclipse.gmf.codegen.gmfgen.presentation.EditorPlugin;
32
33
/**
34
 * This is the item provider adapter for a {@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes} object.
35
 * <!-- begin-user-doc -->
36
 * <!-- end-user-doc -->
37
 * @generated
38
 */
39
public class StyleAttributesItemProvider
40
	extends ItemProviderAdapter
41
	implements	
42
		IEditingDomainItemProvider,	
43
		IStructuredItemContentProvider,	
44
		ITreeItemContentProvider,	
45
		IItemLabelProvider,	
46
		IItemPropertySource {
47
	/**
48
	 * This constructs an instance from a factory and a notifier.
49
	 * <!-- begin-user-doc -->
50
	 * <!-- end-user-doc -->
51
	 * @generated
52
	 */
53
	public StyleAttributesItemProvider(AdapterFactory adapterFactory) {
54
		super(adapterFactory);
55
	}
56
57
	/**
58
	 * This returns the property descriptors for the adapted class.
59
	 * <!-- begin-user-doc -->
60
	 * <!-- end-user-doc -->
61
	 * @generated
62
	 */
63
	public List getPropertyDescriptors(Object object) {
64
		if (itemPropertyDescriptors == null) {
65
			super.getPropertyDescriptors(object);
66
67
			addFixedFontPropertyDescriptor(object);
68
			addFixedForegroundPropertyDescriptor(object);
69
			addFixedBackgroundPropertyDescriptor(object);
70
		}
71
		return itemPropertyDescriptors;
72
	}
73
74
	/**
75
	 * This adds a property descriptor for the Fixed Font feature.
76
	 * <!-- begin-user-doc -->
77
	 * <!-- end-user-doc -->
78
	 * @generated
79
	 */
80
	protected void addFixedFontPropertyDescriptor(Object object) {
81
		itemPropertyDescriptors.add
82
			(createItemPropertyDescriptor
83
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
84
				 getResourceLocator(),
85
				 getString("_UI_StyleAttributes_fixedFont_feature"),
86
				 getString("_UI_PropertyDescriptor_description", "_UI_StyleAttributes_fixedFont_feature", "_UI_StyleAttributes_type"),
87
				 GMFGenPackage.eINSTANCE.getStyleAttributes_FixedFont(),
88
				 true,
89
				 false,
90
				 false,
91
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
92
				 null,
93
				 null));
94
	}
95
96
	/**
97
	 * This adds a property descriptor for the Fixed Foreground feature.
98
	 * <!-- begin-user-doc -->
99
	 * <!-- end-user-doc -->
100
	 * @generated
101
	 */
102
	protected void addFixedForegroundPropertyDescriptor(Object object) {
103
		itemPropertyDescriptors.add
104
			(createItemPropertyDescriptor
105
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
106
				 getResourceLocator(),
107
				 getString("_UI_StyleAttributes_fixedForeground_feature"),
108
				 getString("_UI_PropertyDescriptor_description", "_UI_StyleAttributes_fixedForeground_feature", "_UI_StyleAttributes_type"),
109
				 GMFGenPackage.eINSTANCE.getStyleAttributes_FixedForeground(),
110
				 true,
111
				 false,
112
				 false,
113
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
114
				 null,
115
				 null));
116
	}
117
118
	/**
119
	 * This adds a property descriptor for the Fixed Background feature.
120
	 * <!-- begin-user-doc -->
121
	 * <!-- end-user-doc -->
122
	 * @generated
123
	 */
124
	protected void addFixedBackgroundPropertyDescriptor(Object object) {
125
		itemPropertyDescriptors.add
126
			(createItemPropertyDescriptor
127
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
128
				 getResourceLocator(),
129
				 getString("_UI_StyleAttributes_fixedBackground_feature"),
130
				 getString("_UI_PropertyDescriptor_description", "_UI_StyleAttributes_fixedBackground_feature", "_UI_StyleAttributes_type"),
131
				 GMFGenPackage.eINSTANCE.getStyleAttributes_FixedBackground(),
132
				 true,
133
				 false,
134
				 false,
135
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
136
				 null,
137
				 null));
138
	}
139
140
	/**
141
	 * This returns StyleAttributes.gif.
142
	 * <!-- begin-user-doc -->
143
	 * <!-- end-user-doc -->
144
	 * @generated
145
	 */
146
	public Object getImage(Object object) {
147
		return overlayImage(object, getResourceLocator().getImage("full/obj16/StyleAttributes"));
148
	}
149
150
	/**
151
	 * This returns the label text for the adapted class.
152
	 * <!-- begin-user-doc -->
153
	 * <!-- end-user-doc -->
154
	 * @generated
155
	 */
156
	public String getText(Object object) {
157
		StyleAttributes styleAttributes = (StyleAttributes)object;
158
		return getString("_UI_StyleAttributes_type") + " " + styleAttributes.isFixedFont();
159
	}
160
161
	/**
162
	 * This handles model notifications by calling {@link #updateChildren} to update any cached
163
	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
164
	 * <!-- begin-user-doc -->
165
	 * <!-- end-user-doc -->
166
	 * @generated
167
	 */
168
	public void notifyChanged(Notification notification) {
169
		updateChildren(notification);
170
171
		switch (notification.getFeatureID(StyleAttributes.class)) {
172
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FONT:
173
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FOREGROUND:
174
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_BACKGROUND:
175
				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
176
				return;
177
		}
178
		super.notifyChanged(notification);
179
	}
180
181
	/**
182
	 * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
183
	 * describing all of the children that can be created under this object.
184
	 * <!-- begin-user-doc -->
185
	 * <!-- end-user-doc -->
186
	 * @generated
187
	 */
188
	protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) {
189
		super.collectNewChildDescriptors(newChildDescriptors, object);
190
	}
191
192
	/**
193
	 * Return the resource locator for this item provider's resources.
194
	 * <!-- begin-user-doc -->
195
	 * <!-- end-user-doc -->
196
	 * @generated
197
	 */
198
	public ResourceLocator getResourceLocator() {
199
		return EditorPlugin.INSTANCE;
200
	}
201
202
}
(-)src/org/eclipse/gmf/tests/gef/DiagramNodeTest.java (-1 / +46 lines)
Lines 11-16 Link Here
11
 */
11
 */
12
package org.eclipse.gmf.tests.gef;
12
package org.eclipse.gmf.tests.gef;
13
13
14
import org.eclipse.draw2d.IFigure;
15
import org.eclipse.draw2d.PolylineConnection;
14
import org.eclipse.draw2d.PositionConstants;
16
import org.eclipse.draw2d.PositionConstants;
15
import org.eclipse.draw2d.geometry.Dimension;
17
import org.eclipse.draw2d.geometry.Dimension;
16
import org.eclipse.draw2d.geometry.Point;
18
import org.eclipse.draw2d.geometry.Point;
Lines 20-25 Link Here
20
import org.eclipse.gef.commands.Command;
22
import org.eclipse.gef.commands.Command;
21
import org.eclipse.gef.requests.ChangeBoundsRequest;
23
import org.eclipse.gef.requests.ChangeBoundsRequest;
22
import org.eclipse.gmf.codegen.gmfgen.GenLink;
24
import org.eclipse.gmf.codegen.gmfgen.GenLink;
25
import org.eclipse.gmf.gmfgraph.Color;
26
import org.eclipse.gmf.gmfgraph.Connection;
27
import org.eclipse.gmf.gmfgraph.Figure;
28
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
29
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
23
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
30
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
24
import org.eclipse.gmf.runtime.notation.Edge;
31
import org.eclipse.gmf.runtime.notation.Edge;
25
import org.eclipse.gmf.runtime.notation.FillStyle;
32
import org.eclipse.gmf.runtime.notation.FillStyle;
Lines 29-38 Link Here
29
import org.eclipse.gmf.runtime.notation.NotationPackage;
36
import org.eclipse.gmf.runtime.notation.NotationPackage;
30
import org.eclipse.gmf.runtime.notation.Size;
37
import org.eclipse.gmf.runtime.notation.Size;
31
import org.eclipse.gmf.runtime.notation.View;
38
import org.eclipse.gmf.runtime.notation.View;
39
import org.eclipse.gmf.tests.gen.GenericFigureCheck;
40
import org.eclipse.jface.preference.IPreferenceStore;
41
import org.eclipse.jface.preference.PreferenceConverter;
32
import org.eclipse.swt.graphics.RGB;
42
import org.eclipse.swt.graphics.RGB;
33
43
34
public class DiagramNodeTest extends DiagramTestBase {
44
public class DiagramNodeTest extends DiagramTestBase {
35
45
	private final GenericFigureCheck.ColorTransformer ourColorTransformer = new GenericFigureCheck.ColorTransformer();
36
	private final Point myMoveDelta = new Point(10, 20);
46
	private final Point myMoveDelta = new Point(10, 20);
37
	private final Dimension mySizeDelta = new Dimension(100, 50);
47
	private final Dimension mySizeDelta = new Dimension(100, 50);
38
48
Lines 45-50 Link Here
45
		View nodeB = getNotation(getNodeEditPartB());
55
		View nodeB = getNotation(getNodeEditPartB());
46
		ConnectionEditPart linkByClass = createAndCheckLink(nodeA, nodeB, getSetup().getGenModel().getLinkC());
56
		ConnectionEditPart linkByClass = createAndCheckLink(nodeA, nodeB, getSetup().getGenModel().getLinkC());
47
		assertNotNull(linkByClass);
57
		assertNotNull(linkByClass);
58
59
		//there is already linkByRef between a and b, use new target
60
		nodeB = createNode(getSetup().getGenModel().getNodeB(), getDiagram());
61
		ConnectionEditPart linkByRef = createAndCheckLink(nodeA, nodeB, getSetup().getGenModel().getLinkD());
62
		assertNotNull(linkByRef);
63
	}
64
	
65
	public void testNotColoredLink(){
66
		View nodeA = getNotation(getNodeEditPartA());
67
		View nodeB = getNotation(getNodeEditPartB());
68
		ConnectionEditPart linkByClass = createAndCheckLink(nodeA, nodeB, getSetup().getGenModel().getLinkC());
69
		checkLinkColor(linkByClass, getSetup().getMapModel().getClassLink().getDiagramLink());
70
	}
71
	
72
	public void testColoredLink(){
73
		View nodeA = createNode(getSetup().getGenModel().getNodeA(), getDiagram());
74
		View nodeB = createNode(getSetup().getGenModel().getNodeB(), getDiagram());
75
		ConnectionEditPart linkByRef = createAndCheckLink(nodeA, nodeB, getSetup().getGenModel().getLinkD());
76
		checkLinkColor(linkByRef, getSetup().getMapModel().getReferenceLink().getDiagramLink());
48
	}
77
	}
49
78
50
	private ConnectionEditPart createAndCheckLink(View source, View target, GenLink genLinkType){
79
	private ConnectionEditPart createAndCheckLink(View source, View target, GenLink genLinkType){
Lines 59-64 Link Here
59
		assertNotNull(newLinkEditPart);
88
		assertNotNull(newLinkEditPart);
60
		return newLinkEditPart;
89
		return newLinkEditPart;
61
	}
90
	}
91
	
92
	private void checkLinkColor(ConnectionEditPart newLinkEditPart, Connection gmfGraphConnection){
93
		IFigure actual = newLinkEditPart.getFigure();
94
		assertTrue(actual instanceof PolylineConnection);
95
		Figure gmfFigure = (Figure)gmfGraphConnection.getFigure();
96
		Color gmfColor = gmfFigure.getForegroundColor();
97
		RGB expectedRGB = gmfColor == null ? getDefaultLinkColor() : ourColorTransformer.gmf2swt(gmfColor);
98
		assertEquals(expectedRGB, actual.getForegroundColor().getRGB());
99
	}
100
101
	private RGB getDefaultLinkColor() {
102
		return PreferenceConverter.getColor(getDefaults(), IPreferenceConstants.PREF_LINE_COLOR);
103
	}
62
104
63
	public void testChangeBounds() {
105
	public void testChangeBounds() {
64
		final EditPart editPart = getNodeEditPartA();
106
		final EditPart editPart = getNodeEditPartA();
Lines 172-175 Link Here
172
		assertEquals("Background color doesn't match after [" + assertTag + ']', expectedBackgroundColor, getBackgroundColor(notation));
214
		assertEquals("Background color doesn't match after [" + assertTag + ']', expectedBackgroundColor, getBackgroundColor(notation));
173
	}
215
	}
174
216
217
	private IPreferenceStore getDefaults() {
218
		return (IPreferenceStore) PreferencesHint.USE_DEFAULTS.getPreferenceStore();
219
	}
175
}
220
}
(-)src/org/eclipse/gmf/tests/setup/RTSource.java (-1 / +2 lines)
Lines 23-27 Link Here
23
	Diagram getCanvas();
23
	Diagram getCanvas();
24
	Node getNodeA();
24
	Node getNodeA();
25
	Node getNodeB();
25
	Node getNodeB();
26
	Edge getLink();
26
	Edge getLinkByClass();
27
	Edge getLinkByRef();
27
}
28
}
(-)src/org/eclipse/gmf/tests/setup/CompartmentsSessionSetup.java (+55 lines)
Lines 24-35 Link Here
24
import org.eclipse.emf.ecore.EcorePackage;
24
import org.eclipse.emf.ecore.EcorePackage;
25
import org.eclipse.emf.ecore.util.EcoreUtil;
25
import org.eclipse.emf.ecore.util.EcoreUtil;
26
import org.eclipse.gmf.gmfgraph.Canvas;
26
import org.eclipse.gmf.gmfgraph.Canvas;
27
import org.eclipse.gmf.gmfgraph.Color;
28
import org.eclipse.gmf.gmfgraph.ColorConstants;
27
import org.eclipse.gmf.gmfgraph.Compartment;
29
import org.eclipse.gmf.gmfgraph.Compartment;
30
import org.eclipse.gmf.gmfgraph.Connection;
31
import org.eclipse.gmf.gmfgraph.ConnectionFigure;
32
import org.eclipse.gmf.gmfgraph.ConstantColor;
28
import org.eclipse.gmf.gmfgraph.DiagramLabel;
33
import org.eclipse.gmf.gmfgraph.DiagramLabel;
29
import org.eclipse.gmf.gmfgraph.Figure;
34
import org.eclipse.gmf.gmfgraph.Figure;
30
import org.eclipse.gmf.gmfgraph.FigureGallery;
35
import org.eclipse.gmf.gmfgraph.FigureGallery;
31
import org.eclipse.gmf.gmfgraph.GMFGraphFactory;
36
import org.eclipse.gmf.gmfgraph.GMFGraphFactory;
32
import org.eclipse.gmf.gmfgraph.Node;
37
import org.eclipse.gmf.gmfgraph.Node;
38
import org.eclipse.gmf.gmfgraph.Rectangle;
33
import org.eclipse.gmf.mappings.ChildReference;
39
import org.eclipse.gmf.mappings.ChildReference;
34
import org.eclipse.gmf.mappings.CompartmentMapping;
40
import org.eclipse.gmf.mappings.CompartmentMapping;
35
import org.eclipse.gmf.mappings.GMFMapFactory;
41
import org.eclipse.gmf.mappings.GMFMapFactory;
Lines 95-100 Link Here
95
		 * @return compartment, hasTitle = false, collapsible = false
101
		 * @return compartment, hasTitle = false, collapsible = false
96
		 */
102
		 */
97
		public Compartment getCompartmentB();
103
		public Compartment getCompartmentB();
104
		
105
		/**
106
		 * @return node, foreground = red, background = blue
107
		 */
108
		public Node getColoredNode();
109
		
110
		/**
111
		 * @return connection, foreground = orange
112
		 */
113
		public Connection getColoredConnection();
98
	}
114
	}
99
	
115
	
100
	public static interface DomainModelSourceExtension extends DomainModelSource {
116
	public static interface DomainModelSourceExtension extends DomainModelSource {
Lines 105-121 Link Here
105
	protected static class DiaDefSetupWithCompartments extends DiaDefSetup implements DiaDefSourceExtension {
121
	protected static class DiaDefSetupWithCompartments extends DiaDefSetup implements DiaDefSourceExtension {
106
		private Compartment myCollapsibleCompartmentWithTitle;
122
		private Compartment myCollapsibleCompartmentWithTitle;
107
		private Compartment myCompartmentNoTitleNoCollapse;
123
		private Compartment myCompartmentNoTitleNoCollapse;
124
		private Node myColoredNode;
125
		private Connection myColoredConnection;
108
		
126
		
109
		public void setupCanvasDef(Canvas canvasDef) {
127
		public void setupCanvasDef(Canvas canvasDef) {
110
			FigureGallery oneMoreGallery = GMFGraphFactory.eINSTANCE.createFigureGallery();
128
			FigureGallery oneMoreGallery = GMFGraphFactory.eINSTANCE.createFigureGallery();
111
			canvasDef.getFigures().add(oneMoreGallery);
129
			canvasDef.getFigures().add(oneMoreGallery);
112
			Figure compartmentFigure = GMFGraphFactory.eINSTANCE.createRectangle();
130
			Figure compartmentFigure = GMFGraphFactory.eINSTANCE.createRectangle();
131
			compartmentFigure.setName("CompartmentFigure");
113
			oneMoreGallery.getFigures().add(compartmentFigure);
132
			oneMoreGallery.getFigures().add(compartmentFigure);
114
			myCollapsibleCompartmentWithTitle = createCompartment(compartmentFigure, "Compartment_Title_Collapse", true, true);
133
			myCollapsibleCompartmentWithTitle = createCompartment(compartmentFigure, "Compartment_Title_Collapse", true, true);
115
			canvasDef.getCompartments().add(myCollapsibleCompartmentWithTitle);
134
			canvasDef.getCompartments().add(myCollapsibleCompartmentWithTitle);
116
			
135
			
117
			myCompartmentNoTitleNoCollapse = createCompartment(compartmentFigure, "Compartment_NoTitle_No_Collapse", false, false);
136
			myCompartmentNoTitleNoCollapse = createCompartment(compartmentFigure, "Compartment_NoTitle_No_Collapse", false, false);
118
			canvasDef.getCompartments().add(myCompartmentNoTitleNoCollapse);
137
			canvasDef.getCompartments().add(myCompartmentNoTitleNoCollapse);
138
			
139
			Rectangle colored = GMFGraphFactory.eINSTANCE.createRectangle();
140
			colored.setForegroundColor(createColor(ColorConstants.RED_LITERAL));
141
			colored.setBackgroundColor(createColor(ColorConstants.BLUE_LITERAL));
142
			colored.setName("ColoredRectangle");
143
			oneMoreGallery.getFigures().add(colored);
144
			myColoredNode = GMFGraphFactory.eINSTANCE.createNode();
145
			myColoredNode.setName("ColoredRectangleNode");
146
			myColoredNode.setFigure(colored);
147
			getCanvasDef().getNodes().add(myColoredNode);
148
			
149
			ConnectionFigure connectionLink = GMFGraphFactory.eINSTANCE.createPolylineConnection();
150
			connectionLink.setName("ColoredLink");
151
			connectionLink.setForegroundColor(createColor(ColorConstants.ORANGE_LITERAL));
152
			oneMoreGallery.getFigures().add(connectionLink);
153
			myColoredConnection = GMFGraphFactory.eINSTANCE.createConnection();
154
			myColoredConnection.setName("ColoredLinkConnection");
155
			myColoredConnection.setFigure(connectionLink);
156
			getCanvasDef().getConnections().add(myColoredConnection);
119
		}
157
		}
120
		
158
		
121
		protected void setupNodeDef(Node nodeDef) {
159
		protected void setupNodeDef(Node nodeDef) {
Lines 131-136 Link Here
131
			return myCompartmentNoTitleNoCollapse;
169
			return myCompartmentNoTitleNoCollapse;
132
		}
170
		}
133
		
171
		
172
		public Connection getColoredConnection() {
173
			return myColoredConnection;
174
		}
175
		
176
		public Node getColoredNode() {
177
			return myColoredNode;
178
		}
179
		
134
		private Compartment createCompartment(Figure figure, String name, boolean collapsible, boolean needsTitle){
180
		private Compartment createCompartment(Figure figure, String name, boolean collapsible, boolean needsTitle){
135
			Compartment result = GMFGraphFactory.eINSTANCE.createCompartment();
181
			Compartment result = GMFGraphFactory.eINSTANCE.createCompartment();
136
			result.setFigure(figure);
182
			result.setFigure(figure);
Lines 139-144 Link Here
139
			result.setCollapsible(collapsible);
185
			result.setCollapsible(collapsible);
140
			return result;
186
			return result;
141
		}
187
		}
188
		
189
		private Color createColor(ColorConstants color){
190
			ConstantColor result = GMFGraphFactory.eINSTANCE.createConstantColor();
191
			result.setValue(color);
192
			return result;
193
		}
142
	}
194
	}
143
	
195
	
144
	protected static class DomainSetupWithChildren extends DomainModelSetup implements DomainModelSourceExtension {
196
	protected static class DomainSetupWithChildren extends DomainModelSetup implements DomainModelSourceExtension {
Lines 194-199 Link Here
194
			
246
			
195
			MapSetup result = super.init(ddSource, domainSource, toolDef);
247
			MapSetup result = super.init(ddSource, domainSource, toolDef);
196
			
248
			
249
			getNodeB().setDiagramNode(diaDefSetupWithCompartments.getColoredNode());
250
			getReferenceLink().setDiagramLink(diaDefSetupWithCompartments.getColoredConnection());
251
			
197
			setupReferenceAndCompartment(ddSource, diaDefSetupWithCompartments.getCompartmentA(), domainWithChildren.getChildOfA(), result.getNodeA());
252
			setupReferenceAndCompartment(ddSource, diaDefSetupWithCompartments.getCompartmentA(), domainWithChildren.getChildOfA(), result.getNodeA());
198
			setupReferenceAndCompartment(ddSource, diaDefSetupWithCompartments.getCompartmentB(), domainWithChildren.getChildOfB(), result.getNodeB());
253
			setupReferenceAndCompartment(ddSource, diaDefSetupWithCompartments.getCompartmentB(), domainWithChildren.getChildOfB(), result.getNodeB());
199
254
(-)src/org/eclipse/gmf/tests/setup/RTSetup.java (-17 / +34 lines)
Lines 34-39 Link Here
34
import org.eclipse.emf.ecore.resource.ResourceSet;
34
import org.eclipse.emf.ecore.resource.ResourceSet;
35
import org.eclipse.emf.transaction.TransactionalEditingDomain;
35
import org.eclipse.emf.transaction.TransactionalEditingDomain;
36
import org.eclipse.emf.workspace.AbstractEMFOperation;
36
import org.eclipse.emf.workspace.AbstractEMFOperation;
37
import org.eclipse.gmf.codegen.gmfgen.FeatureLinkModelFacet;
37
import org.eclipse.gmf.codegen.gmfgen.GenNode;
38
import org.eclipse.gmf.codegen.gmfgen.GenNode;
38
import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet;
39
import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet;
39
import org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory;
40
import org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory;
Lines 56-62 Link Here
56
	private Diagram myCanvas;
57
	private Diagram myCanvas;
57
	private Node myNodeA;
58
	private Node myNodeA;
58
	private Node myNodeB;
59
	private Node myNodeB;
59
	private Edge myLink;
60
	private Edge myLinkByClass;
61
	private Edge myLinkByRef;
60
	
62
	
61
	private EObject myDiagramElement;
63
	private EObject myDiagramElement;
62
64
Lines 87-109 Link Here
87
		myNodeA = setupNotationNode(genSource.getNodeA(), instanceProducer);
89
		myNodeA = setupNotationNode(genSource.getNodeA(), instanceProducer);
88
		myNodeB = setupNotationNode(genSource.getNodeB(), instanceProducer);
90
		myNodeB = setupNotationNode(genSource.getNodeB(), instanceProducer);
89
91
90
		myLink = NotationFactory.eINSTANCE.createEdge();
92
		myLinkByClass = NotationFactory.eINSTANCE.createEdge();
91
		myCanvas.getPersistedEdges().add(myLink);
93
		myCanvas.getPersistedEdges().add(myLinkByClass);
92
		
94
		
93
		//myNode.setVisualID(genSource.getGenNode().getVisualID());
95
		//myNode.setVisualID(genSource.getGenNode().getVisualID());
94
		TypeLinkModelFacet mf = (TypeLinkModelFacet) genSource.getLinkC().getModelFacet();
96
		TypeLinkModelFacet byClassFacet = (TypeLinkModelFacet) genSource.getLinkC().getModelFacet();
95
		EObject linkElement = instanceProducer.createInstance(mf.getMetaClass());
97
		EObject linkElement = instanceProducer.createInstance(byClassFacet.getMetaClass());
96
		instanceProducer.setFeatureValue(myNodeA.getElement(), linkElement, mf.getContainmentMetaFeature());
98
		instanceProducer.setFeatureValue(myNodeA.getElement(), linkElement, byClassFacet.getContainmentMetaFeature());
97
		instanceProducer.setFeatureValue(linkElement, myNodeB.getElement(), mf.getTargetMetaFeature());
99
		instanceProducer.setFeatureValue(linkElement, myNodeB.getElement(), byClassFacet.getTargetMetaFeature());
98
		myLink.setElement(linkElement);
100
		myLinkByClass.setElement(linkElement);
99
		myLink.setType(String.valueOf(genSource.getLinkC().getVisualID()));
101
		myLinkByClass.setType(String.valueOf(genSource.getLinkC().getVisualID()));
100
		myLink.setSource(myNodeA);
102
		myLinkByClass.setSource(myNodeA);
101
		myLink.setTarget(myNodeB);
103
		myLinkByClass.setTarget(myNodeB);
104
		setBendpoints(myLinkByClass);
105
		
106
		FeatureLinkModelFacet byRefFacet = (FeatureLinkModelFacet) genSource.getLinkD().getModelFacet();
107
		Assert.assertNotNull(byRefFacet);
108
		instanceProducer.setFeatureValue(myNodeA.getElement(), myNodeB.getElement(), byRefFacet.getMetaFeature());
109
		myLinkByRef = NotationFactory.eINSTANCE.createEdge();
110
		myCanvas.getPersistedEdges().add(myLinkByRef);
111
		myLinkByRef.setType(String.valueOf(genSource.getLinkD().getVisualID()));
112
		myLinkByRef.setSource(myNodeA);
113
		myLinkByRef.setTarget(myNodeB);
114
		setBendpoints(myLinkByRef);
102
		
115
		
103
		myLink.setBendpoints(NotationFactory.eINSTANCE.createRelativeBendpoints());
104
		
105
		//myLink.setVisualID(genSource.getGenLink().getVisualID());
106
107
		myCanvas.setType(genSource.getGenDiagram().getEditorGen().getDomainGenModel().getModelName());
116
		myCanvas.setType(genSource.getGenDiagram().getEditorGen().getDomainGenModel().getModelName());
108
117
109
		/*
118
		/*
Lines 119-124 Link Here
119
		*/
128
		*/
120
	}
129
	}
121
	
130
	
131
	private void setBendpoints(Edge edge){
132
		edge.setBendpoints(NotationFactory.eINSTANCE.createRelativeBendpoints());
133
	}
134
	
122
	private Node setupNotationNode(GenNode genNode, DomainInstanceProducer instanceProducer){
135
	private Node setupNotationNode(GenNode genNode, DomainInstanceProducer instanceProducer){
123
		Node result = NotationFactory.eINSTANCE.createNode();
136
		Node result = NotationFactory.eINSTANCE.createNode();
124
		myCanvas.getPersistedChildren().add(result);
137
		myCanvas.getPersistedChildren().add(result);
Lines 176-183 Link Here
176
		return myNodeB;
189
		return myNodeB;
177
	}
190
	}
178
191
179
	public Edge getLink() {
192
	public Edge getLinkByClass() {
180
		return myLink;
193
		return myLinkByClass;
194
	}
195
	
196
	public Edge getLinkByRef() {
197
		return myLinkByRef;
181
	}
198
	}
182
	
199
	
183
	protected EObject getDiagramElement(){
200
	protected EObject getDiagramElement(){
(-)src/org/eclipse/gmf/tests/gen/GenericFigureCheck.java (-20 / +27 lines)
Lines 47-52 Link Here
47
47
48
public class GenericFigureCheck extends FigureCodegenTestBase.FigureCheck {
48
public class GenericFigureCheck extends FigureCodegenTestBase.FigureCheck {
49
	private final Figure myGMFRootFigure;
49
	private final Figure myGMFRootFigure;
50
	private static final ColorTransformer ourColorConstantTransformer = new ColorTransformer();
50
51
51
	public GenericFigureCheck(Figure eFigure){
52
	public GenericFigureCheck(Figure eFigure){
52
		myGMFRootFigure = eFigure;
53
		myGMFRootFigure = eFigure;
Lines 186-199 Link Here
186
		assertNotNull(swtColor);
187
		assertNotNull(swtColor);
187
		assertNotNull(eColor);
188
		assertNotNull(eColor);
188
		
189
		
189
		RGB expectedRGB;
190
		RGB expectedRGB = ourColorConstantTransformer.gmf2swt(eColor);
190
		if (eColor instanceof ConstantColor){
191
			expectedRGB = transformConstantColor((ConstantColor)eColor).getRGB();
192
		} else if (eColor instanceof RGBColor){
193
			expectedRGB = transformRGBColor((RGBColor)eColor);
194
		} else {
195
			throw new IllegalStateException("Unknown color: " + eColor);
196
		}
197
		assertEquals(expectedRGB, swtColor.getRGB());
191
		assertEquals(expectedRGB, swtColor.getRGB());
198
	}
192
	}
199
	
193
	
Lines 231-244 Link Here
231
		}
225
		}
232
	}
226
	}
233
227
234
	private org.eclipse.swt.graphics.Color transformConstantColor(ConstantColor color) {
228
	private static Object getStaticFieldValue(String failureMessage, Class clazz, String fieldName){
235
		Class d2dClass = org.eclipse.draw2d.ColorConstants.class;
236
		Object d2dValue = getStaticFieldValue("Unknown color: " + color, d2dClass, color.getValue().getLiteral());
237
		assertTrue(d2dValue instanceof org.eclipse.swt.graphics.Color);
238
		return (org.eclipse.swt.graphics.Color)d2dValue;
239
	}
240
	
241
	private Object getStaticFieldValue(String failureMessage, Class clazz, String fieldName){
242
		try {
229
		try {
243
			Field constant = clazz.getField(fieldName);
230
			Field constant = clazz.getField(fieldName);
244
			assertNotNull(failureMessage, constant);
231
			assertNotNull(failureMessage, constant);
Lines 251-260 Link Here
251
		}
238
		}
252
	}
239
	}
253
240
254
	private RGB transformRGBColor(RGBColor color) {
255
		return new RGB(color.getRed(), color.getGreen(), color.getBlue());
256
	}
257
258
	protected void checkPreferredSize(Figure gmfFigure, IFigure figure) {
241
	protected void checkPreferredSize(Figure gmfFigure, IFigure figure) {
259
		if (gmfFigure.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_PreferredSize())){
242
		if (gmfFigure.eIsSet(GMFGraphPackage.eINSTANCE.getFigure_PreferredSize())){
260
			Dimension ePreferredSize = gmfFigure.getPreferredSize();
243
			Dimension ePreferredSize = gmfFigure.getPreferredSize();
Lines 345-349 Link Here
345
		assertNotNull(eInsets);
328
		assertNotNull(eInsets);
346
		assertEquals(new org.eclipse.draw2d.geometry.Insets(eInsets.getTop(), eInsets.getLeft(), eInsets.getBottom(), eInsets.getRight()), d2dInsets);
329
		assertEquals(new org.eclipse.draw2d.geometry.Insets(eInsets.getTop(), eInsets.getLeft(), eInsets.getBottom(), eInsets.getRight()), d2dInsets);
347
	}
330
	}
331
	
332
	public static class ColorTransformer {
333
		public RGB gmf2swt(Color color){
334
			if (color instanceof ConstantColor){
335
				return gmfConstant2swt((ConstantColor)color);
336
			}
337
			if (color instanceof RGBColor){
338
				return gmfRGB2swt((RGBColor)color);
339
			}
340
			throw new IllegalArgumentException("Unknown color:" + color);
341
		}
342
		
343
		public RGB gmfConstant2swt(ConstantColor gmfColor){
344
			Class d2dClass = org.eclipse.draw2d.ColorConstants.class;
345
			Object d2dValue = getStaticFieldValue("Unknown color: " + gmfColor, d2dClass, gmfColor.getValue().getLiteral());
346
			assertTrue(d2dValue instanceof org.eclipse.swt.graphics.Color);
347
			return ((org.eclipse.swt.graphics.Color)d2dValue).getRGB();
348
		}
349
350
		public RGB gmfRGB2swt(RGBColor gmfColor){
351
			return new RGB(gmfColor.getRed(), gmfColor.getGreen(), gmfColor.getBlue());
352
		}
353
	
354
	}
348
355
349
}
356
}
(-)src/org/eclipse/gmf/tests/gen/ViewmapProducersTest.java (+86 lines)
Lines 24-34 Link Here
24
import org.eclipse.gmf.codegen.gmfgen.InnerClassViewmap;
24
import org.eclipse.gmf.codegen.gmfgen.InnerClassViewmap;
25
import org.eclipse.gmf.codegen.gmfgen.ParentAssignedViewmap;
25
import org.eclipse.gmf.codegen.gmfgen.ParentAssignedViewmap;
26
import org.eclipse.gmf.codegen.gmfgen.ResizeConstraints;
26
import org.eclipse.gmf.codegen.gmfgen.ResizeConstraints;
27
import org.eclipse.gmf.codegen.gmfgen.StyleAttributes;
27
import org.eclipse.gmf.codegen.gmfgen.Viewmap;
28
import org.eclipse.gmf.codegen.gmfgen.Viewmap;
28
import org.eclipse.gmf.codegen.gmfgen.ViewmapLayoutType;
29
import org.eclipse.gmf.codegen.gmfgen.ViewmapLayoutType;
30
import org.eclipse.gmf.gmfgraph.BasicFont;
31
import org.eclipse.gmf.gmfgraph.Color;
29
import org.eclipse.gmf.gmfgraph.ColorConstants;
32
import org.eclipse.gmf.gmfgraph.ColorConstants;
30
import org.eclipse.gmf.gmfgraph.Compartment;
33
import org.eclipse.gmf.gmfgraph.Compartment;
31
import org.eclipse.gmf.gmfgraph.Connection;
34
import org.eclipse.gmf.gmfgraph.Connection;
35
import org.eclipse.gmf.gmfgraph.ConnectionFigure;
32
import org.eclipse.gmf.gmfgraph.ConstantColor;
36
import org.eclipse.gmf.gmfgraph.ConstantColor;
33
import org.eclipse.gmf.gmfgraph.CustomConnection;
37
import org.eclipse.gmf.gmfgraph.CustomConnection;
34
import org.eclipse.gmf.gmfgraph.CustomFigure;
38
import org.eclipse.gmf.gmfgraph.CustomFigure;
Lines 38-43 Link Here
38
import org.eclipse.gmf.gmfgraph.FigureAccessor;
42
import org.eclipse.gmf.gmfgraph.FigureAccessor;
39
import org.eclipse.gmf.gmfgraph.FigureGallery;
43
import org.eclipse.gmf.gmfgraph.FigureGallery;
40
import org.eclipse.gmf.gmfgraph.FlowLayout;
44
import org.eclipse.gmf.gmfgraph.FlowLayout;
45
import org.eclipse.gmf.gmfgraph.FontStyle;
41
import org.eclipse.gmf.gmfgraph.GMFGraphFactory;
46
import org.eclipse.gmf.gmfgraph.GMFGraphFactory;
42
import org.eclipse.gmf.gmfgraph.Label;
47
import org.eclipse.gmf.gmfgraph.Label;
43
import org.eclipse.gmf.gmfgraph.Layout;
48
import org.eclipse.gmf.gmfgraph.Layout;
Lines 374-379 Link Here
374
		checker.check(toolbar, ViewmapLayoutType.TOOLBAR_LAYOUT_LITERAL);
379
		checker.check(toolbar, ViewmapLayoutType.TOOLBAR_LAYOUT_LITERAL);
375
	}
380
	}
376
	
381
	
382
	public void testGeneratedPropertiesAttributes(){
383
		class Checker {
384
			public void check(Viewmap viewmap, boolean font, boolean fore, boolean back){
385
				StyleAttributes attributes = (StyleAttributes) viewmap.find(StyleAttributes.class);
386
				if (font || fore || back){
387
					assertNotNull(attributes);
388
					assertEquals(font, attributes.isFixedFont());
389
					assertEquals(fore, attributes.isFixedForeground());
390
					assertEquals(back, attributes.isFixedBackground());
391
				} else {
392
					assertNull(attributes);
393
				}
394
			}
395
			
396
			public void check(Node node, boolean font, boolean fore, boolean back){
397
				Viewmap viewmap = getProducer().create(node);
398
				check(viewmap, font, fore, back);
399
			}
400
			
401
			public void check(Connection link, boolean font, boolean fore, boolean back){
402
				Viewmap viewmap = getProducer().create(link);
403
				check(viewmap, font, fore, back);
404
			}
405
		}
406
		
407
		Checker checker = new Checker();
408
		
409
		checker.check(createNode("NODE_Empty", GMFGraphFactory.eINSTANCE.createRectangle()), false, false, false);
410
		checker.check(createLink("LINK_Empty", GMFGraphFactory.eINSTANCE.createPolylineConnection()), false, false, false);
411
	
412
		Figure hasFont = GMFGraphFactory.eINSTANCE.createRectangle();
413
		BasicFont font = GMFGraphFactory.eINSTANCE.createBasicFont(); 
414
		font.setFaceName("Arial");
415
		font.setHeight(12);
416
		font.setStyle(FontStyle.BOLD_LITERAL);
417
		hasFont.setFont(font);
418
		checker.check(createNode("NODE_Font", hasFont), true, false, false);
419
420
		Figure hasFore = GMFGraphFactory.eINSTANCE.createRectangle();
421
		hasFore.setForegroundColor(createColor(ColorConstants.GRAY_LITERAL));
422
		checker.check(createNode("NODE_Fore_Color", hasFore), false, true, false);
423
424
		Figure hasBack = GMFGraphFactory.eINSTANCE.createRectangle();
425
		hasBack.setBackgroundColor(createColor(ColorConstants.LIGHT_BLUE_LITERAL)) ;
426
		checker.check(createNode("NODE_Back_Color", hasBack), false, false, true);
427
		
428
		ConnectionFigure polylineWithFont = GMFGraphFactory.eINSTANCE.createPolylineConnection();
429
		polylineWithFont.setFont(font);
430
		checker.check(createLink("Link_Font", polylineWithFont), true, false, false);
431
		
432
		ConnectionFigure polylineWithColor = GMFGraphFactory.eINSTANCE.createPolylineConnection();
433
		polylineWithColor.setForegroundColor(createColor(ColorConstants.RED_LITERAL));
434
		checker.check(createLink("Link_Font", polylineWithColor), false, true, false);
435
		
436
		Figure parent = GMFGraphFactory.eINSTANCE.createRoundedRectangle();
437
		parent.setName("ParentNoColor");
438
		Figure child = GMFGraphFactory.eINSTANCE.createEllipse();
439
		child.setName("ChildWithColor");
440
		child.setForegroundColor(createColor(ColorConstants.GREEN_LITERAL));
441
		parent.getChildren().add(child);
442
				
443
		//only properties of top-level figure should be considered
444
		checker.check(createNode("ParentOfColoredChild", parent), false, false, false);
445
	}
446
	
447
	
377
	private TypeDeclaration parseFirstType(String classContents) {
448
	private TypeDeclaration parseFirstType(String classContents) {
378
		ASTParser p = ASTParser.newParser(AST.JLS3);
449
		ASTParser p = ASTParser.newParser(AST.JLS3);
379
		p.setSource(classContents.toCharArray());
450
		p.setSource(classContents.toCharArray());
Lines 391-396 Link Here
391
		return createNode(name, figure, null);
462
		return createNode(name, figure, null);
392
	}
463
	}
393
	
464
	
465
	private Connection createLink(String name, ConnectionFigure connectionFigure) {
466
		Connection connection = GMFGraphFactory.eINSTANCE.createConnection();
467
		connectionFigure.setName(name);
468
		connection.setName(name);
469
		connection.setFigure(connectionFigure);
470
		return connection;
471
	}
472
394
	private Compartment createCompartment(String name, Figure figure){
473
	private Compartment createCompartment(String name, Figure figure){
395
		assertNotNull(name);
474
		assertNotNull(name);
396
		assertNotNull(figure);
475
		assertNotNull(figure);
Lines 405-410 Link Here
405
		assertNotNull(figure);
484
		assertNotNull(figure);
406
		Node result = GMFGraphFactory.eINSTANCE.createNode();
485
		Node result = GMFGraphFactory.eINSTANCE.createNode();
407
		result.setName(name);
486
		result.setName(name);
487
		figure.setName(name);
408
		result.setFigure(figure);
488
		result.setFigure(figure);
409
		if (optionalConstaint != null){
489
		if (optionalConstaint != null){
410
			result.setResizeConstraint(optionalConstaint);
490
			result.setResizeConstraint(optionalConstaint);
Lines 415-420 Link Here
415
	protected ViewmapProducer getProducer() {
495
	protected ViewmapProducer getProducer() {
416
		return myProducer;
496
		return myProducer;
417
	}
497
	}
498
	
499
	private Color createColor(ColorConstants color) {
500
		ConstantColor result = GMFGraphFactory.eINSTANCE.createConstantColor();
501
		result.setValue(color);
502
		return result;
503
	}
418
504
419
	private class ResizeConstraintsChecker {
505
	private class ResizeConstraintsChecker {
420
		private final List myExpectedNames;
506
		private final List myExpectedNames;
(-)src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java (-3 / +58 lines)
Lines 95-100 Link Here
95
import org.eclipse.gmf.codegen.gmfgen.Shortcuts;
95
import org.eclipse.gmf.codegen.gmfgen.Shortcuts;
96
import org.eclipse.gmf.codegen.gmfgen.SnippetViewmap;
96
import org.eclipse.gmf.codegen.gmfgen.SnippetViewmap;
97
import org.eclipse.gmf.codegen.gmfgen.SpecializationType;
97
import org.eclipse.gmf.codegen.gmfgen.SpecializationType;
98
import org.eclipse.gmf.codegen.gmfgen.StyleAttributes;
98
import org.eclipse.gmf.codegen.gmfgen.ToolEntry;
99
import org.eclipse.gmf.codegen.gmfgen.ToolEntry;
99
import org.eclipse.gmf.codegen.gmfgen.ToolGroup;
100
import org.eclipse.gmf.codegen.gmfgen.ToolGroup;
100
import org.eclipse.gmf.codegen.gmfgen.ToolGroupItem;
101
import org.eclipse.gmf.codegen.gmfgen.ToolGroupItem;
Lines 419-424 Link Here
419
	 * <!-- end-user-doc -->
420
	 * <!-- end-user-doc -->
420
	 * @generated
421
	 * @generated
421
	 */
422
	 */
423
	private EClass styleAttributesEClass = null;
424
425
	/**
426
	 * <!-- begin-user-doc -->
427
	 * <!-- end-user-doc -->
428
	 * @generated
429
	 */
422
	private EClass resizeConstraintsEClass = null;
430
	private EClass resizeConstraintsEClass = null;
423
431
424
	/**
432
	/**
Lines 2680-2685 Link Here
2680
	 * <!-- end-user-doc -->
2688
	 * <!-- end-user-doc -->
2681
	 * @generated
2689
	 * @generated
2682
	 */
2690
	 */
2691
	public EClass getStyleAttributes() {
2692
		return styleAttributesEClass;
2693
	}
2694
2695
	/**
2696
	 * <!-- begin-user-doc -->
2697
	 * <!-- end-user-doc -->
2698
	 * @generated
2699
	 */
2700
	public EAttribute getStyleAttributes_FixedFont() {
2701
		return (EAttribute)styleAttributesEClass.getEStructuralFeatures().get(0);
2702
	}
2703
2704
	/**
2705
	 * <!-- begin-user-doc -->
2706
	 * <!-- end-user-doc -->
2707
	 * @generated
2708
	 */
2709
	public EAttribute getStyleAttributes_FixedForeground() {
2710
		return (EAttribute)styleAttributesEClass.getEStructuralFeatures().get(1);
2711
	}
2712
2713
	/**
2714
	 * <!-- begin-user-doc -->
2715
	 * <!-- end-user-doc -->
2716
	 * @generated
2717
	 */
2718
	public EAttribute getStyleAttributes_FixedBackground() {
2719
		return (EAttribute)styleAttributesEClass.getEStructuralFeatures().get(2);
2720
	}
2721
2722
	/**
2723
	 * <!-- begin-user-doc -->
2724
	 * <!-- end-user-doc -->
2725
	 * @generated
2726
	 */
2683
	public EClass getResizeConstraints() {
2727
	public EClass getResizeConstraints() {
2684
		return resizeConstraintsEClass;
2728
		return resizeConstraintsEClass;
2685
	}
2729
	}
Lines 4067-4072 Link Here
4067
		createEAttribute(colorAttributesEClass, COLOR_ATTRIBUTES__FOREGROUND_COLOR);
4111
		createEAttribute(colorAttributesEClass, COLOR_ATTRIBUTES__FOREGROUND_COLOR);
4068
		createEAttribute(colorAttributesEClass, COLOR_ATTRIBUTES__BACKGROUND_COLOR);
4112
		createEAttribute(colorAttributesEClass, COLOR_ATTRIBUTES__BACKGROUND_COLOR);
4069
4113
4114
		styleAttributesEClass = createEClass(STYLE_ATTRIBUTES);
4115
		createEAttribute(styleAttributesEClass, STYLE_ATTRIBUTES__FIXED_FONT);
4116
		createEAttribute(styleAttributesEClass, STYLE_ATTRIBUTES__FIXED_FOREGROUND);
4117
		createEAttribute(styleAttributesEClass, STYLE_ATTRIBUTES__FIXED_BACKGROUND);
4118
4070
		resizeConstraintsEClass = createEClass(RESIZE_CONSTRAINTS);
4119
		resizeConstraintsEClass = createEClass(RESIZE_CONSTRAINTS);
4071
		createEAttribute(resizeConstraintsEClass, RESIZE_CONSTRAINTS__RESIZE_HANDLES);
4120
		createEAttribute(resizeConstraintsEClass, RESIZE_CONSTRAINTS__RESIZE_HANDLES);
4072
		createEAttribute(resizeConstraintsEClass, RESIZE_CONSTRAINTS__NON_RESIZE_HANDLES);
4121
		createEAttribute(resizeConstraintsEClass, RESIZE_CONSTRAINTS__NON_RESIZE_HANDLES);
Lines 4302-4307 Link Here
4302
		compositeFeatureLabelModelFacetEClass.getESuperTypes().add(this.getLabelModelFacet());
4351
		compositeFeatureLabelModelFacetEClass.getESuperTypes().add(this.getLabelModelFacet());
4303
		designLabelModelFacetEClass.getESuperTypes().add(this.getLabelModelFacet());
4352
		designLabelModelFacetEClass.getESuperTypes().add(this.getLabelModelFacet());
4304
		colorAttributesEClass.getESuperTypes().add(this.getAttributes());
4353
		colorAttributesEClass.getESuperTypes().add(this.getAttributes());
4354
		styleAttributesEClass.getESuperTypes().add(this.getAttributes());
4305
		resizeConstraintsEClass.getESuperTypes().add(this.getAttributes());
4355
		resizeConstraintsEClass.getESuperTypes().add(this.getAttributes());
4306
		defaultSizeAttributesEClass.getESuperTypes().add(this.getAttributes());
4356
		defaultSizeAttributesEClass.getESuperTypes().add(this.getAttributes());
4307
		labelOffsetAttributesEClass.getESuperTypes().add(this.getAttributes());
4357
		labelOffsetAttributesEClass.getESuperTypes().add(this.getAttributes());
Lines 4742-4747 Link Here
4742
		initEAttribute(getColorAttributes_ForegroundColor(), ecorePackage.getEString(), "foregroundColor", null, 0, 1, ColorAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
4792
		initEAttribute(getColorAttributes_ForegroundColor(), ecorePackage.getEString(), "foregroundColor", null, 0, 1, ColorAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
4743
		initEAttribute(getColorAttributes_BackgroundColor(), ecorePackage.getEString(), "backgroundColor", null, 0, 1, ColorAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
4793
		initEAttribute(getColorAttributes_BackgroundColor(), ecorePackage.getEString(), "backgroundColor", null, 0, 1, ColorAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
4744
4794
4795
		initEClass(styleAttributesEClass, StyleAttributes.class, "StyleAttributes", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
4796
		initEAttribute(getStyleAttributes_FixedFont(), ecorePackage.getEBoolean(), "fixedFont", "false", 0, 1, StyleAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
4797
		initEAttribute(getStyleAttributes_FixedForeground(), ecorePackage.getEBoolean(), "fixedForeground", "false", 0, 1, StyleAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
4798
		initEAttribute(getStyleAttributes_FixedBackground(), ecorePackage.getEBoolean(), "fixedBackground", "false", 0, 1, StyleAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
4799
4745
		initEClass(resizeConstraintsEClass, ResizeConstraints.class, "ResizeConstraints", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
4800
		initEClass(resizeConstraintsEClass, ResizeConstraints.class, "ResizeConstraints", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
4746
		initEAttribute(getResizeConstraints_ResizeHandles(), ecorePackage.getEInt(), "resizeHandles", "0", 0, 1, ResizeConstraints.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
4801
		initEAttribute(getResizeConstraints_ResizeHandles(), ecorePackage.getEInt(), "resizeHandles", "0", 0, 1, ResizeConstraints.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
4747
		initEAttribute(getResizeConstraints_NonResizeHandles(), ecorePackage.getEInt(), "nonResizeHandles", "0", 0, 1, ResizeConstraints.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
4802
		initEAttribute(getResizeConstraints_NonResizeHandles(), ecorePackage.getEInt(), "nonResizeHandles", "0", 0, 1, ResizeConstraints.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
Lines 5024-5030 Link Here
5024
			 "constraints", "http://www.eclipse.org/gmf/2005/constraints",
5079
			 "constraints", "http://www.eclipse.org/gmf/2005/constraints",
5025
			 "meta", "http://www.eclipse.org/gmf/2005/constraints/meta",
5080
			 "meta", "http://www.eclipse.org/gmf/2005/constraints/meta",
5026
			 "deprecated", "http://www.eclipse.org/gmf/2006/deprecated"
5081
			 "deprecated", "http://www.eclipse.org/gmf/2006/deprecated"
5027
		   });																																																																																																																																																																																							
5082
		   });																																																																																																																																																																																								
5028
	}
5083
	}
5029
5084
5030
	/**
5085
	/**
Lines 5138-5144 Link Here
5138
		   new String[] {
5193
		   new String[] {
5139
			 "ocl", "not targetMetaFeature.oclIsUndefined() implies targetMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)",
5194
			 "ocl", "not targetMetaFeature.oclIsUndefined() implies targetMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)",
5140
			 "description", "Link \'Target Meta Feature\' must be owned by link \'Meta Class\' or its super-class"
5195
			 "description", "Link \'Target Meta Feature\' must be owned by link \'Meta Class\' or its super-class"
5141
		   });																																											
5196
		   });																																												
5142
		addAnnotation
5197
		addAnnotation
5143
		  (genFeatureValueSpecEClass, 
5198
		  (genFeatureValueSpecEClass, 
5144
		   source, 
5199
		   source, 
Lines 5218-5224 Link Here
5218
		   new String[] {
5273
		   new String[] {
5219
			 "def", "context",
5274
			 "def", "context",
5220
			 "ocl", "metaClass.ecoreClass"
5275
			 "ocl", "metaClass.ecoreClass"
5221
		   });																															
5276
		   });																																
5222
		addAnnotation
5277
		addAnnotation
5223
		  (valueExpressionEClass, 
5278
		  (valueExpressionEClass, 
5224
		   source, 
5279
		   source, 
(-)src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java (+11 lines)
Lines 135-140 Link Here
135
			case GMFGenPackage.COMPOSITE_FEATURE_LABEL_MODEL_FACET: return createCompositeFeatureLabelModelFacet();
135
			case GMFGenPackage.COMPOSITE_FEATURE_LABEL_MODEL_FACET: return createCompositeFeatureLabelModelFacet();
136
			case GMFGenPackage.DESIGN_LABEL_MODEL_FACET: return createDesignLabelModelFacet();
136
			case GMFGenPackage.DESIGN_LABEL_MODEL_FACET: return createDesignLabelModelFacet();
137
			case GMFGenPackage.COLOR_ATTRIBUTES: return createColorAttributes();
137
			case GMFGenPackage.COLOR_ATTRIBUTES: return createColorAttributes();
138
			case GMFGenPackage.STYLE_ATTRIBUTES: return createStyleAttributes();
138
			case GMFGenPackage.RESIZE_CONSTRAINTS: return createResizeConstraints();
139
			case GMFGenPackage.RESIZE_CONSTRAINTS: return createResizeConstraints();
139
			case GMFGenPackage.DEFAULT_SIZE_ATTRIBUTES: return createDefaultSizeAttributes();
140
			case GMFGenPackage.DEFAULT_SIZE_ATTRIBUTES: return createDefaultSizeAttributes();
140
			case GMFGenPackage.LABEL_OFFSET_ATTRIBUTES: return createLabelOffsetAttributes();
141
			case GMFGenPackage.LABEL_OFFSET_ATTRIBUTES: return createLabelOffsetAttributes();
Lines 457-462 Link Here
457
	 * <!-- end-user-doc -->
458
	 * <!-- end-user-doc -->
458
	 * @generated
459
	 * @generated
459
	 */
460
	 */
461
	public StyleAttributes createStyleAttributes() {
462
		StyleAttributesImpl styleAttributes = new StyleAttributesImpl();
463
		return styleAttributes;
464
	}
465
466
	/**
467
	 * <!-- begin-user-doc -->
468
	 * <!-- end-user-doc -->
469
	 * @generated
470
	 */
460
	public ResizeConstraints createResizeConstraints() {
471
	public ResizeConstraints createResizeConstraints() {
461
		ResizeConstraintsImpl resizeConstraints = new ResizeConstraintsImpl();
472
		ResizeConstraintsImpl resizeConstraints = new ResizeConstraintsImpl();
462
		return resizeConstraints;
473
		return resizeConstraints;
(-)src-templates/org/eclipse/gmf/codegen/templates/providers/ViewFactoryGenerator.java (-174 / +234 lines)
Lines 28-109 Link Here
28
  protected final String TEXT_9 = NL + "    ";
28
  protected final String TEXT_9 = NL + "    ";
29
  protected final String TEXT_10 = "    " + NL + "\t";
29
  protected final String TEXT_10 = "    " + NL + "\t";
30
  protected final String TEXT_11 = NL + "\t";
30
  protected final String TEXT_11 = NL + "\t";
31
  protected final String TEXT_12 = NL + "{" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */";
31
  protected final String TEXT_12 = NL + "{" + NL + "" + NL + "\t/*" + NL + "\t * @generated " + NL + "\t */" + NL + "\tprotected List createStyles(View view) {" + NL + "\t\t";
32
  protected final String TEXT_13 = NL + "\tprotected void decorateView(View view, IAdaptable semanticAdapter, String diagramKind){" + NL + "\t\tsuper.decorateView(view, semanticAdapter, diagramKind);";
32
  protected final String TEXT_13 = " styles = new ";
33
  protected final String TEXT_14 = NL + "\tprotected void decorateView(View containerView, View view, IAdaptable semanticAdapter," + NL + "\t\t\tString semanticHint, int index, boolean persisted) {" + NL + "\t\tif (semanticHint == null) { ";
33
  protected final String TEXT_14 = "();";
34
  protected final String TEXT_15 = NL + "\t\t\tsemanticHint = ";
34
  protected final String TEXT_15 = NL + "\t\tstyles.add(";
35
  protected final String TEXT_16 = ".getType(";
35
  protected final String TEXT_16 = ".eINSTANCE.createRoutingStyle());";
36
  protected final String TEXT_17 = ".VISUAL_ID);" + NL + "\t\t\tview.setType(semanticHint);" + NL + "\t\t}";
36
  protected final String TEXT_17 = NL + "\t\tstyles.add(";
37
  protected final String TEXT_18 = NL + "\t\tsuper.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);";
37
  protected final String TEXT_18 = ".eINSTANCE.createLineStyle());";
38
  protected final String TEXT_19 = NL + "\t\tsetupCompartmentTitle(view);" + NL + "\t\tsetupCompartmentCollapsed(view);";
38
  protected final String TEXT_19 = NL + "\t\tstyles.add(";
39
  protected final String TEXT_20 = "\t\t" + NL + "\t\tif (!";
39
  protected final String TEXT_20 = ".eINSTANCE.createPageStyle());" + NL + "\t\tstyles.add(";
40
  protected final String TEXT_21 = ".MODEL_ID.equals(";
40
  protected final String TEXT_21 = ".eINSTANCE.createGuideStyle());" + NL + "\t\tstyles.add(";
41
  protected final String TEXT_22 = ".getModelID(containerView))) {" + NL + "\t\t\t";
41
  protected final String TEXT_22 = ".eINSTANCE.createDescriptionStyle());";
42
  protected final String TEXT_23 = " shortcutAnnotation = ";
42
  protected final String TEXT_23 = NL + "\t\tstyles.add(";
43
  protected final String TEXT_24 = ".eINSTANCE.createEAnnotation();" + NL + "\t\t\tshortcutAnnotation.setSource(\"Shortcut\"); //$NON-NLS-1$" + NL + "\t\t\tshortcutAnnotation.getDetails().put(\"modelID\", ";
43
  protected final String TEXT_24 = ".eINSTANCE.createDrawerStyle());";
44
  protected final String TEXT_25 = ".MODEL_ID); //$NON-NLS-1$" + NL + "\t\t\tview.getEAnnotations().add(shortcutAnnotation);" + NL + "\t\t}";
44
  protected final String TEXT_25 = "\t" + NL + "\t\tstyles.add(";
45
  protected final String TEXT_26 = NL + "\t\t";
45
  protected final String TEXT_26 = ".eINSTANCE.createTitleStyle());";
46
  protected final String TEXT_27 = ".setStructuralFeatureValue(view, ";
46
  protected final String TEXT_27 = "\t" + NL + "\t\tstyles.add(";
47
  protected final String TEXT_28 = ".eINSTANCE.getLineStyle_LineColor()," + NL + "\t\t\t";
47
  protected final String TEXT_28 = ".eINSTANCE.createSortingStyle());" + NL + "\t\tstyles.add(";
48
  protected final String TEXT_29 = ".colorToInteger(";
48
  protected final String TEXT_29 = ".eINSTANCE.createFilteringStyle());";
49
  protected final String TEXT_30 = ".";
49
  protected final String TEXT_30 = NL + "\t\tstyles.add(";
50
  protected final String TEXT_31 = "));";
50
  protected final String TEXT_31 = ".eINSTANCE.createFontStyle());" + NL + "\t\tstyles.add(";
51
  protected final String TEXT_32 = NL + "\t\t";
51
  protected final String TEXT_32 = ".eINSTANCE.createDescriptionStyle());" + NL + "\t\tstyles.add(";
52
  protected final String TEXT_33 = ".setStructuralFeatureValue(view, ";
52
  protected final String TEXT_33 = ".eINSTANCE.createFillStyle());" + NL + "\t\tstyles.add(";
53
  protected final String TEXT_34 = ".eINSTANCE.getFillStyle_FillColor()," + NL + "\t\t\t";
53
  protected final String TEXT_34 = ".eINSTANCE.createLineStyle());";
54
  protected final String TEXT_35 = ".colorToInteger(";
54
  protected final String TEXT_35 = NL + "\t\treturn styles;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */";
55
  protected final String TEXT_36 = ".";
55
  protected final String TEXT_36 = NL + "\tprotected void decorateView(View view, IAdaptable semanticAdapter, String diagramKind){" + NL + "\t\tsuper.decorateView(view, semanticAdapter, diagramKind);";
56
  protected final String TEXT_37 = "));";
56
  protected final String TEXT_37 = NL + "\tprotected void decorateView(View containerView, View view, IAdaptable semanticAdapter," + NL + "\t\t\tString semanticHint, int index, boolean persisted) {" + NL + "\t\tif (semanticHint == null) { ";
57
  protected final String TEXT_38 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, ";
57
  protected final String TEXT_38 = NL + "\t\t\tsemanticHint = ";
58
  protected final String TEXT_39 = ".getType(";
58
  protected final String TEXT_39 = ".getType(";
59
  protected final String TEXT_40 = ".VISUAL_ID)," + NL + "\t\t\t";
59
  protected final String TEXT_40 = ".VISUAL_ID);" + NL + "\t\t\tview.setType(semanticHint);" + NL + "\t\t}";
60
  protected final String TEXT_41 = ".APPEND, true, getPreferencesHint());";
60
  protected final String TEXT_41 = NL + "\t\tsuper.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);";
61
  protected final String TEXT_42 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, ";
61
  protected final String TEXT_42 = NL + "\t\tsetupCompartmentTitle(view);" + NL + "\t\tsetupCompartmentCollapsed(view);";
62
  protected final String TEXT_43 = ".getType(";
62
  protected final String TEXT_43 = "\t\t" + NL + "\t\tif (!";
63
  protected final String TEXT_44 = ".VISUAL_ID)," + NL + "\t\t\t";
63
  protected final String TEXT_44 = ".MODEL_ID.equals(";
64
  protected final String TEXT_45 = ".APPEND, true, getPreferencesHint());";
64
  protected final String TEXT_45 = ".getModelID(containerView))) {" + NL + "\t\t\t";
65
  protected final String TEXT_46 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, ";
65
  protected final String TEXT_46 = " shortcutAnnotation = ";
66
  protected final String TEXT_47 = ".getType(";
66
  protected final String TEXT_47 = ".eINSTANCE.createEAnnotation();" + NL + "\t\t\tshortcutAnnotation.setSource(\"Shortcut\"); //$NON-NLS-1$" + NL + "\t\t\tshortcutAnnotation.getDetails().put(\"modelID\", ";
67
  protected final String TEXT_48 = ".VISUAL_ID)," + NL + "\t\t\t";
67
  protected final String TEXT_48 = ".MODEL_ID); //$NON-NLS-1$" + NL + "\t\t\tview.getEAnnotations().add(shortcutAnnotation);" + NL + "\t\t}";
68
  protected final String TEXT_49 = ".APPEND, true, getPreferencesHint());";
68
  protected final String TEXT_49 = NL + "\t\t";
69
  protected final String TEXT_50 = NL + "\t}";
69
  protected final String TEXT_50 = ".setStructuralFeatureValue(view, ";
70
  protected final String TEXT_51 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
70
  protected final String TEXT_51 = ".eINSTANCE.getLineStyle_LineColor()," + NL + "\t\t\t";
71
  protected final String TEXT_52 = " createStyles(View view) {" + NL + "\t\t";
71
  protected final String TEXT_52 = ".colorToInteger(";
72
  protected final String TEXT_53 = " styles = super.createStyles(view);" + NL + "\t\tstyles.add(";
72
  protected final String TEXT_53 = ".";
73
  protected final String TEXT_54 = ".eINSTANCE.createShapeStyle());" + NL + "\t\treturn styles;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
73
  protected final String TEXT_54 = "));";
74
  protected final String TEXT_55 = " createLayoutConstraint() {" + NL + "\t\treturn ";
74
  protected final String TEXT_55 = NL + "\t\t";
75
  protected final String TEXT_56 = ".eINSTANCE.createBounds();" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void initializeFromPreferences(View view) {" + NL + "\t\tsuper.initializeFromPreferences(view);" + NL + "" + NL + "\t\t";
75
  protected final String TEXT_56 = ".setStructuralFeatureValue(view, ";
76
  protected final String TEXT_57 = " store = (";
76
  protected final String TEXT_57 = ".eINSTANCE.getFillStyle_FillColor()," + NL + "\t\t\t";
77
  protected final String TEXT_58 = ") getPreferencesHint().getPreferenceStore();" + NL + "" + NL + "\t\t// fill color" + NL + "\t\t";
77
  protected final String TEXT_58 = ".colorToInteger(";
78
  protected final String TEXT_59 = " fillRGB = ";
78
  protected final String TEXT_59 = ".";
79
  protected final String TEXT_60 = ".getColor(store, ";
79
  protected final String TEXT_60 = "));";
80
  protected final String TEXT_61 = ".PREF_FILL_COLOR);" + NL + "\t\t";
80
  protected final String TEXT_61 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, ";
81
  protected final String TEXT_62 = ".setStructuralFeatureValue(view, ";
81
  protected final String TEXT_62 = ".getType(";
82
  protected final String TEXT_63 = ".eINSTANCE.getFillStyle_FillColor(), ";
82
  protected final String TEXT_63 = ".VISUAL_ID)," + NL + "\t\t\t";
83
  protected final String TEXT_64 = ".RGBToInteger(fillRGB));" + NL + "\t}";
83
  protected final String TEXT_64 = ".APPEND, true, getPreferencesHint());";
84
  protected final String TEXT_65 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
84
  protected final String TEXT_65 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, ";
85
  protected final String TEXT_66 = " getMeasurementUnit() {" + NL + "\t\treturn ";
85
  protected final String TEXT_66 = ".getType(";
86
  protected final String TEXT_67 = ".";
86
  protected final String TEXT_67 = ".VISUAL_ID)," + NL + "\t\t\t";
87
  protected final String TEXT_68 = "_LITERAL;" + NL + "\t}";
87
  protected final String TEXT_68 = ".APPEND, true, getPreferencesHint());";
88
  protected final String TEXT_69 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setupCompartmentTitle(View view) {" + NL + "\t\t";
88
  protected final String TEXT_69 = NL + "\t\tgetViewService().createNode(semanticAdapter, view, ";
89
  protected final String TEXT_70 = " titleStyle = (";
89
  protected final String TEXT_70 = ".getType(";
90
  protected final String TEXT_71 = ")view.getStyle(";
90
  protected final String TEXT_71 = ".VISUAL_ID)," + NL + "\t\t\t";
91
  protected final String TEXT_72 = ".eINSTANCE.getTitleStyle());";
91
  protected final String TEXT_72 = ".APPEND, true, getPreferencesHint());";
92
  protected final String TEXT_73 = "\t\t" + NL + "\t\tif (titleStyle == null){" + NL + "\t\t\ttitleStyle = (";
92
  protected final String TEXT_73 = NL + "\t}";
93
  protected final String TEXT_74 = ") view.createStyle(";
93
  protected final String TEXT_74 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
94
  protected final String TEXT_75 = ".eINSTANCE.getTitleStyle());" + NL + "\t\t}" + NL + "\t\ttitleStyle.setShowTitle(true);";
94
  protected final String TEXT_75 = " createLayoutConstraint() {" + NL + "\t\treturn ";
95
  protected final String TEXT_76 = NL + "\t\tif (titleStyle != null){" + NL + "\t\t\tview.getStyles().remove(titleStyle);" + NL + "\t\t}";
95
  protected final String TEXT_76 = ".eINSTANCE.createBounds();" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void initializeFromPreferences(View view) {" + NL + "\t\tsuper.initializeFromPreferences(view);" + NL + "" + NL + "\t\t";
96
  protected final String TEXT_77 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setupCompartmentCollapsed(View view) {" + NL + "\t\t";
96
  protected final String TEXT_77 = " store = (";
97
  protected final String TEXT_78 = " drawerStyle = (";
97
  protected final String TEXT_78 = ") getPreferencesHint().getPreferenceStore();" + NL + "" + NL + "\t\t// fill color" + NL + "\t\t";
98
  protected final String TEXT_79 = ")view.getStyle(";
98
  protected final String TEXT_79 = " fillRGB = ";
99
  protected final String TEXT_80 = ".eINSTANCE.getDrawerStyle());";
99
  protected final String TEXT_80 = ".getColor(store, ";
100
  protected final String TEXT_81 = "\t\t" + NL + "\t\tif (drawerStyle == null){" + NL + "\t\t\tdrawerStyle = (";
100
  protected final String TEXT_81 = ".PREF_FILL_COLOR);" + NL + "\t\t";
101
  protected final String TEXT_82 = ") view.createStyle(";
101
  protected final String TEXT_82 = ".setStructuralFeatureValue(view, ";
102
  protected final String TEXT_83 = ".eINSTANCE.getDrawerStyle());" + NL + "\t\t}" + NL + "\t\tdrawerStyle.setCollapsed(false);";
102
  protected final String TEXT_83 = ".eINSTANCE.getFillStyle_FillColor(), ";
103
  protected final String TEXT_84 = NL + "\t\tif (drawerStyle != null){" + NL + "\t\t\tview.getStyles().remove(drawerStyle);" + NL + "\t\t}";
103
  protected final String TEXT_84 = ".RGBToInteger(fillRGB));" + NL + "\t}";
104
  protected final String TEXT_85 = NL + "\t}" + NL;
104
  protected final String TEXT_85 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
105
  protected final String TEXT_86 = NL + "}";
105
  protected final String TEXT_86 = " getMeasurementUnit() {" + NL + "\t\treturn ";
106
  protected final String TEXT_87 = NL;
106
  protected final String TEXT_87 = ".";
107
  protected final String TEXT_88 = "_LITERAL;" + NL + "\t}";
108
  protected final String TEXT_89 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setupCompartmentTitle(View view) {" + NL + "\t\t";
109
  protected final String TEXT_90 = " titleStyle = (";
110
  protected final String TEXT_91 = ")view.getStyle(";
111
  protected final String TEXT_92 = ".eINSTANCE.getTitleStyle());" + NL + "\t\tif (titleStyle != null){" + NL + "\t\t\ttitleStyle.setShowTitle(true);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setupCompartmentCollapsed(View view) {" + NL + "\t\t";
112
  protected final String TEXT_93 = " drawerStyle = (";
113
  protected final String TEXT_94 = ")view.getStyle(";
114
  protected final String TEXT_95 = ".eINSTANCE.getDrawerStyle());" + NL + "\t\tif (drawerStyle != null){" + NL + "\t\t\tdrawerStyle.setCollapsed(false);" + NL + "\t\t}" + NL + "\t}";
115
  protected final String TEXT_96 = NL + NL + "}";
116
  protected final String TEXT_97 = NL;
107
117
108
  public String generate(Object argument)
118
  public String generate(Object argument)
109
  {
119
  {
Lines 130-140 Link Here
130
140
131
importManager.markImportLocation(stringBuffer);
141
importManager.markImportLocation(stringBuffer);
132
142
143
final boolean isLink = genElement instanceof GenLink;
144
final boolean isLabel = genElement instanceof GenChildLabelNode;
145
final boolean isDiagram = genElement instanceof GenDiagram;
146
final boolean isCompartment = genElement instanceof GenCompartment;
147
final boolean isShape = !isLink && !isLabel && !isDiagram && !isCompartment; // captures else
148
assert isLink || isLabel || isDiagram || isCompartment || isShape;
133
149
134
boolean isLink = genElement instanceof GenLink;
150
final boolean isNode = !isLink && !isDiagram && !isCompartment;
135
boolean isDiagram = genElement instanceof GenDiagram;
136
boolean isCompartment = genElement instanceof GenCompartment;
137
boolean isNode = !isLink && !isDiagram && !isCompartment;
138
boolean isCompartmentWithOwnBounds = false;
151
boolean isCompartmentWithOwnBounds = false;
139
if (isCompartment){
152
if (isCompartment){
140
	GenCompartment genCompartment = (GenCompartment)genElement;
153
	GenCompartment genCompartment = (GenCompartment)genElement;
Lines 147-153 Link Here
147
    if (isLink) {
160
    if (isLink) {
148
    stringBuffer.append(TEXT_7);
161
    stringBuffer.append(TEXT_7);
149
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory"));
162
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory"));
150
    } else if (genElement instanceof GenChildLabelNode) {
163
    } else if (isLabel) {
151
    stringBuffer.append(TEXT_8);
164
    stringBuffer.append(TEXT_8);
152
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory"));
165
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory"));
153
    } else if (isCompartment) {
166
    } else if (isCompartment) {
Lines 156-254 Link Here
156
    } else if (isDiagram) {
169
    } else if (isDiagram) {
157
    stringBuffer.append(TEXT_10);
170
    stringBuffer.append(TEXT_10);
158
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.DiagramViewFactory"));
171
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.DiagramViewFactory"));
159
    } else {
172
    } else if (isShape) {
160
    stringBuffer.append(TEXT_11);
173
    stringBuffer.append(TEXT_11);
161
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory"));
174
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory"));
162
    }
175
    } else {
176
	throw new IllegalStateException("Unknown case for " + genElement);
177
}
163
    stringBuffer.append(TEXT_12);
178
    stringBuffer.append(TEXT_12);
179
    stringBuffer.append(importManager.getImportedName("java.util.List"));
180
    stringBuffer.append(TEXT_13);
181
    stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
182
    stringBuffer.append(TEXT_14);
164
    
183
    
184
if (isLink) {
185
186
    stringBuffer.append(TEXT_15);
187
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
188
    stringBuffer.append(TEXT_16);
189
    
190
	Viewmap viewmap = genElement.getViewmap();
191
	StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class);
192
	boolean fixedForeground = styleAttributes != null && styleAttributes.isFixedForeground();
193
	if (!fixedForeground) { 
194
195
    stringBuffer.append(TEXT_17);
196
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
197
    stringBuffer.append(TEXT_18);
198
    	
199
	} //fixedForeground
200
} 
201
if (isLabel) {
202
	//no styles for label
203
} 
165
if (isDiagram) {
204
if (isDiagram) {
166
205
167
    stringBuffer.append(TEXT_13);
206
    stringBuffer.append(TEXT_19);
207
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
208
    stringBuffer.append(TEXT_20);
209
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
210
    stringBuffer.append(TEXT_21);
211
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
212
    stringBuffer.append(TEXT_22);
213
    
214
}
215
if (isCompartment) {
216
	GenCompartment genCompartment = (GenCompartment)genElement;
217
	if (genCompartment.isCanCollapse()){
218
219
    stringBuffer.append(TEXT_23);
220
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
221
    stringBuffer.append(TEXT_24);
222
    
223
	}
224
	if (genCompartment.isNeedsTitle()){
225
226
    stringBuffer.append(TEXT_25);
227
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
228
    stringBuffer.append(TEXT_26);
229
    
230
	}
231
232
    stringBuffer.append(TEXT_27);
233
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
234
    stringBuffer.append(TEXT_28);
235
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
236
    stringBuffer.append(TEXT_29);
237
    	
238
} 
239
if (isShape || isCompartmentWithOwnBounds) {
240
241
    stringBuffer.append(TEXT_30);
242
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
243
    stringBuffer.append(TEXT_31);
244
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
245
    stringBuffer.append(TEXT_32);
246
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
247
    stringBuffer.append(TEXT_33);
248
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
249
    stringBuffer.append(TEXT_34);
250
    
251
}
252
253
    stringBuffer.append(TEXT_35);
254
    
255
if (isDiagram) {
256
257
    stringBuffer.append(TEXT_36);
168
    
258
    
169
} else {
259
} else {
170
260
171
    stringBuffer.append(TEXT_14);
261
    stringBuffer.append(TEXT_37);
172
    /* [++] important for the create shortcut functionality*/
262
    /* [++] important for the create shortcut functionality*/
173
    stringBuffer.append(TEXT_15);
263
    stringBuffer.append(TEXT_38);
174
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
264
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
175
    stringBuffer.append(TEXT_16);
265
    stringBuffer.append(TEXT_39);
176
    stringBuffer.append(genElement.getEditPartQualifiedClassName());
266
    stringBuffer.append(genElement.getEditPartQualifiedClassName());
177
    stringBuffer.append(TEXT_17);
267
    stringBuffer.append(TEXT_40);
178
    /* [--] important for the create shortcut functionality*/
268
    /* [--] important for the create shortcut functionality*/
179
    stringBuffer.append(TEXT_18);
269
    stringBuffer.append(TEXT_41);
180
    	if (isCompartment){
270
    	if (isCompartment){
181
    stringBuffer.append(TEXT_19);
271
    stringBuffer.append(TEXT_42);
182
    	}
272
    	}
183
    stringBuffer.append(TEXT_20);
273
    stringBuffer.append(TEXT_43);
184
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
274
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
185
    stringBuffer.append(TEXT_21);
275
    stringBuffer.append(TEXT_44);
186
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
276
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
187
    stringBuffer.append(TEXT_22);
277
    stringBuffer.append(TEXT_45);
188
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation"));
278
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation"));
189
    stringBuffer.append(TEXT_23);
279
    stringBuffer.append(TEXT_46);
190
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EcoreFactory"));
280
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EcoreFactory"));
191
    stringBuffer.append(TEXT_24);
281
    stringBuffer.append(TEXT_47);
192
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
282
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
193
    stringBuffer.append(TEXT_25);
283
    stringBuffer.append(TEXT_48);
194
    
284
    
195
}
285
}
196
286
197
ColorAttributes colorAttrs = genElement.getViewmap() != null ? (ColorAttributes) genElement.getViewmap().find(ColorAttributes.class) : null;
287
ColorAttributes colorAttrs = genElement.getViewmap() != null ? (ColorAttributes) genElement.getViewmap().find(ColorAttributes.class) : null;
198
if (colorAttrs != null && colorAttrs.getForegroundColor() != null && colorAttrs.getForegroundColor().trim().length() > 0) {
288
if (colorAttrs != null && colorAttrs.getForegroundColor() != null && colorAttrs.getForegroundColor().trim().length() > 0) {
199
    stringBuffer.append(TEXT_26);
289
    stringBuffer.append(TEXT_49);
200
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
290
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
201
    stringBuffer.append(TEXT_27);
291
    stringBuffer.append(TEXT_50);
202
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
292
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
203
    stringBuffer.append(TEXT_28);
293
    stringBuffer.append(TEXT_51);
204
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities"));
294
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities"));
205
    stringBuffer.append(TEXT_29);
295
    stringBuffer.append(TEXT_52);
206
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ColorConstants"));
296
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ColorConstants"));
207
    stringBuffer.append(TEXT_30);
297
    stringBuffer.append(TEXT_53);
208
    stringBuffer.append(colorAttrs.getForegroundColor());
298
    stringBuffer.append(colorAttrs.getForegroundColor());
209
    stringBuffer.append(TEXT_31);
299
    stringBuffer.append(TEXT_54);
210
    
300
    
211
}
301
}
212
if (isNode) {
302
if (isNode) {
213
	GenNode genNode = (GenNode) genElement;
303
	GenNode genNode = (GenNode) genElement;
214
	if (colorAttrs != null && colorAttrs.getBackgroundColor() != null && colorAttrs.getBackgroundColor().trim().length() > 0) {
304
	if (colorAttrs != null && colorAttrs.getBackgroundColor() != null && colorAttrs.getBackgroundColor().trim().length() > 0) {
215
    stringBuffer.append(TEXT_32);
305
    stringBuffer.append(TEXT_55);
216
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
306
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
217
    stringBuffer.append(TEXT_33);
307
    stringBuffer.append(TEXT_56);
218
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
308
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
219
    stringBuffer.append(TEXT_34);
309
    stringBuffer.append(TEXT_57);
220
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities"));
310
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities"));
221
    stringBuffer.append(TEXT_35);
311
    stringBuffer.append(TEXT_58);
222
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ColorConstants"));
312
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ColorConstants"));
223
    stringBuffer.append(TEXT_36);
313
    stringBuffer.append(TEXT_59);
224
    stringBuffer.append(colorAttrs.getBackgroundColor());
314
    stringBuffer.append(colorAttrs.getBackgroundColor());
225
    stringBuffer.append(TEXT_37);
315
    stringBuffer.append(TEXT_60);
226
    
316
    
227
	}	
317
	}	
228
	List labels = genNode.getLabels();
318
	List labels = genNode.getLabels();
229
	for (int j = 0; j < labels.size(); j++) {
319
	for (int j = 0; j < labels.size(); j++) {
230
		GenNodeLabel label = (GenNodeLabel) labels.get(j);
320
		GenNodeLabel label = (GenNodeLabel) labels.get(j);
231
321
232
    stringBuffer.append(TEXT_38);
322
    stringBuffer.append(TEXT_61);
233
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
323
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
234
    stringBuffer.append(TEXT_39);
324
    stringBuffer.append(TEXT_62);
235
    stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName()));
325
    stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName()));
236
    stringBuffer.append(TEXT_40);
326
    stringBuffer.append(TEXT_63);
237
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
327
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
238
    stringBuffer.append(TEXT_41);
328
    stringBuffer.append(TEXT_64);
239
    
329
    
240
	}
330
	}
241
	List genChildContainers = genNode.getCompartments();
331
	List genChildContainers = genNode.getCompartments();
242
	for (int j = 0; j < genChildContainers.size(); j++) {
332
	for (int j = 0; j < genChildContainers.size(); j++) {
243
		GenCompartment genChildContainer = (GenCompartment) genChildContainers.get(j);
333
		GenCompartment genChildContainer = (GenCompartment) genChildContainers.get(j);
244
334
245
    stringBuffer.append(TEXT_42);
335
    stringBuffer.append(TEXT_65);
246
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
336
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
247
    stringBuffer.append(TEXT_43);
337
    stringBuffer.append(TEXT_66);
248
    stringBuffer.append(importManager.getImportedName(genChildContainer.getEditPartQualifiedClassName()));
338
    stringBuffer.append(importManager.getImportedName(genChildContainer.getEditPartQualifiedClassName()));
249
    stringBuffer.append(TEXT_44);
339
    stringBuffer.append(TEXT_67);
250
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
340
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
251
    stringBuffer.append(TEXT_45);
341
    stringBuffer.append(TEXT_68);
252
    
342
    
253
	}
343
	}
254
} else if (isLink) {
344
} else if (isLink) {
Lines 257-311 Link Here
257
	for (int j = 0; j < labels.size(); j++) {
347
	for (int j = 0; j < labels.size(); j++) {
258
		GenLinkLabel label = (GenLinkLabel) labels.get(j);
348
		GenLinkLabel label = (GenLinkLabel) labels.get(j);
259
349
260
    stringBuffer.append(TEXT_46);
350
    stringBuffer.append(TEXT_69);
261
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
351
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
262
    stringBuffer.append(TEXT_47);
352
    stringBuffer.append(TEXT_70);
263
    stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName()));
353
    stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName()));
264
    stringBuffer.append(TEXT_48);
354
    stringBuffer.append(TEXT_71);
265
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
355
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
266
    stringBuffer.append(TEXT_49);
356
    stringBuffer.append(TEXT_72);
267
    
357
    
268
	}
358
	}
269
}
359
}
270
360
271
    stringBuffer.append(TEXT_50);
361
    stringBuffer.append(TEXT_73);
272
    if (isCompartmentWithOwnBounds) {
362
    if (isCompartmentWithOwnBounds) {
273
    stringBuffer.append(TEXT_51);
363
    stringBuffer.append(TEXT_74);
274
    stringBuffer.append(importManager.getImportedName("java.util.List"));
275
    stringBuffer.append(TEXT_52);
276
    stringBuffer.append(importManager.getImportedName("java.util.List"));
277
    stringBuffer.append(TEXT_53);
278
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
279
    stringBuffer.append(TEXT_54);
280
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LayoutConstraint"));
364
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LayoutConstraint"));
281
    stringBuffer.append(TEXT_55);
365
    stringBuffer.append(TEXT_75);
282
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
366
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
283
    stringBuffer.append(TEXT_56);
367
    stringBuffer.append(TEXT_76);
284
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore"));
368
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore"));
285
    stringBuffer.append(TEXT_57);
369
    stringBuffer.append(TEXT_77);
286
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore"));
370
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.IPreferenceStore"));
287
    stringBuffer.append(TEXT_58);
371
    stringBuffer.append(TEXT_78);
288
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.RGB"));
372
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.RGB"));
289
    stringBuffer.append(TEXT_59);
373
    stringBuffer.append(TEXT_79);
290
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.PreferenceConverter"));
374
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.preference.PreferenceConverter"));
291
    stringBuffer.append(TEXT_60);
375
    stringBuffer.append(TEXT_80);
292
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants"));
376
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants"));
293
    stringBuffer.append(TEXT_61);
377
    stringBuffer.append(TEXT_81);
294
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
378
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
295
    stringBuffer.append(TEXT_62);
379
    stringBuffer.append(TEXT_82);
296
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
380
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
297
    stringBuffer.append(TEXT_63);
381
    stringBuffer.append(TEXT_83);
298
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities"));
382
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities"));
299
    stringBuffer.append(TEXT_64);
383
    stringBuffer.append(TEXT_84);
300
    }
384
    }
301
    if (isDiagram && genDiagram.getUnits() != null && genDiagram.getUnits().trim().length() > 0) {
385
    if (isDiagram && genDiagram.getUnits() != null && genDiagram.getUnits().trim().length() > 0) {
302
    stringBuffer.append(TEXT_65);
386
    stringBuffer.append(TEXT_85);
303
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.MeasurementUnit"));
387
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.MeasurementUnit"));
304
    stringBuffer.append(TEXT_66);
388
    stringBuffer.append(TEXT_86);
305
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.MeasurementUnit"));
389
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.MeasurementUnit"));
306
    stringBuffer.append(TEXT_67);
390
    stringBuffer.append(TEXT_87);
307
    stringBuffer.append(genDiagram.getUnits().toUpperCase());
391
    stringBuffer.append(genDiagram.getUnits().toUpperCase());
308
    stringBuffer.append(TEXT_68);
392
    stringBuffer.append(TEXT_88);
309
    }
393
    }
310
    
394
    
311
if (isCompartment) {
395
if (isCompartment) {
Lines 314-360 Link Here
314
	String notationPackageFQN = importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage");
398
	String notationPackageFQN = importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage");
315
	GenCompartment genCompartment = (GenCompartment)genElement;
399
	GenCompartment genCompartment = (GenCompartment)genElement;
316
400
317
    stringBuffer.append(TEXT_69);
401
    stringBuffer.append(TEXT_89);
318
    stringBuffer.append(titleStyleFQN);
402
    stringBuffer.append(titleStyleFQN);
319
    stringBuffer.append(TEXT_70);
403
    stringBuffer.append(TEXT_90);
320
    stringBuffer.append(titleStyleFQN);
404
    stringBuffer.append(titleStyleFQN);
321
    stringBuffer.append(TEXT_71);
405
    stringBuffer.append(TEXT_91);
322
    stringBuffer.append(notationPackageFQN);
406
    stringBuffer.append(notationPackageFQN);
323
    stringBuffer.append(TEXT_72);
407
    stringBuffer.append(TEXT_92);
324
    
325
if(genCompartment.isNeedsTitle()){
326
327
    stringBuffer.append(TEXT_73);
328
    stringBuffer.append(titleStyleFQN);
329
    stringBuffer.append(TEXT_74);
330
    stringBuffer.append(notationPackageFQN);
331
    stringBuffer.append(TEXT_75);
332
    } else {
333
    stringBuffer.append(TEXT_76);
334
    }
335
    stringBuffer.append(TEXT_77);
336
    stringBuffer.append(drawerStyleFQN);
408
    stringBuffer.append(drawerStyleFQN);
337
    stringBuffer.append(TEXT_78);
409
    stringBuffer.append(TEXT_93);
338
    stringBuffer.append(drawerStyleFQN);
410
    stringBuffer.append(drawerStyleFQN);
339
    stringBuffer.append(TEXT_79);
411
    stringBuffer.append(TEXT_94);
340
    stringBuffer.append(notationPackageFQN);
412
    stringBuffer.append(notationPackageFQN);
341
    stringBuffer.append(TEXT_80);
413
    stringBuffer.append(TEXT_95);
342
    
343
if(genCompartment.isCanCollapse()){
344
345
    stringBuffer.append(TEXT_81);
346
    stringBuffer.append(drawerStyleFQN);
347
    stringBuffer.append(TEXT_82);
348
    stringBuffer.append(notationPackageFQN);
349
    stringBuffer.append(TEXT_83);
350
    } else {
351
    stringBuffer.append(TEXT_84);
352
    }
353
    stringBuffer.append(TEXT_85);
354
    }
414
    }
355
    stringBuffer.append(TEXT_86);
415
    stringBuffer.append(TEXT_96);
356
    importManager.emitSortedImports();
416
    importManager.emitSortedImports();
357
    stringBuffer.append(TEXT_87);
417
    stringBuffer.append(TEXT_97);
358
    return stringBuffer.toString();
418
    return stringBuffer.toString();
359
  }
419
  }
360
}
420
}
(-)src/org/eclipse/gmf/codegen/gmfgen/ColorAttributes.java (+4 lines)
Lines 12-17 Link Here
12
 * A representation of the model object '<em><b>Color Attributes</b></em>'.
12
 * A representation of the model object '<em><b>Color Attributes</b></em>'.
13
 * <!-- end-user-doc -->
13
 * <!-- end-user-doc -->
14
 *
14
 *
15
 * <!-- begin-model-doc -->
16
 * Deprecated, use StyleAttributes instead
17
 * <!-- end-model-doc -->
18
 *
15
 * <p>
19
 * <p>
16
 * The following features are supported:
20
 * The following features are supported:
17
 * <ul>
21
 * <ul>
(-)src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java (-43 / +132 lines)
Lines 4250-4256 Link Here
4250
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getViewmap()
4250
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getViewmap()
4251
	 * @generated
4251
	 * @generated
4252
	 */
4252
	 */
4253
	int VIEWMAP = 45;
4253
	int VIEWMAP = 46;
4254
4254
4255
	/**
4255
	/**
4256
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.Attributes <em>Attributes</em>}' class.
4256
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.Attributes <em>Attributes</em>}' class.
Lines 4309-4314 Link Here
4309
	int COLOR_ATTRIBUTES_FEATURE_COUNT = ATTRIBUTES_FEATURE_COUNT + 2;
4309
	int COLOR_ATTRIBUTES_FEATURE_COUNT = ATTRIBUTES_FEATURE_COUNT + 2;
4310
4310
4311
	/**
4311
	/**
4312
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.StyleAttributesImpl <em>Style Attributes</em>}' class.
4313
	 * <!-- begin-user-doc -->
4314
	 * <!-- end-user-doc -->
4315
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.StyleAttributesImpl
4316
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getStyleAttributes()
4317
	 * @generated
4318
	 */
4319
	int STYLE_ATTRIBUTES = 42;
4320
4321
	/**
4322
	 * The feature id for the '<em><b>Fixed Font</b></em>' attribute.
4323
	 * <!-- begin-user-doc -->
4324
	 * <!-- end-user-doc -->
4325
	 * @generated
4326
	 * @ordered
4327
	 */
4328
	int STYLE_ATTRIBUTES__FIXED_FONT = ATTRIBUTES_FEATURE_COUNT + 0;
4329
4330
	/**
4331
	 * The feature id for the '<em><b>Fixed Foreground</b></em>' attribute.
4332
	 * <!-- begin-user-doc -->
4333
	 * <!-- end-user-doc -->
4334
	 * @generated
4335
	 * @ordered
4336
	 */
4337
	int STYLE_ATTRIBUTES__FIXED_FOREGROUND = ATTRIBUTES_FEATURE_COUNT + 1;
4338
4339
	/**
4340
	 * The feature id for the '<em><b>Fixed Background</b></em>' attribute.
4341
	 * <!-- begin-user-doc -->
4342
	 * <!-- end-user-doc -->
4343
	 * @generated
4344
	 * @ordered
4345
	 */
4346
	int STYLE_ATTRIBUTES__FIXED_BACKGROUND = ATTRIBUTES_FEATURE_COUNT + 2;
4347
4348
	/**
4349
	 * The number of structural features of the '<em>Style Attributes</em>' class.
4350
	 * <!-- begin-user-doc -->
4351
	 * <!-- end-user-doc -->
4352
	 * @generated
4353
	 * @ordered
4354
	 */
4355
	int STYLE_ATTRIBUTES_FEATURE_COUNT = ATTRIBUTES_FEATURE_COUNT + 3;
4356
4357
	/**
4312
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.ResizeConstraintsImpl <em>Resize Constraints</em>}' class.
4358
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.ResizeConstraintsImpl <em>Resize Constraints</em>}' class.
4313
	 * <!-- begin-user-doc -->
4359
	 * <!-- begin-user-doc -->
4314
	 * <!-- end-user-doc -->
4360
	 * <!-- end-user-doc -->
Lines 4316-4322 Link Here
4316
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getResizeConstraints()
4362
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getResizeConstraints()
4317
	 * @generated
4363
	 * @generated
4318
	 */
4364
	 */
4319
	int RESIZE_CONSTRAINTS = 42;
4365
	int RESIZE_CONSTRAINTS = 43;
4320
4366
4321
	/**
4367
	/**
4322
	 * The feature id for the '<em><b>Resize Handles</b></em>' attribute.
4368
	 * The feature id for the '<em><b>Resize Handles</b></em>' attribute.
Lines 4353-4359 Link Here
4353
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getDefaultSizeAttributes()
4399
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getDefaultSizeAttributes()
4354
	 * @generated
4400
	 * @generated
4355
	 */
4401
	 */
4356
	int DEFAULT_SIZE_ATTRIBUTES = 43;
4402
	int DEFAULT_SIZE_ATTRIBUTES = 44;
4357
4403
4358
	/**
4404
	/**
4359
	 * The feature id for the '<em><b>Width</b></em>' attribute.
4405
	 * The feature id for the '<em><b>Width</b></em>' attribute.
Lines 4390-4396 Link Here
4390
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getLabelOffsetAttributes()
4436
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getLabelOffsetAttributes()
4391
	 * @generated
4437
	 * @generated
4392
	 */
4438
	 */
4393
	int LABEL_OFFSET_ATTRIBUTES = 44;
4439
	int LABEL_OFFSET_ATTRIBUTES = 45;
4394
4440
4395
	/**
4441
	/**
4396
	 * The feature id for the '<em><b>X</b></em>' attribute.
4442
	 * The feature id for the '<em><b>X</b></em>' attribute.
Lines 4463-4469 Link Here
4463
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getFigureViewmap()
4509
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getFigureViewmap()
4464
	 * @generated
4510
	 * @generated
4465
	 */
4511
	 */
4466
	int FIGURE_VIEWMAP = 46;
4512
	int FIGURE_VIEWMAP = 47;
4467
4513
4468
	/**
4514
	/**
4469
	 * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
4515
	 * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
Lines 4518-4524 Link Here
4518
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getSnippetViewmap()
4564
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getSnippetViewmap()
4519
	 * @generated
4565
	 * @generated
4520
	 */
4566
	 */
4521
	int SNIPPET_VIEWMAP = 47;
4567
	int SNIPPET_VIEWMAP = 48;
4522
4568
4523
	/**
4569
	/**
4524
	 * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
4570
	 * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
Lines 4573-4579 Link Here
4573
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getInnerClassViewmap()
4619
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getInnerClassViewmap()
4574
	 * @generated
4620
	 * @generated
4575
	 */
4621
	 */
4576
	int INNER_CLASS_VIEWMAP = 48;
4622
	int INNER_CLASS_VIEWMAP = 49;
4577
4623
4578
	/**
4624
	/**
4579
	 * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
4625
	 * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
Lines 4637-4643 Link Here
4637
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getParentAssignedViewmap()
4683
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getParentAssignedViewmap()
4638
	 * @generated
4684
	 * @generated
4639
	 */
4685
	 */
4640
	int PARENT_ASSIGNED_VIEWMAP = 49;
4686
	int PARENT_ASSIGNED_VIEWMAP = 50;
4641
4687
4642
	/**
4688
	/**
4643
	 * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
4689
	 * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
Lines 4710-4716 Link Here
4710
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getPalette()
4756
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getPalette()
4711
	 * @generated
4757
	 * @generated
4712
	 */
4758
	 */
4713
	int PALETTE = 52;
4759
	int PALETTE = 53;
4714
4760
4715
	/**
4761
	/**
4716
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.EntryBaseImpl <em>Entry Base</em>}' class.
4762
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.EntryBaseImpl <em>Entry Base</em>}' class.
Lines 4720-4726 Link Here
4720
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getEntryBase()
4766
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getEntryBase()
4721
	 * @generated
4767
	 * @generated
4722
	 */
4768
	 */
4723
	int ENTRY_BASE = 53;
4769
	int ENTRY_BASE = 54;
4724
4770
4725
	/**
4771
	/**
4726
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.ToolEntryImpl <em>Tool Entry</em>}' class.
4772
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.ToolEntryImpl <em>Tool Entry</em>}' class.
Lines 4730-4736 Link Here
4730
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getToolEntry()
4776
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getToolEntry()
4731
	 * @generated
4777
	 * @generated
4732
	 */
4778
	 */
4733
	int TOOL_ENTRY = 54;
4779
	int TOOL_ENTRY = 55;
4734
4780
4735
	/**
4781
	/**
4736
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.ToolGroupImpl <em>Tool Group</em>}' class.
4782
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.ToolGroupImpl <em>Tool Group</em>}' class.
Lines 4740-4746 Link Here
4740
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getToolGroup()
4786
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getToolGroup()
4741
	 * @generated
4787
	 * @generated
4742
	 */
4788
	 */
4743
	int TOOL_GROUP = 57;
4789
	int TOOL_GROUP = 58;
4744
4790
4745
	/**
4791
	/**
4746
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.ValueExpressionImpl <em>Value Expression</em>}' class.
4792
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.ValueExpressionImpl <em>Value Expression</em>}' class.
Lines 4750-4756 Link Here
4750
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getValueExpression()
4796
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getValueExpression()
4751
	 * @generated
4797
	 * @generated
4752
	 */
4798
	 */
4753
	int VALUE_EXPRESSION = 50;
4799
	int VALUE_EXPRESSION = 51;
4754
4800
4755
	/**
4801
	/**
4756
	 * The feature id for the '<em><b>Body</b></em>' attribute.
4802
	 * The feature id for the '<em><b>Body</b></em>' attribute.
Lines 4796-4802 Link Here
4796
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenConstraint()
4842
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenConstraint()
4797
	 * @generated
4843
	 * @generated
4798
	 */
4844
	 */
4799
	int GEN_CONSTRAINT = 51;
4845
	int GEN_CONSTRAINT = 52;
4800
4846
4801
	/**
4847
	/**
4802
	 * The feature id for the '<em><b>Body</b></em>' attribute.
4848
	 * The feature id for the '<em><b>Body</b></em>' attribute.
Lines 5058-5064 Link Here
5058
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getToolGroupItem()
5104
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getToolGroupItem()
5059
	 * @generated
5105
	 * @generated
5060
	 */
5106
	 */
5061
	int TOOL_GROUP_ITEM = 55;
5107
	int TOOL_GROUP_ITEM = 56;
5062
5108
5063
	/**
5109
	/**
5064
	 * The number of structural features of the '<em>Tool Group Item</em>' class.
5110
	 * The number of structural features of the '<em>Tool Group Item</em>' class.
Lines 5077-5083 Link Here
5077
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getSeparator()
5123
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getSeparator()
5078
	 * @generated
5124
	 * @generated
5079
	 */
5125
	 */
5080
	int SEPARATOR = 56;
5126
	int SEPARATOR = 57;
5081
5127
5082
	/**
5128
	/**
5083
	 * The number of structural features of the '<em>Separator</em>' class.
5129
	 * The number of structural features of the '<em>Separator</em>' class.
Lines 5186-5192 Link Here
5186
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenElementInitializer()
5232
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenElementInitializer()
5187
	 * @generated
5233
	 * @generated
5188
	 */
5234
	 */
5189
	int GEN_ELEMENT_INITIALIZER = 58;
5235
	int GEN_ELEMENT_INITIALIZER = 59;
5190
5236
5191
	/**
5237
	/**
5192
	 * The feature id for the '<em><b>Type Model Facet</b></em>' container reference.
5238
	 * The feature id for the '<em><b>Type Model Facet</b></em>' container reference.
Lines 5214-5220 Link Here
5214
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenFeatureSeqInitializer()
5260
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenFeatureSeqInitializer()
5215
	 * @generated
5261
	 * @generated
5216
	 */
5262
	 */
5217
	int GEN_FEATURE_SEQ_INITIALIZER = 59;
5263
	int GEN_FEATURE_SEQ_INITIALIZER = 60;
5218
5264
5219
	/**
5265
	/**
5220
	 * The feature id for the '<em><b>Type Model Facet</b></em>' container reference.
5266
	 * The feature id for the '<em><b>Type Model Facet</b></em>' container reference.
Lines 5251-5257 Link Here
5251
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenFeatureValueSpec()
5297
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenFeatureValueSpec()
5252
	 * @generated
5298
	 * @generated
5253
	 */
5299
	 */
5254
	int GEN_FEATURE_VALUE_SPEC = 60;
5300
	int GEN_FEATURE_VALUE_SPEC = 61;
5255
5301
5256
	/**
5302
	/**
5257
	 * The feature id for the '<em><b>Body</b></em>' attribute.
5303
	 * The feature id for the '<em><b>Body</b></em>' attribute.
Lines 5315-5321 Link Here
5315
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenLinkConstraints()
5361
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenLinkConstraints()
5316
	 * @generated
5362
	 * @generated
5317
	 */
5363
	 */
5318
	int GEN_LINK_CONSTRAINTS = 61;
5364
	int GEN_LINK_CONSTRAINTS = 62;
5319
5365
5320
	/**
5366
	/**
5321
	 * The feature id for the '<em><b>Link</b></em>' container reference.
5367
	 * The feature id for the '<em><b>Link</b></em>' container reference.
Lines 5361-5367 Link Here
5361
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenRuleContainerBase()
5407
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenRuleContainerBase()
5362
	 * @generated
5408
	 * @generated
5363
	 */
5409
	 */
5364
	int GEN_RULE_CONTAINER_BASE = 62;
5410
	int GEN_RULE_CONTAINER_BASE = 63;
5365
5411
5366
	/**
5412
	/**
5367
	 * The feature id for the '<em><b>Editor</b></em>' reference.
5413
	 * The feature id for the '<em><b>Editor</b></em>' reference.
Lines 5389-5395 Link Here
5389
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditContainer()
5435
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditContainer()
5390
	 * @generated
5436
	 * @generated
5391
	 */
5437
	 */
5392
	int GEN_AUDIT_CONTAINER = 63;
5438
	int GEN_AUDIT_CONTAINER = 64;
5393
5439
5394
	/**
5440
	/**
5395
	 * The feature id for the '<em><b>Editor</b></em>' reference.
5441
	 * The feature id for the '<em><b>Editor</b></em>' reference.
Lines 5471-5477 Link Here
5471
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenRuleBase()
5517
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenRuleBase()
5472
	 * @generated
5518
	 * @generated
5473
	 */
5519
	 */
5474
	int GEN_RULE_BASE = 64;
5520
	int GEN_RULE_BASE = 65;
5475
5521
5476
	/**
5522
	/**
5477
	 * The feature id for the '<em><b>Name</b></em>' attribute.
5523
	 * The feature id for the '<em><b>Name</b></em>' attribute.
Lines 5508-5514 Link Here
5508
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditRule()
5554
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditRule()
5509
	 * @generated
5555
	 * @generated
5510
	 */
5556
	 */
5511
	int GEN_AUDIT_RULE = 65;
5557
	int GEN_AUDIT_RULE = 66;
5512
5558
5513
	/**
5559
	/**
5514
	 * The feature id for the '<em><b>Name</b></em>' attribute.
5560
	 * The feature id for the '<em><b>Name</b></em>' attribute.
Lines 5608-5614 Link Here
5608
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenRuleTarget()
5654
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenRuleTarget()
5609
	 * @generated
5655
	 * @generated
5610
	 */
5656
	 */
5611
	int GEN_RULE_TARGET = 66;
5657
	int GEN_RULE_TARGET = 67;
5612
5658
5613
	/**
5659
	/**
5614
	 * The number of structural features of the '<em>Gen Rule Target</em>' class.
5660
	 * The number of structural features of the '<em>Gen Rule Target</em>' class.
Lines 5627-5633 Link Here
5627
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditable()
5673
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditable()
5628
	 * @generated
5674
	 * @generated
5629
	 */
5675
	 */
5630
	int GEN_AUDITABLE = 74;
5676
	int GEN_AUDITABLE = 75;
5631
5677
5632
	/**
5678
	/**
5633
	 * The number of structural features of the '<em>Gen Auditable</em>' class.
5679
	 * The number of structural features of the '<em>Gen Auditable</em>' class.
Lines 5646-5652 Link Here
5646
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenDomainElementTarget()
5692
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenDomainElementTarget()
5647
	 * @generated
5693
	 * @generated
5648
	 */
5694
	 */
5649
	int GEN_DOMAIN_ELEMENT_TARGET = 67;
5695
	int GEN_DOMAIN_ELEMENT_TARGET = 68;
5650
5696
5651
	/**
5697
	/**
5652
	 * The feature id for the '<em><b>Element</b></em>' reference.
5698
	 * The feature id for the '<em><b>Element</b></em>' reference.
Lines 5674-5680 Link Here
5674
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenDiagramElementTarget()
5720
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenDiagramElementTarget()
5675
	 * @generated
5721
	 * @generated
5676
	 */
5722
	 */
5677
	int GEN_DIAGRAM_ELEMENT_TARGET = 68;
5723
	int GEN_DIAGRAM_ELEMENT_TARGET = 69;
5678
5724
5679
	/**
5725
	/**
5680
	 * The feature id for the '<em><b>Element</b></em>' reference list.
5726
	 * The feature id for the '<em><b>Element</b></em>' reference list.
Lines 5702-5708 Link Here
5702
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenDomainAttributeTarget()
5748
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenDomainAttributeTarget()
5703
	 * @generated
5749
	 * @generated
5704
	 */
5750
	 */
5705
	int GEN_DOMAIN_ATTRIBUTE_TARGET = 69;
5751
	int GEN_DOMAIN_ATTRIBUTE_TARGET = 70;
5706
5752
5707
	/**
5753
	/**
5708
	 * The feature id for the '<em><b>Attribute</b></em>' reference.
5754
	 * The feature id for the '<em><b>Attribute</b></em>' reference.
Lines 5739-5745 Link Here
5739
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenNotationElementTarget()
5785
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenNotationElementTarget()
5740
	 * @generated
5786
	 * @generated
5741
	 */
5787
	 */
5742
	int GEN_NOTATION_ELEMENT_TARGET = 70;
5788
	int GEN_NOTATION_ELEMENT_TARGET = 71;
5743
5789
5744
	/**
5790
	/**
5745
	 * The feature id for the '<em><b>Element</b></em>' reference.
5791
	 * The feature id for the '<em><b>Element</b></em>' reference.
Lines 5767-5773 Link Here
5767
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenMetricContainer()
5813
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenMetricContainer()
5768
	 * @generated
5814
	 * @generated
5769
	 */
5815
	 */
5770
	int GEN_METRIC_CONTAINER = 71;
5816
	int GEN_METRIC_CONTAINER = 72;
5771
5817
5772
	/**
5818
	/**
5773
	 * The feature id for the '<em><b>Editor</b></em>' reference.
5819
	 * The feature id for the '<em><b>Editor</b></em>' reference.
Lines 5804-5810 Link Here
5804
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenMetricRule()
5850
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenMetricRule()
5805
	 * @generated
5851
	 * @generated
5806
	 */
5852
	 */
5807
	int GEN_METRIC_RULE = 72;
5853
	int GEN_METRIC_RULE = 73;
5808
5854
5809
	/**
5855
	/**
5810
	 * The feature id for the '<em><b>Name</b></em>' attribute.
5856
	 * The feature id for the '<em><b>Name</b></em>' attribute.
Lines 5895-5901 Link Here
5895
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditedMetricTarget()
5941
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditedMetricTarget()
5896
	 * @generated
5942
	 * @generated
5897
	 */
5943
	 */
5898
	int GEN_AUDITED_METRIC_TARGET = 73;
5944
	int GEN_AUDITED_METRIC_TARGET = 74;
5899
5945
5900
	/**
5946
	/**
5901
	 * The feature id for the '<em><b>Metric</b></em>' reference.
5947
	 * The feature id for the '<em><b>Metric</b></em>' reference.
Lines 5932-5938 Link Here
5932
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenMeasurable()
5978
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenMeasurable()
5933
	 * @generated
5979
	 * @generated
5934
	 */
5980
	 */
5935
	int GEN_MEASURABLE = 75;
5981
	int GEN_MEASURABLE = 76;
5936
5982
5937
	/**
5983
	/**
5938
	 * The number of structural features of the '<em>Gen Measurable</em>' class.
5984
	 * The number of structural features of the '<em>Gen Measurable</em>' class.
Lines 5951-5957 Link Here
5951
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenExpressionProviderContainer()
5997
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenExpressionProviderContainer()
5952
	 * @generated
5998
	 * @generated
5953
	 */
5999
	 */
5954
	int GEN_EXPRESSION_PROVIDER_CONTAINER = 76;
6000
	int GEN_EXPRESSION_PROVIDER_CONTAINER = 77;
5955
6001
5956
	/**
6002
	/**
5957
	 * The feature id for the '<em><b>Expressions Package Name</b></em>' attribute.
6003
	 * The feature id for the '<em><b>Expressions Package Name</b></em>' attribute.
Lines 6006-6012 Link Here
6006
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenExpressionProviderBase()
6052
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenExpressionProviderBase()
6007
	 * @generated
6053
	 * @generated
6008
	 */
6054
	 */
6009
	int GEN_EXPRESSION_PROVIDER_BASE = 77;
6055
	int GEN_EXPRESSION_PROVIDER_BASE = 78;
6010
6056
6011
	/**
6057
	/**
6012
	 * The feature id for the '<em><b>Expressions</b></em>' reference list.
6058
	 * The feature id for the '<em><b>Expressions</b></em>' reference list.
Lines 6043-6049 Link Here
6043
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenJavaExpressionProvider()
6089
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenJavaExpressionProvider()
6044
	 * @generated
6090
	 * @generated
6045
	 */
6091
	 */
6046
	int GEN_JAVA_EXPRESSION_PROVIDER = 78;
6092
	int GEN_JAVA_EXPRESSION_PROVIDER = 79;
6047
6093
6048
	/**
6094
	/**
6049
	 * The feature id for the '<em><b>Expressions</b></em>' reference list.
6095
	 * The feature id for the '<em><b>Expressions</b></em>' reference list.
Lines 6080-6086 Link Here
6080
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenExpressionInterpreter()
6126
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenExpressionInterpreter()
6081
	 * @generated
6127
	 * @generated
6082
	 */
6128
	 */
6083
	int GEN_EXPRESSION_INTERPRETER = 79;
6129
	int GEN_EXPRESSION_INTERPRETER = 80;
6084
6130
6085
	/**
6131
	/**
6086
	 * The feature id for the '<em><b>Expressions</b></em>' reference list.
6132
	 * The feature id for the '<em><b>Expressions</b></em>' reference list.
Lines 6144-6150 Link Here
6144
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getProviderPriority()
6190
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getProviderPriority()
6145
	 * @generated
6191
	 * @generated
6146
	 */
6192
	 */
6147
	int PROVIDER_PRIORITY = 80;
6193
	int PROVIDER_PRIORITY = 81;
6148
6194
6149
	/**
6195
	/**
6150
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.LinkLabelAlignment <em>Link Label Alignment</em>}' enum.
6196
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.LinkLabelAlignment <em>Link Label Alignment</em>}' enum.
Lines 6154-6160 Link Here
6154
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getLinkLabelAlignment()
6200
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getLinkLabelAlignment()
6155
	 * @generated
6201
	 * @generated
6156
	 */
6202
	 */
6157
	int LINK_LABEL_ALIGNMENT = 81;
6203
	int LINK_LABEL_ALIGNMENT = 82;
6158
6204
6159
	/**
6205
	/**
6160
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.ViewmapLayoutType <em>Viewmap Layout Type</em>}' enum.
6206
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.ViewmapLayoutType <em>Viewmap Layout Type</em>}' enum.
Lines 6164-6170 Link Here
6164
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getViewmapLayoutType()
6210
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getViewmapLayoutType()
6165
	 * @generated
6211
	 * @generated
6166
	 */
6212
	 */
6167
	int VIEWMAP_LAYOUT_TYPE = 82;
6213
	int VIEWMAP_LAYOUT_TYPE = 83;
6168
6214
6169
	/**
6215
	/**
6170
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.GenSeverity <em>Gen Severity</em>}' enum.
6216
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.GenSeverity <em>Gen Severity</em>}' enum.
Lines 6174-6180 Link Here
6174
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenSeverity()
6220
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenSeverity()
6175
	 * @generated
6221
	 * @generated
6176
	 */
6222
	 */
6177
	int GEN_SEVERITY = 83;
6223
	int GEN_SEVERITY = 84;
6178
6224
6179
	/**
6225
	/**
6180
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.GenLanguage <em>Gen Language</em>}' enum.
6226
	 * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.GenLanguage <em>Gen Language</em>}' enum.
Lines 6184-6190 Link Here
6184
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenLanguage()
6230
	 * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenLanguage()
6185
	 * @generated
6231
	 * @generated
6186
	 */
6232
	 */
6187
	int GEN_LANGUAGE = 84;
6233
	int GEN_LANGUAGE = 85;
6188
6234
6189
6235
6190
	/**
6236
	/**
Lines 8455-8460 Link Here
8455
	EAttribute getColorAttributes_BackgroundColor();
8501
	EAttribute getColorAttributes_BackgroundColor();
8456
8502
8457
	/**
8503
	/**
8504
	 * Returns the meta object for class '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes <em>Style Attributes</em>}'.
8505
	 * <!-- begin-user-doc -->
8506
	 * <!-- end-user-doc -->
8507
	 * @return the meta object for class '<em>Style Attributes</em>'.
8508
	 * @see org.eclipse.gmf.codegen.gmfgen.StyleAttributes
8509
	 * @generated
8510
	 */
8511
	EClass getStyleAttributes();
8512
8513
	/**
8514
	 * Returns the meta object for the attribute '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedFont <em>Fixed Font</em>}'.
8515
	 * <!-- begin-user-doc -->
8516
	 * <!-- end-user-doc -->
8517
	 * @return the meta object for the attribute '<em>Fixed Font</em>'.
8518
	 * @see org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedFont()
8519
	 * @see #getStyleAttributes()
8520
	 * @generated
8521
	 */
8522
	EAttribute getStyleAttributes_FixedFont();
8523
8524
	/**
8525
	 * Returns the meta object for the attribute '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedForeground <em>Fixed Foreground</em>}'.
8526
	 * <!-- begin-user-doc -->
8527
	 * <!-- end-user-doc -->
8528
	 * @return the meta object for the attribute '<em>Fixed Foreground</em>'.
8529
	 * @see org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedForeground()
8530
	 * @see #getStyleAttributes()
8531
	 * @generated
8532
	 */
8533
	EAttribute getStyleAttributes_FixedForeground();
8534
8535
	/**
8536
	 * Returns the meta object for the attribute '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedBackground <em>Fixed Background</em>}'.
8537
	 * <!-- begin-user-doc -->
8538
	 * <!-- end-user-doc -->
8539
	 * @return the meta object for the attribute '<em>Fixed Background</em>'.
8540
	 * @see org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedBackground()
8541
	 * @see #getStyleAttributes()
8542
	 * @generated
8543
	 */
8544
	EAttribute getStyleAttributes_FixedBackground();
8545
8546
	/**
8458
	 * Returns the meta object for class '{@link org.eclipse.gmf.codegen.gmfgen.ResizeConstraints <em>Resize Constraints</em>}'.
8547
	 * Returns the meta object for class '{@link org.eclipse.gmf.codegen.gmfgen.ResizeConstraints <em>Resize Constraints</em>}'.
8459
	 * <!-- begin-user-doc -->
8548
	 * <!-- begin-user-doc -->
8460
	 * <!-- end-user-doc -->
8549
	 * <!-- end-user-doc -->
(-)src/org/eclipse/gmf/codegen/gmfgen/GMFGenFactory.java (+9 lines)
Lines 242-247 Link Here
242
	ColorAttributes createColorAttributes();
242
	ColorAttributes createColorAttributes();
243
243
244
	/**
244
	/**
245
	 * Returns a new object of class '<em>Style Attributes</em>'.
246
	 * <!-- begin-user-doc -->
247
	 * <!-- end-user-doc -->
248
	 * @return a new object of class '<em>Style Attributes</em>'.
249
	 * @generated
250
	 */
251
	StyleAttributes createStyleAttributes();
252
253
	/**
245
	 * Returns a new object of class '<em>Resize Constraints</em>'.
254
	 * Returns a new object of class '<em>Resize Constraints</em>'.
246
	 * <!-- begin-user-doc -->
255
	 * <!-- begin-user-doc -->
247
	 * <!-- end-user-doc -->
256
	 * <!-- end-user-doc -->
(-)templates/providers/ViewFactory.javajet (-37 / +73 lines)
Lines 14-24 Link Here
14
14
15
importManager.markImportLocation(stringBuffer);
15
importManager.markImportLocation(stringBuffer);
16
16
17
final boolean isLink = genElement instanceof GenLink;
18
final boolean isLabel = genElement instanceof GenChildLabelNode;
19
final boolean isDiagram = genElement instanceof GenDiagram;
20
final boolean isCompartment = genElement instanceof GenCompartment;
21
final boolean isShape = !isLink && !isLabel && !isDiagram && !isCompartment; // captures else
22
assert isLink || isLabel || isDiagram || isCompartment || isShape;
17
23
18
boolean isLink = genElement instanceof GenLink;
24
final boolean isNode = !isLink && !isDiagram && !isCompartment;
19
boolean isDiagram = genElement instanceof GenDiagram;
20
boolean isCompartment = genElement instanceof GenCompartment;
21
boolean isNode = !isLink && !isDiagram && !isCompartment;
22
boolean isCompartmentWithOwnBounds = false;
25
boolean isCompartmentWithOwnBounds = false;
23
if (isCompartment){
26
if (isCompartment){
24
	GenCompartment genCompartment = (GenCompartment)genElement;
27
	GenCompartment genCompartment = (GenCompartment)genElement;
Lines 32-48 Link Here
32
public class <%=genElement.getNotationViewFactoryClassName()%> extends 
35
public class <%=genElement.getNotationViewFactoryClassName()%> extends 
33
<%if (isLink) {%>
36
<%if (isLink) {%>
34
	<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory")%>
37
	<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory")%>
35
<%} else if (genElement instanceof GenChildLabelNode) {%>
38
<%} else if (isLabel) {%>
36
	<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory")%>
39
	<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory")%>
37
<%} else if (isCompartment) {%>
40
<%} else if (isCompartment) {%>
38
    <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory")%>
41
    <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory")%>
39
<%} else if (isDiagram) {%>    
42
<%} else if (isDiagram) {%>    
40
	<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.DiagramViewFactory")%>
43
	<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.DiagramViewFactory")%>
41
<%} else {%>
44
<%} else if (isShape) {%>
42
	<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory")%>
45
	<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory")%>
43
<%}%>
46
<%} else {
47
	throw new IllegalStateException("Unknown case for " + genElement);
48
}%>
44
{
49
{
45
50
51
	/*
52
	 * @generated 
53
	 */
54
	protected List createStyles(View view) {
55
		<%=importManager.getImportedName("java.util.List")%> styles = new <%=importManager.getImportedName("java.util.ArrayList")%>();
56
<%
57
if (isLink) {
58
%>
59
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createRoutingStyle());
60
<%
61
	Viewmap viewmap = genElement.getViewmap();
62
	StyleAttributes styleAttributes = (viewmap == null) ? null : (StyleAttributes)viewmap.find(StyleAttributes.class);
63
	boolean fixedForeground = styleAttributes != null && styleAttributes.isFixedForeground();
64
	if (!fixedForeground) { 
65
%>
66
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createLineStyle());
67
<%	
68
	} //fixedForeground
69
} 
70
if (isLabel) {
71
	//no styles for label
72
} 
73
if (isDiagram) {
74
%>
75
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createPageStyle());
76
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createGuideStyle());
77
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createDescriptionStyle());
78
<%
79
}
80
if (isCompartment) {
81
	GenCompartment genCompartment = (GenCompartment)genElement;
82
	if (genCompartment.isCanCollapse()){
83
%>
84
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createDrawerStyle());
85
<%
86
	}
87
	if (genCompartment.isNeedsTitle()){
88
%>	
89
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createTitleStyle());
90
<%
91
	}
92
%>	
93
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createSortingStyle());
94
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createFilteringStyle());
95
<%	
96
} 
97
if (isShape || isCompartmentWithOwnBounds) {
98
%>
99
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createFontStyle());
100
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createDescriptionStyle());
101
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createFillStyle());
102
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createLineStyle());
103
<%
104
}
105
%>
106
		return styles;
107
	}
108
46
	/**
109
	/**
47
	 * @generated
110
	 * @generated
48
	 */
111
	 */
Lines 121-135 Link Here
121
	/**
184
	/**
122
	 * @generated
185
	 * @generated
123
	 */
186
	 */
124
	protected <%=importManager.getImportedName("java.util.List")%> createStyles(View view) {
125
		<%=importManager.getImportedName("java.util.List")%> styles = super.createStyles(view);
126
		styles.add(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createShapeStyle());
127
		return styles;
128
	}
129
	
130
	/**
131
	 * @generated
132
	 */
133
	protected <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.LayoutConstraint")%> createLayoutConstraint() {
187
	protected <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.LayoutConstraint")%> createLayoutConstraint() {
134
		return <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createBounds();
188
		return <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createBounds();
135
	}
189
	}
Lines 167-184 Link Here
167
	 */
221
	 */
168
	protected void setupCompartmentTitle(View view) {
222
	protected void setupCompartmentTitle(View view) {
169
		<%=titleStyleFQN%> titleStyle = (<%=titleStyleFQN%>)view.getStyle(<%=notationPackageFQN%>.eINSTANCE.getTitleStyle());
223
		<%=titleStyleFQN%> titleStyle = (<%=titleStyleFQN%>)view.getStyle(<%=notationPackageFQN%>.eINSTANCE.getTitleStyle());
170
<%
171
if(genCompartment.isNeedsTitle()){
172
%>		
173
		if (titleStyle == null){
174
			titleStyle = (<%=titleStyleFQN%>) view.createStyle(<%=notationPackageFQN%>.eINSTANCE.getTitleStyle());
175
		}
176
		titleStyle.setShowTitle(true);
177
<%} else {%>
178
		if (titleStyle != null){
224
		if (titleStyle != null){
179
			view.getStyles().remove(titleStyle);
225
			titleStyle.setShowTitle(true);
180
		}
226
		}
181
<%}%>
182
	}
227
	}
183
228
184
	/**
229
	/**
Lines 186-205 Link Here
186
	 */
231
	 */
187
	protected void setupCompartmentCollapsed(View view) {
232
	protected void setupCompartmentCollapsed(View view) {
188
		<%=drawerStyleFQN%> drawerStyle = (<%=drawerStyleFQN%>)view.getStyle(<%=notationPackageFQN%>.eINSTANCE.getDrawerStyle());
233
		<%=drawerStyleFQN%> drawerStyle = (<%=drawerStyleFQN%>)view.getStyle(<%=notationPackageFQN%>.eINSTANCE.getDrawerStyle());
189
<%
190
if(genCompartment.isCanCollapse()){
191
%>		
192
		if (drawerStyle == null){
193
			drawerStyle = (<%=drawerStyleFQN%>) view.createStyle(<%=notationPackageFQN%>.eINSTANCE.getDrawerStyle());
194
		}
195
		drawerStyle.setCollapsed(false);
196
<%} else {%>
197
		if (drawerStyle != null){
234
		if (drawerStyle != null){
198
			view.getStyles().remove(drawerStyle);
235
			drawerStyle.setCollapsed(false);
199
		}
236
		}
200
<%}%>
201
	}
237
	}
202
203
<%}%>
238
<%}%>
239
204
}
240
}
205
<%importManager.emitSortedImports();%>
241
<%importManager.emitSortedImports();%>
(-)models/gmfgen.genmodel (+5 lines)
Lines 360-365 Link Here
360
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ColorAttributes/foregroundColor"/>
360
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ColorAttributes/foregroundColor"/>
361
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ColorAttributes/backgroundColor"/>
361
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ColorAttributes/backgroundColor"/>
362
    </genClasses>
362
    </genClasses>
363
    <genClasses ecoreClass="gmfgen.ecore#//StyleAttributes">
364
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//StyleAttributes/fixedFont"/>
365
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//StyleAttributes/fixedForeground"/>
366
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//StyleAttributes/fixedBackground"/>
367
    </genClasses>
363
    <genClasses ecoreClass="gmfgen.ecore#//ResizeConstraints">
368
    <genClasses ecoreClass="gmfgen.ecore#//ResizeConstraints">
364
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ResizeConstraints/resizeHandles"/>
369
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ResizeConstraints/resizeHandles"/>
365
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ResizeConstraints/nonResizeHandles"/>
370
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ResizeConstraints/nonResizeHandles"/>
(-)models/gmfgen.ecore (+11 lines)
Lines 773-781 Link Here
773
    </eAnnotations>
773
    </eAnnotations>
774
  </eClassifiers>
774
  </eClassifiers>
775
  <eClassifiers xsi:type="ecore:EClass" name="ColorAttributes" eSuperTypes="#//Attributes">
775
  <eClassifiers xsi:type="ecore:EClass" name="ColorAttributes" eSuperTypes="#//Attributes">
776
    <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
777
      <details key="documentation" value="Deprecated, use StyleAttributes instead"/>
778
    </eAnnotations>
776
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="foregroundColor" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
779
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="foregroundColor" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
777
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="backgroundColor" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
780
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="backgroundColor" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
778
  </eClassifiers>
781
  </eClassifiers>
782
  <eClassifiers xsi:type="ecore:EClass" name="StyleAttributes" eSuperTypes="#//Attributes">
783
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="fixedFont" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
784
        defaultValueLiteral="false"/>
785
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="fixedForeground" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
786
        defaultValueLiteral="false"/>
787
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="fixedBackground" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
788
        defaultValueLiteral="false"/>
789
  </eClassifiers>
779
  <eClassifiers xsi:type="ecore:EClass" name="ResizeConstraints" eSuperTypes="#//Attributes">
790
  <eClassifiers xsi:type="ecore:EClass" name="ResizeConstraints" eSuperTypes="#//Attributes">
780
    <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
791
    <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
781
      <details key="documentation" value="Bit-wise OR of any {@link org.eclipse.draw2d.PositionConstants#NORTH}, {@link org.eclipse.draw2d.PositionConstants#SOUTH}, {@link org.eclipse.draw2d.PositionConstants#EAST} or {@link org.eclipse.draw2d.PositionConstants#WEST}"/>
792
      <details key="documentation" value="Bit-wise OR of any {@link org.eclipse.draw2d.PositionConstants#NORTH}, {@link org.eclipse.draw2d.PositionConstants#SOUTH}, {@link org.eclipse.draw2d.PositionConstants#EAST} or {@link org.eclipse.draw2d.PositionConstants#WEST}"/>
(-)src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenSwitch.java (+22 lines)
Lines 480-485 Link Here
480
				if (result == null) result = defaultCase(theEObject);
480
				if (result == null) result = defaultCase(theEObject);
481
				return result;
481
				return result;
482
			}
482
			}
483
			case GMFGenPackage.STYLE_ATTRIBUTES: {
484
				StyleAttributes styleAttributes = (StyleAttributes)theEObject;
485
				Object result = caseStyleAttributes(styleAttributes);
486
				if (result == null) result = caseAttributes(styleAttributes);
487
				if (result == null) result = defaultCase(theEObject);
488
				return result;
489
			}
483
			case GMFGenPackage.RESIZE_CONSTRAINTS: {
490
			case GMFGenPackage.RESIZE_CONSTRAINTS: {
484
				ResizeConstraints resizeConstraints = (ResizeConstraints)theEObject;
491
				ResizeConstraints resizeConstraints = (ResizeConstraints)theEObject;
485
				Object result = caseResizeConstraints(resizeConstraints);
492
				Object result = caseResizeConstraints(resizeConstraints);
Lines 1394-1399 Link Here
1394
	}
1401
	}
1395
1402
1396
	/**
1403
	/**
1404
	 * Returns the result of interpretting the object as an instance of '<em>Style Attributes</em>'.
1405
	 * <!-- begin-user-doc -->
1406
	 * This implementation returns null;
1407
	 * returning a non-null result will terminate the switch.
1408
	 * <!-- end-user-doc -->
1409
	 * @param object the target of the switch.
1410
	 * @return the result of interpretting the object as an instance of '<em>Style Attributes</em>'.
1411
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
1412
	 * @generated
1413
	 */
1414
	public Object caseStyleAttributes(StyleAttributes object) {
1415
		return null;
1416
	}
1417
1418
	/**
1397
	 * Returns the result of interpretting the object as an instance of '<em>Resize Constraints</em>'.
1419
	 * Returns the result of interpretting the object as an instance of '<em>Resize Constraints</em>'.
1398
	 * <!-- begin-user-doc -->
1420
	 * <!-- begin-user-doc -->
1399
	 * This implementation returns null;
1421
	 * This implementation returns null;
(-)src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenAdapterFactory.java (+17 lines)
Lines 271-276 Link Here
271
			public Object caseColorAttributes(ColorAttributes object) {
271
			public Object caseColorAttributes(ColorAttributes object) {
272
				return createColorAttributesAdapter();
272
				return createColorAttributesAdapter();
273
			}
273
			}
274
			public Object caseStyleAttributes(StyleAttributes object) {
275
				return createStyleAttributesAdapter();
276
			}
274
			public Object caseResizeConstraints(ResizeConstraints object) {
277
			public Object caseResizeConstraints(ResizeConstraints object) {
275
				return createResizeConstraintsAdapter();
278
				return createResizeConstraintsAdapter();
276
			}
279
			}
Lines 1006-1011 Link Here
1006
	}
1009
	}
1007
1010
1008
	/**
1011
	/**
1012
	 * Creates a new adapter for an object of class '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes <em>Style Attributes</em>}'.
1013
	 * <!-- begin-user-doc -->
1014
	 * This default implementation returns null so that we can easily ignore cases;
1015
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
1016
	 * <!-- end-user-doc -->
1017
	 * @return the new adapter.
1018
	 * @see org.eclipse.gmf.codegen.gmfgen.StyleAttributes
1019
	 * @generated
1020
	 */
1021
	public Adapter createStyleAttributesAdapter() {
1022
		return null;
1023
	}
1024
1025
	/**
1009
	 * Creates a new adapter for an object of class '{@link org.eclipse.gmf.codegen.gmfgen.ResizeConstraints <em>Resize Constraints</em>}'.
1026
	 * Creates a new adapter for an object of class '{@link org.eclipse.gmf.codegen.gmfgen.ResizeConstraints <em>Resize Constraints</em>}'.
1010
	 * <!-- begin-user-doc -->
1027
	 * <!-- begin-user-doc -->
1011
	 * This default implementation returns null so that we can easily ignore cases;
1028
	 * This default implementation returns null so that we can easily ignore cases;
(-)src/org/eclipse/gmf/codegen/gmfgen/StyleAttributes.java (+110 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.gmf.codegen.gmfgen;
8
9
10
/**
11
 * <!-- begin-user-doc -->
12
 * A representation of the model object '<em><b>Style Attributes</b></em>'.
13
 * <!-- end-user-doc -->
14
 *
15
 * <p>
16
 * The following features are supported:
17
 * <ul>
18
 *   <li>{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedFont <em>Fixed Font</em>}</li>
19
 *   <li>{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedForeground <em>Fixed Foreground</em>}</li>
20
 *   <li>{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedBackground <em>Fixed Background</em>}</li>
21
 * </ul>
22
 * </p>
23
 *
24
 * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getStyleAttributes()
25
 * @model
26
 * @generated
27
 */
28
public interface StyleAttributes extends Attributes {
29
	/**
30
	 * Returns the value of the '<em><b>Fixed Font</b></em>' attribute.
31
	 * The default value is <code>"false"</code>.
32
	 * <!-- begin-user-doc -->
33
	 * <p>
34
	 * If the meaning of the '<em>Fixed Font</em>' attribute isn't clear,
35
	 * there really should be more of a description here...
36
	 * </p>
37
	 * <!-- end-user-doc -->
38
	 * @return the value of the '<em>Fixed Font</em>' attribute.
39
	 * @see #setFixedFont(boolean)
40
	 * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getStyleAttributes_FixedFont()
41
	 * @model default="false"
42
	 * @generated
43
	 */
44
	boolean isFixedFont();
45
46
	/**
47
	 * Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedFont <em>Fixed Font</em>}' attribute.
48
	 * <!-- begin-user-doc -->
49
	 * <!-- end-user-doc -->
50
	 * @param value the new value of the '<em>Fixed Font</em>' attribute.
51
	 * @see #isFixedFont()
52
	 * @generated
53
	 */
54
	void setFixedFont(boolean value);
55
56
	/**
57
	 * Returns the value of the '<em><b>Fixed Foreground</b></em>' attribute.
58
	 * The default value is <code>"false"</code>.
59
	 * <!-- begin-user-doc -->
60
	 * <p>
61
	 * If the meaning of the '<em>Fixed Foreground</em>' attribute isn't clear,
62
	 * there really should be more of a description here...
63
	 * </p>
64
	 * <!-- end-user-doc -->
65
	 * @return the value of the '<em>Fixed Foreground</em>' attribute.
66
	 * @see #setFixedForeground(boolean)
67
	 * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getStyleAttributes_FixedForeground()
68
	 * @model default="false"
69
	 * @generated
70
	 */
71
	boolean isFixedForeground();
72
73
	/**
74
	 * Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedForeground <em>Fixed Foreground</em>}' attribute.
75
	 * <!-- begin-user-doc -->
76
	 * <!-- end-user-doc -->
77
	 * @param value the new value of the '<em>Fixed Foreground</em>' attribute.
78
	 * @see #isFixedForeground()
79
	 * @generated
80
	 */
81
	void setFixedForeground(boolean value);
82
83
	/**
84
	 * Returns the value of the '<em><b>Fixed Background</b></em>' attribute.
85
	 * The default value is <code>"false"</code>.
86
	 * <!-- begin-user-doc -->
87
	 * <p>
88
	 * If the meaning of the '<em>Fixed Background</em>' attribute isn't clear,
89
	 * there really should be more of a description here...
90
	 * </p>
91
	 * <!-- end-user-doc -->
92
	 * @return the value of the '<em>Fixed Background</em>' attribute.
93
	 * @see #setFixedBackground(boolean)
94
	 * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getStyleAttributes_FixedBackground()
95
	 * @model default="false"
96
	 * @generated
97
	 */
98
	boolean isFixedBackground();
99
100
	/**
101
	 * Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.StyleAttributes#isFixedBackground <em>Fixed Background</em>}' attribute.
102
	 * <!-- begin-user-doc -->
103
	 * <!-- end-user-doc -->
104
	 * @param value the new value of the '<em>Fixed Background</em>' attribute.
105
	 * @see #isFixedBackground()
106
	 * @generated
107
	 */
108
	void setFixedBackground(boolean value);
109
110
} // StyleAttributes
(-)src/org/eclipse/gmf/codegen/gmfgen/impl/StyleAttributesImpl.java (+269 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.gmf.codegen.gmfgen.impl;
8
9
import org.eclipse.emf.common.notify.Notification;
10
11
import org.eclipse.emf.ecore.EClass;
12
13
import org.eclipse.emf.ecore.impl.ENotificationImpl;
14
import org.eclipse.emf.ecore.impl.EObjectImpl;
15
16
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
17
import org.eclipse.gmf.codegen.gmfgen.StyleAttributes;
18
19
/**
20
 * <!-- begin-user-doc -->
21
 * An implementation of the model object '<em><b>Style Attributes</b></em>'.
22
 * <!-- end-user-doc -->
23
 * <p>
24
 * The following features are implemented:
25
 * <ul>
26
 *   <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.StyleAttributesImpl#isFixedFont <em>Fixed Font</em>}</li>
27
 *   <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.StyleAttributesImpl#isFixedForeground <em>Fixed Foreground</em>}</li>
28
 *   <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.StyleAttributesImpl#isFixedBackground <em>Fixed Background</em>}</li>
29
 * </ul>
30
 * </p>
31
 *
32
 * @generated
33
 */
34
public class StyleAttributesImpl extends EObjectImpl implements StyleAttributes {
35
	/**
36
	 * The default value of the '{@link #isFixedFont() <em>Fixed Font</em>}' attribute.
37
	 * <!-- begin-user-doc -->
38
	 * <!-- end-user-doc -->
39
	 * @see #isFixedFont()
40
	 * @generated
41
	 * @ordered
42
	 */
43
	protected static final boolean FIXED_FONT_EDEFAULT = false;
44
45
	/**
46
	 * The cached value of the '{@link #isFixedFont() <em>Fixed Font</em>}' attribute.
47
	 * <!-- begin-user-doc -->
48
	 * <!-- end-user-doc -->
49
	 * @see #isFixedFont()
50
	 * @generated
51
	 * @ordered
52
	 */
53
	protected boolean fixedFont = FIXED_FONT_EDEFAULT;
54
55
	/**
56
	 * The default value of the '{@link #isFixedForeground() <em>Fixed Foreground</em>}' attribute.
57
	 * <!-- begin-user-doc -->
58
	 * <!-- end-user-doc -->
59
	 * @see #isFixedForeground()
60
	 * @generated
61
	 * @ordered
62
	 */
63
	protected static final boolean FIXED_FOREGROUND_EDEFAULT = false;
64
65
	/**
66
	 * The cached value of the '{@link #isFixedForeground() <em>Fixed Foreground</em>}' attribute.
67
	 * <!-- begin-user-doc -->
68
	 * <!-- end-user-doc -->
69
	 * @see #isFixedForeground()
70
	 * @generated
71
	 * @ordered
72
	 */
73
	protected boolean fixedForeground = FIXED_FOREGROUND_EDEFAULT;
74
75
	/**
76
	 * The default value of the '{@link #isFixedBackground() <em>Fixed Background</em>}' attribute.
77
	 * <!-- begin-user-doc -->
78
	 * <!-- end-user-doc -->
79
	 * @see #isFixedBackground()
80
	 * @generated
81
	 * @ordered
82
	 */
83
	protected static final boolean FIXED_BACKGROUND_EDEFAULT = false;
84
85
	/**
86
	 * The cached value of the '{@link #isFixedBackground() <em>Fixed Background</em>}' attribute.
87
	 * <!-- begin-user-doc -->
88
	 * <!-- end-user-doc -->
89
	 * @see #isFixedBackground()
90
	 * @generated
91
	 * @ordered
92
	 */
93
	protected boolean fixedBackground = FIXED_BACKGROUND_EDEFAULT;
94
95
	/**
96
	 * <!-- begin-user-doc -->
97
	 * <!-- end-user-doc -->
98
	 * @generated
99
	 */
100
	protected StyleAttributesImpl() {
101
		super();
102
	}
103
104
	/**
105
	 * <!-- begin-user-doc -->
106
	 * <!-- end-user-doc -->
107
	 * @generated
108
	 */
109
	protected EClass eStaticClass() {
110
		return GMFGenPackage.eINSTANCE.getStyleAttributes();
111
	}
112
113
	/**
114
	 * <!-- begin-user-doc -->
115
	 * <!-- end-user-doc -->
116
	 * @generated
117
	 */
118
	public boolean isFixedFont() {
119
		return fixedFont;
120
	}
121
122
	/**
123
	 * <!-- begin-user-doc -->
124
	 * <!-- end-user-doc -->
125
	 * @generated
126
	 */
127
	public void setFixedFont(boolean newFixedFont) {
128
		boolean oldFixedFont = fixedFont;
129
		fixedFont = newFixedFont;
130
		if (eNotificationRequired())
131
			eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FONT, oldFixedFont, fixedFont));
132
	}
133
134
	/**
135
	 * <!-- begin-user-doc -->
136
	 * <!-- end-user-doc -->
137
	 * @generated
138
	 */
139
	public boolean isFixedForeground() {
140
		return fixedForeground;
141
	}
142
143
	/**
144
	 * <!-- begin-user-doc -->
145
	 * <!-- end-user-doc -->
146
	 * @generated
147
	 */
148
	public void setFixedForeground(boolean newFixedForeground) {
149
		boolean oldFixedForeground = fixedForeground;
150
		fixedForeground = newFixedForeground;
151
		if (eNotificationRequired())
152
			eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FOREGROUND, oldFixedForeground, fixedForeground));
153
	}
154
155
	/**
156
	 * <!-- begin-user-doc -->
157
	 * <!-- end-user-doc -->
158
	 * @generated
159
	 */
160
	public boolean isFixedBackground() {
161
		return fixedBackground;
162
	}
163
164
	/**
165
	 * <!-- begin-user-doc -->
166
	 * <!-- end-user-doc -->
167
	 * @generated
168
	 */
169
	public void setFixedBackground(boolean newFixedBackground) {
170
		boolean oldFixedBackground = fixedBackground;
171
		fixedBackground = newFixedBackground;
172
		if (eNotificationRequired())
173
			eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.STYLE_ATTRIBUTES__FIXED_BACKGROUND, oldFixedBackground, fixedBackground));
174
	}
175
176
	/**
177
	 * <!-- begin-user-doc -->
178
	 * <!-- end-user-doc -->
179
	 * @generated
180
	 */
181
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
182
		switch (featureID) {
183
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FONT:
184
				return isFixedFont() ? Boolean.TRUE : Boolean.FALSE;
185
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FOREGROUND:
186
				return isFixedForeground() ? Boolean.TRUE : Boolean.FALSE;
187
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_BACKGROUND:
188
				return isFixedBackground() ? Boolean.TRUE : Boolean.FALSE;
189
		}
190
		return super.eGet(featureID, resolve, coreType);
191
	}
192
193
	/**
194
	 * <!-- begin-user-doc -->
195
	 * <!-- end-user-doc -->
196
	 * @generated
197
	 */
198
	public void eSet(int featureID, Object newValue) {
199
		switch (featureID) {
200
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FONT:
201
				setFixedFont(((Boolean)newValue).booleanValue());
202
				return;
203
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FOREGROUND:
204
				setFixedForeground(((Boolean)newValue).booleanValue());
205
				return;
206
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_BACKGROUND:
207
				setFixedBackground(((Boolean)newValue).booleanValue());
208
				return;
209
		}
210
		super.eSet(featureID, newValue);
211
	}
212
213
	/**
214
	 * <!-- begin-user-doc -->
215
	 * <!-- end-user-doc -->
216
	 * @generated
217
	 */
218
	public void eUnset(int featureID) {
219
		switch (featureID) {
220
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FONT:
221
				setFixedFont(FIXED_FONT_EDEFAULT);
222
				return;
223
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FOREGROUND:
224
				setFixedForeground(FIXED_FOREGROUND_EDEFAULT);
225
				return;
226
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_BACKGROUND:
227
				setFixedBackground(FIXED_BACKGROUND_EDEFAULT);
228
				return;
229
		}
230
		super.eUnset(featureID);
231
	}
232
233
	/**
234
	 * <!-- begin-user-doc -->
235
	 * <!-- end-user-doc -->
236
	 * @generated
237
	 */
238
	public boolean eIsSet(int featureID) {
239
		switch (featureID) {
240
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FONT:
241
				return fixedFont != FIXED_FONT_EDEFAULT;
242
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_FOREGROUND:
243
				return fixedForeground != FIXED_FOREGROUND_EDEFAULT;
244
			case GMFGenPackage.STYLE_ATTRIBUTES__FIXED_BACKGROUND:
245
				return fixedBackground != FIXED_BACKGROUND_EDEFAULT;
246
		}
247
		return super.eIsSet(featureID);
248
	}
249
250
	/**
251
	 * <!-- begin-user-doc -->
252
	 * <!-- end-user-doc -->
253
	 * @generated
254
	 */
255
	public String toString() {
256
		if (eIsProxy()) return super.toString();
257
258
		StringBuffer result = new StringBuffer(super.toString());
259
		result.append(" (fixedFont: ");
260
		result.append(fixedFont);
261
		result.append(", fixedForeground: ");
262
		result.append(fixedForeground);
263
		result.append(", fixedBackground: ");
264
		result.append(fixedBackground);
265
		result.append(')');
266
		return result.toString();
267
	}
268
269
} //StyleAttributesImpl

Return to bug 145863