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

Collapse All | Expand All

(-)src/org/eclipse/emf/ecoretools/diagram/edit/parts/EDataType2EditPart.java (-5 / +17 lines)
Lines 17-23 Link Here
17
import org.eclipse.draw2d.Graphics;
17
import org.eclipse.draw2d.Graphics;
18
import org.eclipse.draw2d.IFigure;
18
import org.eclipse.draw2d.IFigure;
19
import org.eclipse.draw2d.PositionConstants;
19
import org.eclipse.draw2d.PositionConstants;
20
import org.eclipse.draw2d.RectangleFigure;
21
import org.eclipse.draw2d.StackLayout;
20
import org.eclipse.draw2d.StackLayout;
22
import org.eclipse.draw2d.ToolbarLayout;
21
import org.eclipse.draw2d.ToolbarLayout;
23
import org.eclipse.draw2d.geometry.Dimension;
22
import org.eclipse.draw2d.geometry.Dimension;
Lines 26-35 Link Here
26
import org.eclipse.emf.common.notify.Notification;
25
import org.eclipse.emf.common.notify.Notification;
27
import org.eclipse.emf.ecore.EObject;
26
import org.eclipse.emf.ecore.EObject;
28
import org.eclipse.emf.ecore.EcorePackage;
27
import org.eclipse.emf.ecore.EcorePackage;
28
import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder;
29
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
29
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
30
import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure;
31
import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy;
30
import org.eclipse.emf.ecoretools.diagram.edit.policies.EDataType2ItemSemanticEditPolicy;
32
import org.eclipse.emf.ecoretools.diagram.edit.policies.EDataType2ItemSemanticEditPolicy;
31
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
33
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
32
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
34
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
35
import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants;
33
import org.eclipse.gef.EditPart;
36
import org.eclipse.gef.EditPart;
34
import org.eclipse.gef.EditPolicy;
37
import org.eclipse.gef.EditPolicy;
35
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
38
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
Lines 106-115 Link Here
106
	}
109
	}
107
110
108
	/**
111
	/**
109
	 * @generated
112
	 * @generated NOT
110
	 */
113
	 */
111
	protected IFigure createNodeShape() {
114
	protected IFigure createNodeShape() {
112
		DataTypeFigure figure = new DataTypeFigure();
115
		DataTypeFigure figure = new DataTypeFigure();
116
		figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); 
113
		return primaryShape = figure;
117
		return primaryShape = figure;
114
	}
118
	}
115
119
Lines 175-184 Link Here
175
	}
179
	}
176
180
177
	/**
181
	/**
178
	 * @generated
182
	 * @generated NOT
179
	 */
183
	 */
180
	protected NodeFigure createNodePlate() {
184
	protected NodeFigure createNodePlate() {
181
		DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
185
		DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
186
		AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder();
187
		shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER));
188
		result.setBorder(shadowBorder);
182
		return result;
189
		return result;
183
	}
190
	}
184
191
Lines 262-271 Link Here
262
		}
269
		}
263
	}
270
	}
264
271
272
	@Override
273
	public EditPolicy getPrimaryDragEditPolicy() {
274
		return new AlphaResizableShapeEditPolicy();
275
	}
276
265
	/**
277
	/**
266
	 * @generated
278
	 * @generated NOT
267
	 */
279
	 */
268
	public class DataTypeFigure extends RectangleFigure {
280
	public class DataTypeFigure extends GradientRectangleFigure {
269
281
270
		/**
282
		/**
271
		 * @generated
283
		 * @generated
(-)src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClass2EditPart.java (-5 / +17 lines)
Lines 16-32 Link Here
16
16
17
import org.eclipse.draw2d.IFigure;
17
import org.eclipse.draw2d.IFigure;
18
import org.eclipse.draw2d.PositionConstants;
18
import org.eclipse.draw2d.PositionConstants;
19
import org.eclipse.draw2d.RectangleFigure;
20
import org.eclipse.draw2d.StackLayout;
19
import org.eclipse.draw2d.StackLayout;
21
import org.eclipse.draw2d.ToolbarLayout;
20
import org.eclipse.draw2d.ToolbarLayout;
22
import org.eclipse.draw2d.geometry.Dimension;
21
import org.eclipse.draw2d.geometry.Dimension;
23
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
24
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
25
import org.eclipse.emf.ecore.EcorePackage;
24
import org.eclipse.emf.ecore.EcorePackage;
25
import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder;
26
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
26
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
27
import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure;
28
import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy;
27
import org.eclipse.emf.ecoretools.diagram.edit.policies.EClass2ItemSemanticEditPolicy;
29
import org.eclipse.emf.ecoretools.diagram.edit.policies.EClass2ItemSemanticEditPolicy;
28
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
30
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
29
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
31
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
32
import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants;
30
import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes;
33
import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes;
31
import org.eclipse.gef.EditPart;
34
import org.eclipse.gef.EditPart;
32
import org.eclipse.gef.EditPolicy;
35
import org.eclipse.gef.EditPolicy;
Lines 132-141 Link Here
132
	}
135
	}
133
136
134
	/**
137
	/**
135
	 * @generated
138
	 * @generated NOT
136
	 */
139
	 */
137
	protected IFigure createNodeShape() {
140
	protected IFigure createNodeShape() {
138
		ClassFigure figure = new ClassFigure();
141
		ClassFigure figure = new ClassFigure();
142
		figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); 
139
		return primaryShape = figure;
143
		return primaryShape = figure;
140
	}
144
	}
141
145
Lines 197-206 Link Here
197
	}
201
	}
198
202
199
	/**
203
	/**
200
	 * @generated
204
	 * @generated NOT
201
	 */
205
	 */
202
	protected NodeFigure createNodePlate() {
206
	protected NodeFigure createNodePlate() {
203
		DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
207
		DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
208
		AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder();
209
		shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER));
210
		result.setBorder(shadowBorder);
204
		return result;
211
		return result;
205
	}
212
	}
206
213
Lines 284-293 Link Here
284
		}
291
		}
285
	}
292
	}
286
293
294
	@Override
295
	public EditPolicy getPrimaryDragEditPolicy() {
296
		return new AlphaResizableShapeEditPolicy();
297
	}
298
287
	/**
299
	/**
288
	 * @generated
300
	 * @generated NOT
289
	 */
301
	 */
290
	public class ClassFigure extends RectangleFigure {
302
	public class ClassFigure extends GradientRectangleFigure {
291
303
292
		/**
304
		/**
293
		 * @generated
305
		 * @generated
(-)src/org/eclipse/emf/ecoretools/diagram/edit/parts/EAnnotationEditPart.java (-4 / +31 lines)
Lines 18-37 Link Here
18
import org.eclipse.draw2d.IFigure;
18
import org.eclipse.draw2d.IFigure;
19
import org.eclipse.draw2d.MarginBorder;
19
import org.eclipse.draw2d.MarginBorder;
20
import org.eclipse.draw2d.PositionConstants;
20
import org.eclipse.draw2d.PositionConstants;
21
import org.eclipse.draw2d.RectangleFigure;
22
import org.eclipse.draw2d.StackLayout;
21
import org.eclipse.draw2d.StackLayout;
23
import org.eclipse.draw2d.ToolbarLayout;
22
import org.eclipse.draw2d.ToolbarLayout;
24
import org.eclipse.draw2d.geometry.Dimension;
23
import org.eclipse.draw2d.geometry.Dimension;
24
import org.eclipse.draw2d.geometry.Insets;
25
import org.eclipse.draw2d.geometry.Point;
25
import org.eclipse.draw2d.geometry.Point;
26
import org.eclipse.draw2d.geometry.PointList;
26
import org.eclipse.draw2d.geometry.PointList;
27
import org.eclipse.draw2d.geometry.Rectangle;
27
import org.eclipse.draw2d.geometry.Rectangle;
28
import org.eclipse.emf.common.notify.Notification;
28
import org.eclipse.emf.common.notify.Notification;
29
import org.eclipse.emf.ecore.EObject;
29
import org.eclipse.emf.ecore.EObject;
30
import org.eclipse.emf.ecore.EcorePackage;
30
import org.eclipse.emf.ecore.EcorePackage;
31
import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder;
31
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
32
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
33
import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure;
34
import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy;
32
import org.eclipse.emf.ecoretools.diagram.edit.policies.EAnnotationItemSemanticEditPolicy;
35
import org.eclipse.emf.ecoretools.diagram.edit.policies.EAnnotationItemSemanticEditPolicy;
33
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
36
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
34
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
37
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
38
import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants;
35
import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes;
39
import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes;
36
import org.eclipse.gef.EditPart;
40
import org.eclipse.gef.EditPart;
37
import org.eclipse.gef.EditPolicy;
41
import org.eclipse.gef.EditPolicy;
Lines 45-50 Link Here
45
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy;
49
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy;
46
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
50
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
47
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
51
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
52
import org.eclipse.gmf.runtime.diagram.ui.figures.DiagramColorConstants;
48
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
53
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
49
import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
54
import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
50
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
55
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
Lines 133-142 Link Here
133
	}
138
	}
134
139
135
	/**
140
	/**
136
	 * @generated
141
	 * @generated NOT
137
	 */
142
	 */
138
	protected IFigure createNodeShape() {
143
	protected IFigure createNodeShape() {
139
		AnnotationFigure figure = new AnnotationFigure();
144
		AnnotationFigure figure = new AnnotationFigure();
145
		figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); 
140
		return primaryShape = figure;
146
		return primaryShape = figure;
141
	}
147
	}
142
148
Lines 208-213 Link Here
208
				return getPrimaryShape().getPointsList();
214
				return getPrimaryShape().getPointsList();
209
			}
