1 | /* |
2 | *Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH) |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.composite.view.factories; |
5 | |
6 | import java.util.ArrayList; |
7 | import java.util.List; |
8 | import org.eclipse.core.runtime.IAdaptable; |
9 | import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; |
10 | import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory; |
11 | import org.eclipse.gmf.runtime.notation.Node; |
12 | import org.eclipse.gmf.runtime.notation.View; |
13 | import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper; |
14 | |
15 | import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode; |
16 | |
17 | import org.eclipse.gmf.runtime.notation.Location; |
18 | |
19 | /** |
20 | * @generated |
21 | */ |
22 | public class RequiredRoleEntityName2ViewFactory extends |
23 | AbstractLabelViewFactory { |
24 | |
25 | /** |
26 | * @generated |
27 | */ |
28 | public View createView(IAdaptable semanticAdapter, View containerView, |
29 | String semanticHint, int index, boolean persisted, |
30 | PreferencesHint preferencesHint) { |
31 | Node view = (Node) super.createView(semanticAdapter, containerView, |
32 | semanticHint, index, persisted, preferencesHint); |
33 | Location location = (Location) view.getLayoutConstraint(); |
34 | IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView |
35 | .getDiagram().getMeasurementUnit()); |
36 | location.setX(mapMode.DPtoLP(0)); |
37 | location.setY(mapMode.DPtoLP(5)); |
38 | return view; |
39 | } |
40 | |
41 | /** |
42 | * @generated |
43 | */ |
44 | protected List createStyles(View view) { |
45 | List styles = new ArrayList(); |
46 | return styles; |
47 | } |
48 | } |