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 ProvidedRoleEntityNameViewFactory extends AbstractLabelViewFactory { |
23 | |
24 | /** |
25 | * @generated |
26 | */ |
27 | public View createView(IAdaptable semanticAdapter, View containerView, |
28 | String semanticHint, int index, boolean persisted, |
29 | PreferencesHint preferencesHint) { |
30 | Node view = (Node) super.createView(semanticAdapter, containerView, |
31 | semanticHint, index, persisted, preferencesHint); |
32 | Location location = (Location) view.getLayoutConstraint(); |
33 | IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView |
34 | .getDiagram().getMeasurementUnit()); |
35 | location.setX(mapMode.DPtoLP(0)); |
36 | location.setY(mapMode.DPtoLP(5)); |
37 | return view; |
38 | } |
39 | |
40 | /** |
41 | * @generated |
42 | */ |
43 | protected List createStyles(View view) { |
44 | List styles = new ArrayList(); |
45 | return styles; |
46 | } |
47 | } |