215
			}
210
		};
216
		};
217
		AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder();
218
		shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER));
219
		result.setBorder(shadowBorder);
211
		return result;
220
		return result;
212
	}
221
	}
213
222
Lines 289-298 Link Here
289
		super.refreshVisuals();
298
		super.refreshVisuals();
290
	}
299
	}
291
300
301
	@Override
302
	public EditPolicy getPrimaryDragEditPolicy() {
303
		return new AlphaResizableShapeEditPolicy();
304
	}
305
292
	/**
306
	/**
293
	 * @generated
307
	 * @generated NOT
294
	 */
308
	 */
295
	public class AnnotationFigure extends RectangleFigure {
309
	public class AnnotationFigure extends GradientRectangleFigure {
296
310
297
		/**
311
		/**
298
		 * @generated
312
		 * @generated
Lines 347-352 Link Here
347
			desiredBounds.addPoint(point5);
361
			desiredBounds.addPoint(point5);
348
362
349
			graphics.fillPolygon(desiredBounds);
363
			graphics.fillPolygon(desiredBounds);
364
365
			if (shouldUseGradient()) {
366
				// fill gradient
367
				// get gradient rectangle
368
				Rectangle gradientRectangle = r.getCopy();
369
				gradientRectangle.crop(new Insets(BENT_CORNER_HEIGHT, 0, 0, 0));
370
				// draw gradient rectangle
371
				graphics.pushState();
372
				graphics.setBackgroundColor(DiagramColorConstants.white);
373
				graphics.setForegroundColor(getBackgroundColor());
374
				graphics.fillGradient(gradientRectangle, true);
375
				graphics.popState();
376
			}
350
		}
377
		}
351
378
352
		@Override
379
		@Override
(-)src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackage2EditPart.java (-9 / +23 lines)
Lines 28-38 Link Here
28
import org.eclipse.emf.common.notify.Notification;
28
import org.eclipse.emf.common.notify.Notification;
29
import org.eclipse.emf.ecore.EObject;
29
import org.eclipse.emf.ecore.EObject;
30
import org.eclipse.emf.ecore.EcorePackage;
30
import org.eclipse.emf.ecore.EcorePackage;
31
import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder;
31
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
32
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
33
import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure;
32
import org.eclipse.emf.ecoretools.diagram.edit.figures.PackageLabelRectangle;
34
import org.eclipse.emf.ecoretools.diagram.edit.figures.PackageLabelRectangle;
35
import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy;
33
import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackage2ItemSemanticEditPolicy;
36
import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackage2ItemSemanticEditPolicy;
34
import org.eclipse.emf.ecoretools.diagram.edit.policies.OpenDiagramEditPolicy;
37
import org.eclipse.emf.ecoretools.diagram.edit.policies.OpenDiagramEditPolicy;
35
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
38
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
39
import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants;
36
import org.eclipse.gef.EditPart;
40
import org.eclipse.gef.EditPart;
37
import org.eclipse.gef.EditPolicy;
41
import org.eclipse.gef.EditPolicy;
38
import org.eclipse.gef.Request;
42
import org.eclipse.gef.Request;
Lines 124-133 Link Here
124
	}
128
	}
125
129
126
	/**
130
	/**
127
	 * @generated
131
	 * @generated NOT
128
	 */
132
	 */
129
	protected IFigure createNodeShape() {
133
	protected IFigure createNodeShape() {
130
		PackageFigure figure = new PackageFigure();
134
		PackageFigure figure = new PackageFigure();
135
		figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); 
131
		return primaryShape = figure;
136
		return primaryShape = figure;
132
	}
137
	}
133
138
Lines 226-232 Link Here
226
				return points;
231
				return points;
227
			}
232
			}
228
		};
233
		};
229
		return result;
234
		AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder();
235
		shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER));
236
		result.setBorder(shadowBorder);
237
        return result;
230
	}
238
	}
231
239
232
	/**
240
	/**
Lines 307-321 Link Here
307
		super.refreshVisuals();
315
		super.refreshVisuals();
308
	}
316
	}
309
317
318
	@Override
319
	public EditPolicy getPrimaryDragEditPolicy() {
320
		return new AlphaResizableShapeEditPolicy();
321
	}
322
310
	/**
323
	/**
311
	 * @generated
324
	 * @generated NOT
312
	 */
325
	 */
313
	public class PackageFigure extends RectangleFigure {
326
	public class PackageFigure extends GradientRectangleFigure {
314
327
315
		/**
328
		/**
316
		 * @generated
329
		 * @generated NOT
317
		 */
330
		 */
318
		private RectangleFigure fFigurePackageBodyRectangle;
331
		private GradientRectangleFigure fFigurePackageBodyRectangle;
319
332
320
		/**
333
		/**
321
		 * @generated
334
		 * @generated
Lines 353-359 Link Here
353
		private void createContents() {
366
		private void createContents() {
354
367
355
			packageLabelRectangle0 = new PackageLabelRectangle();
368
			packageLabelRectangle0 = new PackageLabelRectangle();
356
			packageLabelRectangle0.setLineWidth(2);
369
			packageLabelRectangle0.setLineWidth(1);
357
370
358
			packageLabelRectangle0.setBorder(new MarginBorder(getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5)));
371
			packageLabelRectangle0.setBorder(new MarginBorder(getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5)));
359
372
Lines 397-404 Link Here
397
			constraintFillerFigure0.grabExcessVerticalSpace = false;
410
			constraintFillerFigure0.grabExcessVerticalSpace = false;
398
			this.add(fillerFigure0, constraintFillerFigure0);
411
			this.add(fillerFigure0, constraintFillerFigure0);
399
412
400
			fFigurePackageBodyRectangle = new RectangleFigure();
413
			fFigurePackageBodyRectangle = new GradientRectangleFigure();
401
			fFigurePackageBodyRectangle.setLineWidth(2);
414
			fFigurePackageBodyRectangle.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT));
415
			fFigurePackageBodyRectangle.setLineWidth(1);
402
416
403
			GridData constraintFFigurePackageBodyRectangle = new GridData();
417
			GridData constraintFFigurePackageBodyRectangle = new GridData();
404
			constraintFFigurePackageBodyRectangle.verticalAlignment = GridData.FILL;
418
			constraintFFigurePackageBodyRectangle.verticalAlignment = GridData.FILL;
(-)src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumEditPart.java (-5 / +17 lines)
Lines 16-32 Link Here
16
16
17
import org.eclipse.draw2d.IFigure;
17
import org.eclipse.draw2d.IFigure;
18
import org.eclipse.draw2d.PositionConstants;
18
import org.eclipse.draw2d.PositionConstants;
19
import org.eclipse.draw2d.RectangleFigure;
20
import org.eclipse.draw2d.StackLayout;
19
import org.eclipse.draw2d.StackLayout;
21
import org.eclipse.draw2d.ToolbarLayout;
20
import org.eclipse.draw2d.ToolbarLayout;
22
import org.eclipse.draw2d.geometry.Dimension;
21
import org.eclipse.draw2d.geometry.Dimension;
23
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
24
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
25
import org.eclipse.emf.ecore.EcorePackage;
24
import org.eclipse.emf.ecore.EcorePackage;
25
import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder;
26
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
26
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
27
import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure;
28
import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy;
27
import org.eclipse.emf.ecoretools.diagram.edit.policies.EEnumItemSemanticEditPolicy;
29
import org.eclipse.emf.ecoretools.diagram.edit.policies.EEnumItemSemanticEditPolicy;
28
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
30
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
29
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
31
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
32
import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants;
30
import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes;
33
import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes;
31
import org.eclipse.gef.EditPart;
34
import org.eclipse.gef.EditPart;
32
import org.eclipse.gef.EditPolicy;
35
import org.eclipse.gef.EditPolicy;
Lines 128-137 Link Here
128
	}
131
	}
129
132
130
	/**
133
	/**
131
	 * @generated
134
	 * @generated NOT
132
	 */
135
	 */
133
	protected IFigure createNodeShape() {
136
	protected IFigure createNodeShape() {
134
		EnumerationFigure figure = new EnumerationFigure();
137
		EnumerationFigure figure = new EnumerationFigure();
138
		figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); 
135
		return primaryShape = figure;
139
		return primaryShape = figure;
136
	}
140
	}
137
141
Lines 193-202 Link Here
193
	}
197
	}
194
198
195
	/**
199
	/**
196
	 * @generated
200
	 * @generated NOT
197
	 */
201
	 */
198
	protected NodeFigure createNodePlate() {
202
	protected NodeFigure createNodePlate() {
199
		DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
203
		DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
204
		AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder();
205
		shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER));
206
		result.setBorder(shadowBorder);
200
		return result;
207
		return result;
201
	}
208
	}
202
209
Lines 278-287 Link Here
278
		super.refreshVisuals();
285
		super.refreshVisuals();
279
	}
286
	}
280
287
288
	@Override
289
	public EditPolicy getPrimaryDragEditPolicy() {
290
		return new AlphaResizableShapeEditPolicy();
291
	}
292
281
	/**
293
	/**
282
	 * @generated
294
	 * @generated NOT
283
	 */
295
	 */
284
	public class EnumerationFigure extends RectangleFigure {
296
	public class EnumerationFigure extends GradientRectangleFigure {
285
297
286
		/**
298
		/**
287
		 * @generated
299
		 * @generated
(-)src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassEditPart.java (-5 / +17 lines)
Lines 16-32 Link Here
16
16
17
import org.eclipse.draw2d.IFigure;
17
import org.eclipse.draw2d.IFigure;
18
import org.eclipse.draw2d.PositionConstants;
18
import org.eclipse.draw2d.PositionConstants;
19
import org.eclipse.draw2d.RectangleFigure;
20
import org.eclipse.draw2d.StackLayout;
19
import org.eclipse.draw2d.StackLayout;
21
import org.eclipse.draw2d.ToolbarLayout;
20
import org.eclipse.draw2d.ToolbarLayout;
22
import org.eclipse.draw2d.geometry.Dimension;
21
import org.eclipse.draw2d.geometry.Dimension;
23
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
24
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
25
import org.eclipse.emf.ecore.EcorePackage;
24
import org.eclipse.emf.ecore.EcorePackage;
25
import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder;
26
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
26
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
27
import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure;
28
import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy;
27
import org.eclipse.emf.ecoretools.diagram.edit.policies.EClassItemSemanticEditPolicy;
29
import org.eclipse.emf.ecoretools.diagram.edit.policies.EClassItemSemanticEditPolicy;
28
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
30
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
29
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
31
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
32
import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants;
30
import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes;
33
import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes;
31
import org.eclipse.gef.EditPart;
34
import org.eclipse.gef.EditPart;
32
import org.eclipse.gef.EditPolicy;
35
import org.eclipse.gef.EditPolicy;
Lines 132-141 Link Here
132
	}
135
	}
133
136
134
	/**
137
	/**
135
	 * @generated
138
	 * @generated NOT
136
	 */
139
	 */
137
	protected IFigure createNodeShape() {
140
	protected IFigure createNodeShape() {
138
		ClassFigure figure = new ClassFigure();
141
		ClassFigure figure = new ClassFigure();
142
		figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); 
139
		return primaryShape = figure;
143
		return primaryShape = figure;
140
	}
144
	}
141
145
Lines 197-206 Link Here
197
	}
201
	}
198
202
199
	/**
203
	/**
200
	 * @generated
204
	 * @generated NOT
201
	 */
205
	 */
202
	protected NodeFigure createNodePlate() {
206
	protected NodeFigure createNodePlate() {
203
		DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
207
		DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
208
		AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder();
209
		shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER));
210
		result.setBorder(shadowBorder);
204
		return result;
211
		return result;
205
	}
212
	}
206
213
Lines 282-291 Link Here
282
		super.refreshVisuals();
289
		super.refreshVisuals();
283
	}
290
	}
284
291
292
	@Override
293
	public EditPolicy getPrimaryDragEditPolicy() {
294
		return new AlphaResizableShapeEditPolicy();
295
	}
296
285
	/**
297
	/**
286
	 * @generated
298
	 * @generated NOT
287
	 */
299
	 */
288
	public class ClassFigure extends RectangleFigure {
300
	public class ClassFigure extends GradientRectangleFigure {
289
301
290
		/**
302
		/**
291
		 * @generated
303
		 * @generated
(-)src/org/eclipse/emf/ecoretools/diagram/edit/parts/EDataTypeEditPart.java (-5 / +17 lines)
Lines 17-23 Link Here
17
import org.eclipse.draw2d.Graphics;
17
import org.eclipse.draw2d.Graphics;
18
import org.eclipse.draw2d.IFigure;
18
import org.eclipse.draw2d.IFigure;
19
import org.eclipse.draw2d.PositionConstants;
19
import org.eclipse.draw2d.PositionConstants;
20
import org.eclipse.draw2d.RectangleFigure;
21
import org.eclipse.draw2d.StackLayout;
20
import org.eclipse.draw2d.StackLayout;
22
import org.eclipse.draw2d.ToolbarLayout;
21
import org.eclipse.draw2d.ToolbarLayout;
23
import org.eclipse.draw2d.geometry.Dimension;
22
import org.eclipse.draw2d.geometry.Dimension;
Lines 26-35 Link Here
26
import org.eclipse.emf.common.notify.Notification;
25
import org.eclipse.emf.common.notify.Notification;
27
import org.eclipse.emf.ecore.EObject;
26
import org.eclipse.emf.ecore.EObject;
28
import org.eclipse.emf.ecore.EcorePackage;
27
import org.eclipse.emf.ecore.EcorePackage;
28
import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder;
29
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
29
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
30
import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure;
31
import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy;
30
import org.eclipse.emf.ecoretools.diagram.edit.policies.EDataTypeItemSemanticEditPolicy;
32
import org.eclipse.emf.ecoretools.diagram.edit.policies.EDataTypeItemSemanticEditPolicy;
31
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
33
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
32
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
34
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
35
import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants;
33
import org.eclipse.gef.EditPart;
36
import org.eclipse.gef.EditPart;
34
import org.eclipse.gef.EditPolicy;
37
import org.eclipse.gef.EditPolicy;
35
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
38
import org.eclipse.gef.editpolicies.LayoutEditPolicy;
Lines 106-115 Link Here
106
	}
109
	}
107
110
108
	/**
111
	/**
109
	 * @generated
112
	 * @generated NOT
110
	 */
113
	 */
111
	protected IFigure createNodeShape() {
114
	protected IFigure createNodeShape() {
112
		DataTypeFigure figure = new DataTypeFigure();
115
		DataTypeFigure figure = new DataTypeFigure();
116
		figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); 
113
		return primaryShape = figure;
117
		return primaryShape = figure;
114
	}
118
	}
115
119
Lines 175-184 Link Here
175
	}
179
	}
176
180
177
	/**
181
	/**
178
	 * @generated
182
	 * @generated NOT
179
	 */
183
	 */
180
	protected NodeFigure createNodePlate() {
184
	protected NodeFigure createNodePlate() {
181
		DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
185
		DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
186
		AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder();
187
		shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER));
188
		result.setBorder(shadowBorder);
182
		return result;
189
		return result;
183
	}
190
	}
184
191
Lines 260-269 Link Here
260
		super.refreshVisuals();
267
		super.refreshVisuals();
261
	}
268
	}
262
269
270
	@Override
271
	public EditPolicy getPrimaryDragEditPolicy() {
272
		return new AlphaResizableShapeEditPolicy();
273
	}
274
263
	/**
275
	/**
264
	 * @generated
276
	 * @generated NOT
265
	 */
277
	 */
266
	public class DataTypeFigure extends RectangleFigure {
278
	public class DataTypeFigure extends GradientRectangleFigure {
267
279
268
		/**
280
		/**
269
		 * @generated
281
		 * @generated
(-)src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackageContentsEditPart.java (+3 lines)
Lines 15-20 Link Here
15
package org.eclipse.emf.ecoretools.diagram.edit.parts;
15
package org.eclipse.emf.ecoretools.diagram.edit.parts;
16
16
17
import org.eclipse.draw2d.IFigure;
17
import org.eclipse.draw2d.IFigure;
18
import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaXYLayoutEditPolicy;
18
import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageContentsCanonicalEditPolicy;
19
import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageContentsCanonicalEditPolicy;
19
import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageContentsItemSemanticEditPolicy;
20
import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageContentsItemSemanticEditPolicy;
20
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoretoolsEditPolicyRoles;
21
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoretoolsEditPolicyRoles;
Lines 75-80 Link Here
75
		installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
76
		installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
76
		installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new PackageDiagramDragDropEditPolicy());
77
		installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new PackageDiagramDragDropEditPolicy());
77
		installEditPolicy(EcoretoolsEditPolicyRoles.PSEUDO_CANONICAL_ROLE, new EPackageContentsCanonicalEditPolicy());
78
		installEditPolicy(EcoretoolsEditPolicyRoles.PSEUDO_CANONICAL_ROLE, new EPackageContentsCanonicalEditPolicy());
79
		installEditPolicy(EditPolicy.LAYOUT_ROLE, new AlphaXYLayoutEditPolicy());
80
		// EPackageCompartment can not be connected !
78
	}
81
	}
79
82
80
	/**
83
	/**
(-)src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackageEditPart.java (+3 lines)
Lines 14-23 Link Here
14
14
15
package org.eclipse.emf.ecoretools.diagram.edit.parts;
15
package org.eclipse.emf.ecoretools.diagram.edit.parts;
16
16
17
import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaXYLayoutEditPolicy;
17
import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageCanonicalEditPolicy;
18
import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageCanonicalEditPolicy;
18
import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageItemSemanticEditPolicy;
19
import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageItemSemanticEditPolicy;
19
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoretoolsEditPolicyRoles;
20
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoretoolsEditPolicyRoles;
20
import org.eclipse.emf.ecoretools.diagram.edit.policies.PackageDiagramDragDropEditPolicy;
21
import org.eclipse.emf.ecoretools.diagram.edit.policies.PackageDiagramDragDropEditPolicy;
22
import org.eclipse.gef.EditPolicy;
21
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
23
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
22
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
24
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
23
import org.eclipse.gmf.runtime.notation.View;
25
import org.eclipse.gmf.runtime.notation.View;
Lines 53-58 Link Here
53
		installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EPackageItemSemanticEditPolicy());
55
		installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EPackageItemSemanticEditPolicy());
54
		installEditPolicy(EcoretoolsEditPolicyRoles.PSEUDO_CANONICAL_ROLE, new EPackageCanonicalEditPolicy());
56
		installEditPolicy(EcoretoolsEditPolicyRoles.PSEUDO_CANONICAL_ROLE, new EPackageCanonicalEditPolicy());
55
		installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new PackageDiagramDragDropEditPolicy());
57
		installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new PackageDiagramDragDropEditPolicy());
58
		installEditPolicy(EditPolicy.LAYOUT_ROLE, new AlphaXYLayoutEditPolicy());
56
59
57
		// removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
60
		// removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
58
	}
61
	}
(-)src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnum2EditPart.java (-5 / +17 lines)
Lines 16-32 Link Here
16
16
17
import org.eclipse.draw2d.IFigure;
17
import org.eclipse.draw2d.IFigure;
18
import org.eclipse.draw2d.PositionConstants;
18
import org.eclipse.draw2d.PositionConstants;
19
import org.eclipse.draw2d.RectangleFigure;
20
import org.eclipse.draw2d.StackLayout;
19
import org.eclipse.draw2d.StackLayout;
21
import org.eclipse.draw2d.ToolbarLayout;
20
import org.eclipse.draw2d.ToolbarLayout;
22
import org.eclipse.draw2d.geometry.Dimension;
21
import org.eclipse.draw2d.geometry.Dimension;
23
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
24
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
25
import org.eclipse.emf.ecore.EcorePackage;
24
import org.eclipse.emf.ecore.EcorePackage;
25
import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder;
26
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
26
import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils;
27
import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure;
28
import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy;
27
import org.eclipse.emf.ecoretools.diagram.edit.policies.EEnum2ItemSemanticEditPolicy;
29
import org.eclipse.emf.ecoretools.diagram.edit.policies.EEnum2ItemSemanticEditPolicy;
28
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
30
import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy;
29
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
31
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
32
import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants;
30
import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes;
33
import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes;
31
import org.eclipse.gef.EditPart;
34
import org.eclipse.gef.EditPart;
32
import org.eclipse.gef.EditPolicy;
35
import org.eclipse.gef.EditPolicy;
Lines 128-137 Link Here
128
	}
131
	}
129
132
130
	/**
133
	/**
131
	 * @generated
134
	 * @generated NOT
132
	 */
135
	 */
133
	protected IFigure createNodeShape() {
136
	protected IFigure createNodeShape() {
134
		EnumerationFigure figure = new EnumerationFigure();
137
		EnumerationFigure figure = new EnumerationFigure();
138
		figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); 
135
		return primaryShape = figure;
139
		return primaryShape = figure;
136
	}
140
	}
137
141
Lines 193-202 Link Here
193
	}
197
	}
194
198
195
	/**
199
	/**
196
	 * @generated
200
	 * @generated NOT
197
	 */
201
	 */
198
	protected NodeFigure createNodePlate() {
202
	protected NodeFigure createNodePlate() {
199
		DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
203
		DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
204
		AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder();
205
		shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER));
206
		result.setBorder(shadowBorder);
200
		return result;
207
		return result;
201
	}
208
	}
202
209
Lines 280-289 Link Here
280
		}
287
		}
281
	}
288
	}
282
289
290
	@Override
291
	public EditPolicy getPrimaryDragEditPolicy() {
292
		return new AlphaResizableShapeEditPolicy();
293
	}
294
283
	/**
295
	/**
284
	 * @generated
296
	 * @generated NOT
285
	 */
297
	 */
286
	public class EnumerationFigure extends RectangleFigure {
298
	public class EnumerationFigure extends GradientRectangleFigure {
287
299
288
		/**
300
		/**
289
		 * @generated
301
		 * @generated
(-)src/org/eclipse/emf/ecoretools/diagram/view/factories/EEnumViewFactory.java (-2 / +5 lines)
Lines 18-23 Link Here
18
import java.util.List;
18
import java.util.List;
19
19
20
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.draw2d.ColorConstants;
21
import org.eclipse.emf.ecore.EAnnotation;
22
import org.eclipse.emf.ecore.EAnnotation;
22
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EcoreFactory;
24
import org.eclipse.emf.ecore.EcoreFactory;
Lines 41-47 Link Here
41
 */
42
 */
42
public class EEnumViewFactory extends AbstractShapeViewFactory {
43
public class EEnumViewFactory extends AbstractShapeViewFactory {
43
44
44
	static final Color THIS_FORE = new Color(null, 0, 0, 0);
45
	static final Color THIS_FONT = ColorConstants.darkGray;
46
47
	static final Color THIS_FORE = ColorConstants.gray;
45
48
46
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
49
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
47
50
Lines 53-59 Link Here
53
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
56
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
54
		style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK));
57
		style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK));
55
		style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE));
58
		style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE));
56
		style.setFontColor(FigureUtilities.colorToInteger(THIS_FORE));
59
		style.setFontColor(FigureUtilities.colorToInteger(THIS_FONT));
57
		style.setFontHeight(fontHeight);
60
		style.setFontHeight(fontHeight);
58
	}
61
	}
59
62
(-)src/org/eclipse/emf/ecoretools/diagram/view/factories/EClass2ViewFactory.java (-2 / +5 lines)
Lines 18-23 Link Here
18
import java.util.List;
18
import java.util.List;
19
19
20
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.draw2d.ColorConstants;
21
import org.eclipse.emf.ecore.EObject;
22
import org.eclipse.emf.ecore.EObject;
22
import org.eclipse.emf.ecoretools.diagram.edit.parts.EClass2EditPart;
23
import org.eclipse.emf.ecoretools.diagram.edit.parts.EClass2EditPart;
23
import org.eclipse.emf.ecoretools.diagram.edit.parts.EClassAttributes2EditPart;
24
import org.eclipse.emf.ecoretools.diagram.edit.parts.EClassAttributes2EditPart;
Lines 39-45 Link Here
39
 */
40
 */
40
public class EClass2ViewFactory extends AbstractShapeViewFactory {
41
public class EClass2ViewFactory extends AbstractShapeViewFactory {
41
42
42
	static final Color THIS_FORE = new Color(null, 0, 0, 0);
43
	static final Color THIS_FONT = ColorConstants.darkGray;
44
45
	static final Color THIS_FORE = ColorConstants.gray;
43
46
44
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
47
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
45
48
Lines 51-57 Link Here
51
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
54
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
52
		style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK));
55
		style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK));
53
		style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE));
56
		style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE));
54
		style.setFontColor(FigureUtilities.colorToInteger(THIS_FORE));
57
		style.setFontColor(FigureUtilities.colorToInteger(THIS_FONT));
55
		style.setFontHeight(fontHeight);
58
		style.setFontHeight(fontHeight);
56
	}
59
	}
57
60
(-)src/org/eclipse/emf/ecoretools/diagram/view/factories/EPackage2ViewFactory.java (-2 / +3 lines)
Lines 18-23 Link Here
18
import java.util.List;
18
import java.util.List;
19
19
20
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.draw2d.ColorConstants;
21
import org.eclipse.emf.ecore.EAnnotation;
22
import org.eclipse.emf.ecore.EAnnotation;
22
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EcoreFactory;
24
import org.eclipse.emf.ecore.EcoreFactory;
Lines 42-50 Link Here
42
 */
43
 */
43
public class EPackage2ViewFactory extends AbstractShapeViewFactory {
44
public class EPackage2ViewFactory extends AbstractShapeViewFactory {
44
45
45
	static final Color THIS_FORE = new Color(null, 0, 0, 0);
46
	static final Color THIS_FORE = ColorConstants.darkGray;
46
47
47
	static final Color THIS_BACK = new Color(null, 190, 166, 206);
48
	static final Color THIS_BACK = new Color(null, 183, 167, 200);
48
49
49
	static final int fontHeight = 10;
50
	static final int fontHeight = 10;
50
51
(-)src/org/eclipse/emf/ecoretools/diagram/view/factories/EAnnotationReferencesViewFactory.java (-1 / +2 lines)
Lines 18-23 Link Here
18
import java.util.List;
18
import java.util.List;
19
19
20
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.draw2d.ColorConstants;
21
import org.eclipse.emf.ecoretools.diagram.edit.parts.EAnnotationReferencesEditPart;
22
import org.eclipse.emf.ecoretools.diagram.edit.parts.EAnnotationReferencesEditPart;
22
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
23
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
23
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
24
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
Lines 33-39 Link Here
33
 */
34
 */
34
public class EAnnotationReferencesViewFactory extends ConnectionViewFactory {
35
public class EAnnotationReferencesViewFactory extends ConnectionViewFactory {
35
36
36
	static final Color THIS_FORE = new Color(null, 0, 0, 0);
37
	static final Color THIS_FORE = ColorConstants.darkGray;
37
38
38
	@Override
39
	@Override
39
	protected void initializeFromPreferences(View view) {
40
	protected void initializeFromPreferences(View view) {
(-)src/org/eclipse/emf/ecoretools/diagram/view/factories/EClassViewFactory.java (-2 / +5 lines)
Lines 18-23 Link Here
18
import java.util.List;
18
import java.util.List;
19
19
20
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.draw2d.ColorConstants;
21
import org.eclipse.emf.ecore.EAnnotation;
22
import org.eclipse.emf.ecore.EAnnotation;
22
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EcoreFactory;
24
import org.eclipse.emf.ecore.EcoreFactory;
Lines 42-48 Link Here
42
 */
43
 */
43
public class EClassViewFactory extends AbstractShapeViewFactory {
44
public class EClassViewFactory extends AbstractShapeViewFactory {
44
45
45
	static final Color THIS_FORE = new Color(null, 0, 0, 0);
46
	static final Color THIS_FONT = ColorConstants.darkGray;
47
48
	static final Color THIS_FORE = ColorConstants.gray;
46
49
47
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
50
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
48
51
Lines 54-60 Link Here
54
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
57
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
55
		style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK));
58
		style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK));
56
		style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE));
59
		style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE));
57
		style.setFontColor(FigureUtilities.colorToInteger(THIS_FORE));
60
		style.setFontColor(FigureUtilities.colorToInteger(THIS_FONT));
58
		style.setFontHeight(fontHeight);
61
		style.setFontHeight(fontHeight);
59
	}
62
	}
60
63
(-)src/org/eclipse/emf/ecoretools/diagram/view/factories/EEnum2ViewFactory.java (-2 / +5 lines)
Lines 18-23 Link Here
18
import java.util.List;
18
import java.util.List;
19
19
20
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.draw2d.ColorConstants;
21
import org.eclipse.emf.ecore.EObject;
22
import org.eclipse.emf.ecore.EObject;
22
import org.eclipse.emf.ecoretools.diagram.edit.parts.EEnum2EditPart;
23
import org.eclipse.emf.ecoretools.diagram.edit.parts.EEnum2EditPart;
23
import org.eclipse.emf.ecoretools.diagram.edit.parts.EEnumLiteralsEditPart;
24
import org.eclipse.emf.ecoretools.diagram.edit.parts.EEnumLiteralsEditPart;
Lines 38-44 Link Here
38
 */
39
 */
39
public class EEnum2ViewFactory extends AbstractShapeViewFactory {
40
public class EEnum2ViewFactory extends AbstractShapeViewFactory {
40
41
41
	static final Color THIS_FORE = new Color(null, 0, 0, 0);
42
	static final Color THIS_FONT = ColorConstants.darkGray;
43
44
	static final Color THIS_FORE = ColorConstants.gray;
42
45
43
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
46
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
44
47
Lines 50-56 Link Here
50
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
53
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
51
		style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK));
54
		style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK));
52
		style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE));
55
		style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE));
53
		style.setFontColor(FigureUtilities.colorToInteger(THIS_FORE));
56
		style.setFontColor(FigureUtilities.colorToInteger(THIS_FONT));
54
		style.setFontHeight(fontHeight);
57
		style.setFontHeight(fontHeight);
55
	}
58
	}
56
59
(-)src/org/eclipse/emf/ecoretools/diagram/view/factories/EClassESuperTypesViewFactory.java (-1 / +2 lines)
Lines 18-23 Link Here
18
import java.util.List;
18
import java.util.List;
19
19
20
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.draw2d.ColorConstants;
21
import org.eclipse.emf.ecoretools.diagram.edit.parts.EClassESuperTypesEditPart;
22
import org.eclipse.emf.ecoretools.diagram.edit.parts.EClassESuperTypesEditPart;
22
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
23
import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry;
23
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
24
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
Lines 34-40 Link Here
34
 */
35
 */
35
public class EClassESuperTypesViewFactory extends ConnectionViewFactory {
36
public class EClassESuperTypesViewFactory extends ConnectionViewFactory {
36
37
37
	static final Color THIS_FORE = new Color(null, 0, 0, 0);
38
	static final Color THIS_FORE = ColorConstants.darkGray;
38
39
39
	@Override
40
	@Override
40
	protected void initializeFromPreferences(View view) {
41
	protected void initializeFromPreferences(View view) {
(-)src/org/eclipse/emf/ecoretools/diagram/view/factories/EReferenceViewFactory.java (-1 / +2 lines)
Lines 18-23 Link Here
18
import java.util.List;
18
import java.util.List;
19
19
20
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.draw2d.ColorConstants;
21
import org.eclipse.emf.ecore.EObject;
22
import org.eclipse.emf.ecore.EObject;
22
import org.eclipse.emf.ecoretools.diagram.edit.parts.EReferenceEditPart;
23
import org.eclipse.emf.ecoretools.diagram.edit.parts.EReferenceEditPart;
23
import org.eclipse.emf.ecoretools.diagram.edit.parts.EReferenceLowerBoundUpperBoundEditPart;
24
import org.eclipse.emf.ecoretools.diagram.edit.parts.EReferenceLowerBoundUpperBoundEditPart;
Lines 39-45 Link Here
39
 */
40
 */
40
public class EReferenceViewFactory extends ConnectionViewFactory {
41
public class EReferenceViewFactory extends ConnectionViewFactory {
41
42
42
	static final Color THIS_FORE = new Color(null, 0, 0, 0);
43
	static final Color THIS_FORE = ColorConstants.darkGray;
43
44
44
	static final int fontHeight = 10;
45
	static final int fontHeight = 10;
45
46
(-)src/org/eclipse/emf/ecoretools/diagram/view/factories/EAnnotationViewFactory.java (-1 / +2 lines)
Lines 18-23 Link Here
18
import java.util.List;
18
import java.util.List;
19
19
20
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.draw2d.ColorConstants;
21
import org.eclipse.emf.ecore.EAnnotation;
22
import org.eclipse.emf.ecore.EAnnotation;
22
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EcoreFactory;
24
import org.eclipse.emf.ecore.EcoreFactory;
Lines 41-47 Link Here
41
 */
42
 */
42
public class EAnnotationViewFactory extends AbstractShapeViewFactory {
43
public class EAnnotationViewFactory extends AbstractShapeViewFactory {
43
44
44
	static final Color THIS_FORE = new Color(null, 0, 0, 0);
45
	static final Color THIS_FORE = ColorConstants.darkGray;
45
46
46
	static final Color THIS_BACK = new Color(null, 232, 211, 223);
47
	static final Color THIS_BACK = new Color(null, 232, 211, 223);
47
48
(-)src/org/eclipse/emf/ecoretools/diagram/view/factories/EDataType2ViewFactory.java (-2 / +5 lines)
Lines 18-23 Link Here
18
import java.util.List;
18
import java.util.List;
19
19
20
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.draw2d.ColorConstants;
21
import org.eclipse.emf.ecore.EObject;
22
import org.eclipse.emf.ecore.EObject;
22
import org.eclipse.emf.ecoretools.diagram.edit.parts.EDataType2EditPart;
23
import org.eclipse.emf.ecoretools.diagram.edit.parts.EDataType2EditPart;
23
import org.eclipse.emf.ecoretools.diagram.edit.parts.EDataTypeInstanceClass2EditPart;
24
import org.eclipse.emf.ecoretools.diagram.edit.parts.EDataTypeInstanceClass2EditPart;
Lines 38-44 Link Here
38
 */
39
 */
39
public class EDataType2ViewFactory extends AbstractShapeViewFactory {
40
public class EDataType2ViewFactory extends AbstractShapeViewFactory {
40
41
41
	static final Color THIS_FORE = new Color(null, 0, 0, 0);
42
	static final Color THIS_FONT = ColorConstants.darkGray;
43
44
	static final Color THIS_FORE = ColorConstants.gray;
42
45
43
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
46
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
44
47
Lines 50-56 Link Here
50
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
53
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
51
		style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK));
54
		style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK));
52
		style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE));
55
		style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE));
53
		style.setFontColor(FigureUtilities.colorToInteger(THIS_FORE));
56
		style.setFontColor(FigureUtilities.colorToInteger(THIS_FONT));
54
		style.setFontHeight(fontHeight);
57
		style.setFontHeight(fontHeight);
55
	}
58
	}
56
59
(-)src/org/eclipse/emf/ecoretools/diagram/view/factories/EDataTypeViewFactory.java (-2 / +5 lines)
Lines 18-23 Link Here
18
import java.util.List;
18
import java.util.List;
19
19
20
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.draw2d.ColorConstants;
21
import org.eclipse.emf.ecore.EAnnotation;
22
import org.eclipse.emf.ecore.EAnnotation;
22
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EcoreFactory;
24
import org.eclipse.emf.ecore.EcoreFactory;
Lines 41-47 Link Here
41
 */
42
 */
42
public class EDataTypeViewFactory extends AbstractShapeViewFactory {
43
public class EDataTypeViewFactory extends AbstractShapeViewFactory {
43
44
44
	static final Color THIS_FORE = new Color(null, 0, 0, 0);
45
	static final Color THIS_FONT = ColorConstants.darkGray;
46
47
	static final Color THIS_FORE = ColorConstants.gray;
45
48
46
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
49
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
47
50
Lines 53-59 Link Here
53
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
56
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
54
		style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK));
57
		style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK));
55
		style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE));
58
		style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE));
56
		style.setFontColor(FigureUtilities.colorToInteger(THIS_FORE));
59
		style.setFontColor(FigureUtilities.colorToInteger(THIS_FONT));
57
		style.setFontHeight(fontHeight);
60
		style.setFontHeight(fontHeight);
58
	}
61
	}
59
62
(-)src/org/eclipse/emf/ecoretools/diagram/preferences/DiagramPreferenceInitializer.java (-2 / +7 lines)
Lines 1-5 Link Here
1
/***********************************************************************
1
/***********************************************************************
2
 * Copyright (c) 2007 Anyware Technologies
2
 * Copyright (c) 2007, 2008 Anyware Technologies
3
 * 
3
 * 
4
 * All rights reserved. This program and the accompanying materials
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
5
 * are made available under the terms of the Eclipse Public License v1.0
Lines 24-30 Link Here
24
public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer {
24
public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer {
25
25
26
	/**
26
	/**
27
	 * @generated
27
	 * Initialize new preferences added to support Sexy UI feature
28
	 * 
29
	 * @generated NOT
28
	 */
30
	 */
29
	@Override
31
	@Override
30
	public void initializeDefaultPreferences() {
32
	public void initializeDefaultPreferences() {
Lines 34-39 Link Here
34
		DiagramAppearancePreferencePage.initDefaults(store);
36
		DiagramAppearancePreferencePage.initDefaults(store);
35
		DiagramConnectionsPreferencePage.initDefaults(store);
37
		DiagramConnectionsPreferencePage.initDefaults(store);
36
		DiagramRulersAndGridPreferencePage.initDefaults(store);
38
		DiagramRulersAndGridPreferencePage.initDefaults(store);
39
		
40
		store.setDefault(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT, true);
41
		store.setDefault(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER, true);
37
	}
42
	}
38
43
39
	/**
44
	/**
(-)src/org/eclipse/emf/ecoretools/diagram/preferences/DiagramAppearancePreferencePage.java (-1 / +64 lines)
Lines 1-5 Link Here
1
/***********************************************************************
1
/***********************************************************************
2
 * Copyright (c) 2007 Anyware Technologies
2
 * Copyright (c) 2007, 2008 Anyware Technologies
3
 * 
3
 * 
4
 * All rights reserved. This program and the accompanying materials
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
5
 * are made available under the terms of the Eclipse Public License v1.0
Lines 16-31 Link Here
16
16
17
import org.eclipse.emf.ecoretools.diagram.part.EcoreDiagramEditorPlugin;
17
import org.eclipse.emf.ecoretools.diagram.part.EcoreDiagramEditorPlugin;
18
import org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage;
18
import org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage;
19
import org.eclipse.jface.preference.BooleanFieldEditor;
20
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.custom.StyledText;
22
import org.eclipse.swt.layout.GridData;
23
import org.eclipse.swt.layout.GridLayout;
24
import org.eclipse.swt.widgets.Composite;
25
import org.eclipse.swt.widgets.Group;
26
import org.eclipse.swt.widgets.Label;
19
27
20
/**
28
/**
21
 * @generated
29
 * @generated
22
 */
30
 */
23
public class DiagramAppearancePreferencePage extends AppearancePreferencePage {
31
public class DiagramAppearancePreferencePage extends AppearancePreferencePage {
24
32
33
	private BooleanFieldEditor fillFigureUsingGradient = null;
34
	private BooleanFieldEditor useShadowOnBorder = null;
35
25
	/**
36
	/**
26
	 * @generated
37
	 * @generated
27
	 */
38
	 */
28
	public DiagramAppearancePreferencePage() {
39
	public DiagramAppearancePreferencePage() {
29
		setPreferenceStore(EcoreDiagramEditorPlugin.getInstance().getPreferenceStore());
40
		setPreferenceStore(EcoreDiagramEditorPlugin.getInstance().getPreferenceStore());
30
	}
41
	}
42
43
	/*
44
	 * (non-Javadoc)
45
	 * 
46
	 * @see org.eclipse.gmf.runtime.common.ui.preferences.AbstractPreferencePage#
47
	 * addFields(org.eclipse.swt.widgets.Composite)
48
	 */
49
	protected void addFields(Composite parent) {
50
		Composite main = createPageLayout(parent);
51
		createFontAndColorGroup(main);
52
		createSexyUIGroup(main);
53
	}
54
55
	/**
56
	 * Create the sexyUI group for the preference page
57
	 * 
58
	 * @param parent
59
	 * @return composite fontAndColourGroup
60
	 */
61
	protected Composite createSexyUIGroup(Composite parent) {
62
63
		Group group = new Group(parent, SWT.NONE);
64
		group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
65
		group.setLayout(new GridLayout(3, false));
66
		Composite composite = new Composite(group, SWT.NONE);
67
		GridLayout gridLayout = new GridLayout(3, false);
68
		composite.setLayout(gridLayout);
69
		GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
70
		gridData.grabExcessHorizontalSpace = true;
71
		gridData.horizontalSpan = 3;
72
		composite.setLayoutData(gridData);
73
		group.setText("Sexy UI - Figures rendering");
74
75
		fillFigureUsingGradient = new BooleanFieldEditor(
76
				IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT, "Use gradient to fill figures", composite);
77
		addField(fillFigureUsingGradient);
78
79
		useShadowOnBorder = new BooleanFieldEditor(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER,
80
				"Show shadow on border", composite);
81
		addField(useShadowOnBorder);
82
		
83
		createNoteComposite(parent.getFont(), group, "Note:", "those preferences will take effect only on new diagrams.");
84
85
		GridLayout layout = new GridLayout();
86
		layout.numColumns = 3;
87
		layout.marginWidth = 0;
88
		layout.marginHeight = 0;
89
		layout.horizontalSpacing = 8;
90
		composite.setLayout(layout);
91
92
		return group;
93
	}
31
}
94
}
(-)src/org/eclipse/emf/ecoretools/diagram/part/EcoreDiagramEditor.java (-7 / +6 lines)
Lines 1-5 Link Here
1
/***********************************************************************
1
/***********************************************************************
2
 * Copyright (c) 2007 Anyware Technologies
2
 * Copyright (c) 2007, 2008 Anyware Technologies
3
 * 
3
 * 
4
 * All rights reserved. This program and the accompanying materials
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
5
 * are made available under the terms of the Eclipse Public License v1.0
Lines 40-52 Link Here
40
import org.eclipse.emf.ecore.resource.Resource;
40
import org.eclipse.emf.ecore.resource.Resource;
41
import org.eclipse.emf.ecoretools.diagram.navigator.EcoreNavigatorItem;
41
import org.eclipse.emf.ecoretools.diagram.navigator.EcoreNavigatorItem;
42
import org.eclipse.emf.ecoretools.diagram.outline.EcoreDiagramOutlinePage;
42
import org.eclipse.emf.ecoretools.diagram.outline.EcoreDiagramOutlinePage;
43
import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants;
43
import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
44
import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
44
import org.eclipse.emf.transaction.TransactionalEditingDomain;
45
import org.eclipse.emf.transaction.TransactionalEditingDomain;
45
import org.eclipse.emf.workspace.EMFCommandOperation;
46
import org.eclipse.emf.workspace.EMFCommandOperation;
46
import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
47
import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
47
import org.eclipse.gef.EditPartViewer;
48
import org.eclipse.gef.EditPartViewer;
48
import org.eclipse.gef.MouseWheelHandler;
49
import org.eclipse.gef.MouseWheelZoomHandler;
50
import org.eclipse.gef.palette.PaletteRoot;
49
import org.eclipse.gef.palette.PaletteRoot;
51
import org.eclipse.gmf.runtime.common.ui.services.marker.MarkerNavigationService;
50
import org.eclipse.gmf.runtime.common.ui.services.marker.MarkerNavigationService;
52
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
51
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
Lines 66-72 Link Here
66
import org.eclipse.jface.viewers.StructuredSelection;
65
import org.eclipse.jface.viewers.StructuredSelection;
67
import org.eclipse.jface.window.Window;
66
import org.eclipse.jface.window.Window;
68
import org.eclipse.osgi.util.NLS;
67
import org.eclipse.osgi.util.NLS;
69
import org.eclipse.swt.SWT;
70
import org.eclipse.swt.dnd.Transfer;
68
import org.eclipse.swt.dnd.Transfer;
71
import org.eclipse.swt.dnd.TransferData;
69
import org.eclipse.swt.dnd.TransferData;
72
import org.eclipse.swt.widgets.Shell;
70
import org.eclipse.swt.widgets.Shell;
Lines 439-453 Link Here
439
	}
437
	}
440
438
441
	/**
439
	/**
442
	 * Remove this method when the feature 210642 will be implemented
440
	 * Store Sexy UI preferences at the Viewer level so that it can be reached later by controllers.
443
	 * 
441
	 * 
444
	 * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor#initializeGraphicalViewerContents()
442
	 * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor#initializeGraphicalViewerContents()
445
	 */
443
	 */
446
	@Override
444
	@Override
447
	protected void initializeGraphicalViewerContents() {
445
	protected void initializeGraphicalViewerContents() {
446
		// Sexy UI preferences
447
		getGraphicalViewer().setProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT, EcoreDiagramEditorPlugin.getInstance().getPreferenceStore().getBoolean(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT));
448
		getGraphicalViewer().setProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER, EcoreDiagramEditorPlugin.getInstance().getPreferenceStore().getBoolean(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER));
448
		super.initializeGraphicalViewerContents();
449
		super.initializeGraphicalViewerContents();
449
		// Scroll-wheel Zoom
450
		getGraphicalViewer().setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON);
451
	}
450
	}
452
451
453
	@Override
452
	@Override
(-)custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/AlphaResizableShapeEditPolicy.java (+40 lines)
Added Link Here
1
/***********************************************************************
2
 * Copyright (c) 2008 Anyware Technologies
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 * 
9
 * Contributors:
10
 *    Simon Bernard (Anyware Technologies) - initial API and implementation
11
 *
12
 * $Id$
13
 **********************************************************************/
14
package org.eclipse.emf.ecoretools.diagram.edit.policies;
15
16
import org.eclipse.draw2d.IFigure;
17
import org.eclipse.draw2d.RectangleFigure;
18
import org.eclipse.emf.ecoretools.diagram.edit.figures.GhostRectangleFigure;
19
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy;
20
21
/**
22
 * ResizableShapeEditPolicy which draw rectangle feedback with alpha property
23
 * instead of XOR<br>
24
 * Useful to have a best display with gradient figure <br>
25
 * creation : 17 mai. 08
26
 * 
27
 * @author <a href="mailto:simon.bernard@anyware-tech.com">Simon Bernard</a>
28
 */
29
public class AlphaResizableShapeEditPolicy extends ResizableShapeEditPolicy {
30
31
	@Override
32
	protected IFigure createDragSourceFeedbackFigure() {
33
		// Use a ghost rectangle for feedback
34
		RectangleFigure r = new GhostRectangleFigure();
35
		r.setBounds(getInitialFeedbackBounds());
36
		addFeedback(r);
37
		return r;
38
	}
39
40
}
(-)custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/AlphaXYLayoutEditPolicy.java (+38 lines)
Added Link Here
1
/***********************************************************************
2
 * Copyright (c) 2008 Anyware Technologies
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 * 
9
 * Contributors:
10
 *    Simon Bernard (Anyware Technologies) - initial API and implementation
11
 *
12
 * $Id$
13
 **********************************************************************/
14
package org.eclipse.emf.ecoretools.diagram.edit.policies;
15
16
import org.eclipse.draw2d.IFigure;
17
import org.eclipse.emf.ecoretools.diagram.edit.figures.GhostRectangleFigure;
18
import org.eclipse.gef.requests.CreateRequest;
19
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy;
20
21
/**
22
 * XYLayoutEditPolicy which draw rectangle feedback with alpha property instead
23
 * of XOR<br>
24
 * Useful to have a best display with gradient figure <br>
25
 * creation : 17 mai. 08
26
 * 
27
 * @author <a href="mailto:simon.bernard@anyware-tech.com">Simon Bernard</a>
28
 */
29
public class AlphaXYLayoutEditPolicy extends XYLayoutEditPolicy {
30
31
	@Override
32
	protected IFigure createSizeOnDropFeedback(CreateRequest createRequest) {
33
		GhostRectangleFigure feedack = new GhostRectangleFigure();
34
		addFeedback(feedack);
35
		return feedack;
36
	}
37
38
}
(-)custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/AlphaDropShadowBorder.java (+103 lines)
Added Link Here
1
/***********************************************************************
2
 * Copyright (c) 2008 Anyware Technologies
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 * 
9
 * Contributors:
10
 *    Simon Bernard (Anyware Technologies) - initial API and implementation
11
 *
12
 * $Id$
13
 **********************************************************************/
14
package org.eclipse.emf.ecoretools.diagram.edit.figures;
15
16
import org.eclipse.draw2d.AbstractBackground;
17
import org.eclipse.draw2d.Graphics;
18
import org.eclipse.draw2d.IFigure;
19
import org.eclipse.draw2d.geometry.Insets;
20
import org.eclipse.draw2d.geometry.PointList;
21
import org.eclipse.draw2d.geometry.Rectangle;
22
import org.eclipse.gmf.runtime.diagram.ui.figures.DiagramColorConstants;
23
import org.eclipse.gmf.runtime.draw2d.ui.figures.DropShadowBorder;
24
import org.eclipse.gmf.runtime.draw2d.ui.figures.IPolygonAnchorableFigure;
25
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
26
import org.eclipse.swt.graphics.Color;
27
28
/**
29
 * A border using a shadow<br>
30
 * creation : 17 mai. 08
31
 * 
32
 * @author <a href="mailto:simon.bernard@anyware-tech.com">Simon Bernard</a>
33
 */
34
public class AlphaDropShadowBorder extends AbstractBackground implements DropShadowBorder {
35
36
	private static final int DEFAULT_SHIFT_VALUE = 1;
37
38
	private static final Color SHADOW_COLOR = DiagramColorConstants.diagramDarkGray;
39
40
	private static final int DEFAULT_TRANSPARENCY = 65;
41
42
	private boolean shouldDrawShadow = true;
43
44
	private int shift = DEFAULT_SHIFT_VALUE;
45
46
	public void setShouldDrawDropShadow(boolean drawDropShadow) {
47
		shouldDrawShadow = drawDropShadow;
48
	}
49
50
	public boolean shouldDrawDropShadow() {
51
		return shouldDrawShadow;
52
	}
53
54
	/**
55
	 * Method for determining the inset the border will take up on the shape.
56
	 * 
57
	 * @param figure
58
	 *            Figure that will be inset from the border
59
	 * @return Insets the Insets for the border on the given figure.
60
	 */
61
	public Insets getInsets(IFigure figure) {
62
		Insets insetsNew = new Insets();
63
		insetsNew.top = 0;
64
		insetsNew.left = 0;
65
		insetsNew.bottom = MapModeUtil.getMapMode(figure).DPtoLP(shift * 2);
66
		insetsNew.right = MapModeUtil.getMapMode(figure).DPtoLP(shift * 2);
67
		return insetsNew;
68
	}
69
70
	public Insets getTransparentInsets(IFigure figure) {
71
		Insets insetsNew = new Insets();
72
		insetsNew.top = 0;
73
		insetsNew.left = 0;
74
		insetsNew.bottom = MapModeUtil.getMapMode(figure).DPtoLP(shift * 2);
75
		insetsNew.right = MapModeUtil.getMapMode(figure).DPtoLP(shift * 2);
76
		return insetsNew;
77
	}
78
79
	@Override
80
	public void paintBackground(IFigure figure, Graphics graphics, Insets insets) {
81
		if (shouldDrawDropShadow()) {
82
			graphics.pushState();
83
			graphics.setBackgroundColor(SHADOW_COLOR);
84
			graphics.setAlpha(DEFAULT_TRANSPARENCY);
85
86
			if (figure instanceof IPolygonAnchorableFigure) {
87
				PointList polygonPoints = ((IPolygonAnchorableFigure) figure).getPolygonPoints();
88
				polygonPoints.translate(shift, shift);
89
				graphics.fillPolygon(polygonPoints);
90
				polygonPoints.translate(shift, shift);
91
				graphics.fillPolygon(polygonPoints);
92
			} else {
93
				Rectangle bounds = figure.getBounds().getCopy();
94
				bounds.translate(shift, shift);
95
				graphics.fillRoundRectangle(bounds, 0, 0);
96
				bounds.translate(shift, shift);
97
				graphics.fillRoundRectangle(bounds, 0, 0);
98
			}
99
100
			graphics.popState();
101
		}
102
	}
103
}
(-)custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/GhostRectangleFigure.java (+42 lines)
Added Link Here
1
/***********************************************************************
2
 * Copyright (c) 2008 Anyware Technologies
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 * 
9
 * Contributors:
10
 *    Simon Bernard (Anyware Technologies) - initial API and implementation
11
 *
12
 * $Id$
13
 **********************************************************************/
14
package org.eclipse.emf.ecoretools.diagram.edit.figures;
15
16
import org.eclipse.draw2d.Graphics;
17
import org.eclipse.draw2d.RectangleFigure;
18
import org.eclipse.gmf.runtime.diagram.ui.figures.DiagramColorConstants;
19
20
/**
21
 * A "ghost" rectangleFigure <br>
22
 * Useful for feedback on figures which use gradient <br>
23
 * creation : 17 mai. 08
24
 * 
25
 * @author <a href="mailto:simon.bernard@anyware-tech.com">Simon Bernard</a>
26
 */
27
public class GhostRectangleFigure extends RectangleFigure {
28
29
	public GhostRectangleFigure() {
30
		setBackgroundColor(DiagramColorConstants.diagramGray);
31
		setForegroundColor(DiagramColorConstants.black);
32
		setLineStyle(Graphics.LINE_DOT);
33
	}
34
35
	@Override
36
	protected void fillShape(Graphics graphics) {
37
		graphics.pushState();
38
		graphics.setAlpha(125);
39
		super.fillShape(graphics);
40
		graphics.popState();
41
	}
42
}
(-)custom-src/org/eclipse/emf/ecoretools/diagram/preferences/IEcoreToolsPreferenceConstants.java (+31 lines)
Added Link Here
1
/***********************************************************************
2
 * Copyright (c) 2008 Anyware Technologies
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 * 
9
 * Contributors:
10
 *    Jacques Lescot (Anyware Technologies) - initial API and implementation
11
 *
12
 * $Id$
13
 **********************************************************************/
14
package org.eclipse.emf.ecoretools.diagram.preferences;
15
16
/**
17
 * Defines custom preference constants for the Ecore Tools graphical editor
18
 * <p>
19
 * This interface defines constants only, it is <EM>not</EM> intended to be implemented by clients.
20
 * </p>
21
 * 
22
 * @author Jacques Lescot
23
 */
24
public interface IEcoreToolsPreferenceConstants {
25
26
	/** use Gradient to render figures - Appearance Preference */
27
	public static final String PREF_FILL_FIGURE_USING_GRADIENT = "Appearance.fillFigureUsingGradient"; //$NON-NLS-1$
28
29
	/** use Shadow on borders when rendering figures - Appearance Preference */
30
	public static final String PREF_USE_SHADOW_ON_BORDER = "Appearance.useShadowOnBorder"; //$NON-NLS-1$
31
}
(-)custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/GradientRectangleFigure.java (+63 lines)
Added Link Here
1
/***********************************************************************
2
 * Copyright (c) 2008 Anyware Technologies
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 * 
9
 * Contributors:
10
 *    Simon Bernard (Anyware Technologies) - initial API and implementation
11
 *
12
 * $Id$
13
 **********************************************************************/
14
package org.eclipse.emf.ecoretools.diagram.edit.figures;
15
16
import org.eclipse.draw2d.Graphics;
17
import org.eclipse.draw2d.RectangleFigure;
18
import org.eclipse.gmf.runtime.diagram.ui.figures.DiagramColorConstants;
19
20
/**
21
 * A Rectangle which is draw with gradient property<br>
22
 * creation : 17 mai. 08
23
 * 
24
 * @author <a href="mailto:simon.bernard@anyware-tech.com">Simon Bernard</a>
25
 */
26
public class GradientRectangleFigure extends RectangleFigure {
27
28
	private boolean useGradient = true;
29
	
30
	/**
31
	 * Sets whether the gradient should be used when rendering the figure
32
	 * 
33
	 * @param drawDropShadow 
34
	 */
35
	public void setShouldUseGradient(boolean shouldUseGradient) {
36
		this.useGradient = shouldUseGradient;
37
	}
38
	
39
	/**
40
	 * @return true if gradient should be used when rendering the figure
41
	 */
42
	public boolean shouldUseGradient() {
43
		return useGradient;
44
	}
45
	
46
	@Override
47
	protected void fillShape(Graphics graphics) {
48
		if (shouldUseGradient()) {
49
			graphics.pushState();
50
			graphics.setBackgroundColor(DiagramColorConstants.white);
51
			graphics.setForegroundColor(getBackgroundColor());
52
			graphics.fillGradient(getBounds(), true);
53
			graphics.popState();
54
		} else {
55
			super.fillShape(graphics);
56
		}
57
	}
58
59
	@Override
60
	protected void outlineShape(Graphics graphics) {
61
		super.outlineShape(graphics);
62
	}
63
}

Return to bug 235303