EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcm.gmf.usage.edit.parts]

COVERAGE SUMMARY FOR SOURCE FILE [UsageScenario2EditPart.java]

nameclass, %method, %block, %line, %
UsageScenario2EditPart.java0%   (0/3)0%   (0/29)0%   (0/318)0%   (0/92)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class UsageScenario2EditPart0%   (0/1)0%   (0/20)0%   (0/178)0%   (0/61)
UsageScenario2EditPart (View): void 0%   (0/1)0%   (0/4)0%   (0/2)
access$0 (UsageScenario2EditPart): IMapMode 0%   (0/1)0%   (0/3)0%   (0/1)
addChildVisual (EditPart, int): void 0%   (0/1)0%   (0/10)0%   (0/4)
addFixedChild (EditPart): boolean 0%   (0/1)0%   (0/13)0%   (0/6)
createDefaultEditPolicies (): void 0%   (0/1)0%   (0/14)0%   (0/5)
createLayoutEditPolicy (): LayoutEditPolicy 0%   (0/1)0%   (0/7)0%   (0/2)
createNodeFigure (): NodeFigure 0%   (0/1)0%   (0/21)0%   (0/6)
createNodePlate (): NodeFigure 0%   (0/1)0%   (0/8)0%   (0/2)
createNodeShape (): IFigure 0%   (0/1)0%   (0/10)0%   (0/2)
getContentPane (): IFigure 0%   (0/1)0%   (0/9)0%   (0/3)
getContentPaneFor (IGraphicalEditPart): IFigure 0%   (0/1)0%   (0/3)0%   (0/1)
getPrimaryChildEditPart (): EditPart 0%   (0/1)0%   (0/5)0%   (0/2)
getPrimaryShape (): UsageScenario2EditPart$UsageScenarioFigure 0%   (0/1)0%   (0/4)0%   (0/1)
removeChildVisual (EditPart): void 0%   (0/1)0%   (0/9)0%   (0/4)
removeFixedChild (EditPart): boolean 0%   (0/1)0%   (0/7)0%   (0/3)
setBackgroundColor (Color): void 0%   (0/1)0%   (0/8)0%   (0/3)
setForegroundColor (Color): void 0%   (0/1)0%   (0/8)0%   (0/3)
setLineType (int): void 0%   (0/1)0%   (0/10)0%   (0/3)
setLineWidth (int): void 0%   (0/1)0%   (0/10)0%   (0/3)
setupContentPane (IFigure): IFigure 0%   (0/1)0%   (0/15)0%   (0/5)
     
class UsageScenario2EditPart$10%   (0/1)0%   (0/4)0%   (0/22)0%   (0/9)
UsageScenario2EditPart$1 (UsageScenario2EditPart): void 0%   (0/1)0%   (0/6)0%   (0/2)
createChildEditPolicy (EditPart): EditPolicy 0%   (0/1)0%   (0/12)0%   (0/5)
getCreateCommand (CreateRequest): Command 0%   (0/1)0%   (0/2)0%   (0/1)
getMoveChildrenCommand (Request): Command 0%   (0/1)0%   (0/2)0%   (0/1)
     
class UsageScenario2EditPart$UsageScenarioFigure0%   (0/1)0%   (0/5)0%   (0/118)0%   (0/24)
UsageScenario2EditPart$UsageScenarioFigure (UsageScenario2EditPart): void 0%   (0/1)0%   (0/62)0%   (0/12)
createContents (): void 0%   (0/1)0%   (0/46)0%   (0/8)
getFigureUsageScenarioLabelName (): WrappingLabel 0%   (0/1)0%   (0/3)0%   (0/1)
setUseLocalCoordinates (boolean): void 0%   (0/1)0%   (0/4)0%   (0/2)
useLocalCoordinates (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)

1/*
2 * Copyright 2007, SDQ, IPD, University of Karlsruhe
3 */
4package de.uka.ipd.sdq.pcm.gmf.usage.edit.parts;
5 
6import org.eclipse.draw2d.ColorConstants;
7import org.eclipse.draw2d.CompoundBorder;
8import org.eclipse.draw2d.IFigure;
9import org.eclipse.draw2d.LineBorder;
10import org.eclipse.draw2d.MarginBorder;
11import org.eclipse.draw2d.RectangleFigure;
12import org.eclipse.draw2d.Shape;
13import org.eclipse.draw2d.StackLayout;
14import org.eclipse.draw2d.geometry.Dimension;
15import org.eclipse.gef.EditPart;
16import org.eclipse.gef.EditPolicy;
17import org.eclipse.gef.Request;
18import org.eclipse.gef.commands.Command;
19import org.eclipse.gef.editpolicies.LayoutEditPolicy;
20import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
21import org.eclipse.gef.requests.CreateRequest;
22import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
23import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
24import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
25import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
26import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
27import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
28import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
29import org.eclipse.gmf.runtime.notation.View;
30import org.eclipse.swt.graphics.Color;
31 
32import de.uka.ipd.sdq.pcm.gmf.usage.edit.policies.UsageScenario2ItemSemanticEditPolicy;
33import de.uka.ipd.sdq.pcm.gmf.usage.part.PalladioComponentModelVisualIDRegistry;
34 
35/**
36 * @generated
37 */
38public class UsageScenario2EditPart extends ShapeNodeEditPart {
39 
40        /**
41         * @generated
42         */
43        public static final int VISUAL_ID = 2004;
44 
45        /**
46         * @generated
47         */
48        protected IFigure contentPane;
49 
50        /**
51         * @generated
52         */
53        protected IFigure primaryShape;
54 
55        /**
56         * @generated
57         */
58        public UsageScenario2EditPart(View view) {
59                super(view);
60        }
61 
62        /**
63         * @generated
64         */
65        protected void createDefaultEditPolicies() {
66                super.createDefaultEditPolicies();
67                installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
68                                new UsageScenario2ItemSemanticEditPolicy());
69                installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
70                // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
71                // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
72        }
73 
74        /**
75         * @generated
76         */
77        protected LayoutEditPolicy createLayoutEditPolicy() {
78                LayoutEditPolicy lep = new LayoutEditPolicy() {
79 
80                        protected EditPolicy createChildEditPolicy(EditPart child) {
81                                EditPolicy result = child
82                                                .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
83                                if (result == null) {
84                                        result = new NonResizableEditPolicy();
85                                }
86                                return result;
87                        }
88 
89                        protected Command getMoveChildrenCommand(Request request) {
90                                return null;
91                        }
92 
93                        protected Command getCreateCommand(CreateRequest request) {
94                                return null;
95                        }
96                };
97                return lep;
98        }
99 
100        /**
101         * @generated
102         */
103        protected IFigure createNodeShape() {
104                UsageScenarioFigure figure = new UsageScenarioFigure();
105                return primaryShape = figure;
106        }
107 
108        /**
109         * @generated
110         */
111        public UsageScenarioFigure getPrimaryShape() {
112                return (UsageScenarioFigure) primaryShape;
113        }
114 
115        /**
116         * @generated
117         */
118        protected boolean addFixedChild(EditPart childEditPart) {
119                if (childEditPart instanceof UsageScenarioLabelEditPart) {
120                        ((UsageScenarioLabelEditPart) childEditPart)
121                                        .setLabel(getPrimaryShape()
122                                                        .getFigureUsageScenarioLabelName());
123                        return true;
124                }
125                return false;
126        }
127 
128        /**
129         * @generated
130         */
131        protected boolean removeFixedChild(EditPart childEditPart) {
132                if (childEditPart instanceof UsageScenarioLabelEditPart) {
133                        return true;
134                }
135                return false;
136        }
137 
138        /**
139         * @generated
140         */
141        protected void addChildVisual(EditPart childEditPart, int index) {
142                if (addFixedChild(childEditPart)) {
143                        return;
144                }
145                super.addChildVisual(childEditPart, -1);
146        }
147 
148        /**
149         * @generated
150         */
151        protected void removeChildVisual(EditPart childEditPart) {
152                if (removeFixedChild(childEditPart)) {
153                        return;
154                }
155                super.removeChildVisual(childEditPart);
156        }
157 
158        /**
159         * @generated
160         */
161        protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
162                return getContentPane();
163        }
164 
165        /**
166         * @generated
167         */
168        protected NodeFigure createNodePlate() {
169                DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
170                return result;
171        }
172 
173        /**
174         * Creates figure for this edit part.
175         * 
176         * Body of this method does not depend on settings in generation model
177         * so you may safely remove <i>generated</i> tag and modify it.
178         * 
179         * @generated
180         */
181        protected NodeFigure createNodeFigure() {
182                NodeFigure figure = createNodePlate();
183                figure.setLayoutManager(new StackLayout());
184                IFigure shape = createNodeShape();
185                figure.add(shape);
186                contentPane = setupContentPane(shape);
187                return figure;
188        }
189 
190        /**
191         * Default implementation treats passed figure as content pane.
192         * Respects layout one may have set for generated figure.
193         * @param nodeShape instance of generated figure class
194         * @generated
195         */
196        protected IFigure setupContentPane(IFigure nodeShape) {
197                if (nodeShape.getLayoutManager() == null) {
198                        ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
199                        layout.setSpacing(5);
200                        nodeShape.setLayoutManager(layout);
201                }
202                return nodeShape; // use nodeShape itself as contentPane
203        }
204 
205        /**
206         * @generated
207         */
208        public IFigure getContentPane() {
209                if (contentPane != null) {
210                        return contentPane;
211                }
212                return super.getContentPane();
213        }
214 
215        /**
216         * @generated
217         */
218        protected void setForegroundColor(Color color) {
219                if (primaryShape != null) {
220                        primaryShape.setForegroundColor(color);
221                }
222        }
223 
224        /**
225         * @generated
226         */
227        protected void setBackgroundColor(Color color) {
228                if (primaryShape != null) {
229                        primaryShape.setBackgroundColor(color);
230                }
231        }
232 
233        /**
234         * @generated
235         */
236        protected void setLineWidth(int width) {
237                if (primaryShape instanceof Shape) {
238                        ((Shape) primaryShape).setLineWidth(width);
239                }
240        }
241 
242        /**
243         * @generated
244         */
245        protected void setLineType(int style) {
246                if (primaryShape instanceof Shape) {
247                        ((Shape) primaryShape).setLineStyle(style);
248                }
249        }
250 
251        /**
252         * @generated
253         */
254        public EditPart getPrimaryChildEditPart() {
255                return getChildBySemanticHint(PalladioComponentModelVisualIDRegistry
256                                .getType(UsageScenarioLabelEditPart.VISUAL_ID));
257        }
258 
259        /**
260         * @generated
261         */
262        public class UsageScenarioFigure extends RectangleFigure {
263 
264                /**
265                 * @generated
266                 */
267                private WrappingLabel fFigureUsageScenarioLabelName;
268 
269                /**
270                 * @generated
271                 */
272                public UsageScenarioFigure() {
273                        this.setLineWidth(1);
274                        this.setForegroundColor(ColorConstants.lightGray);
275                        this.setMinimumSize(new Dimension(getMapMode().DPtoLP(0),
276                                        getMapMode().DPtoLP(0)));
277                        this.setBorder(new CompoundBorder(new LineBorder(null, getMapMode()
278                                        .DPtoLP(3)), new MarginBorder(getMapMode().DPtoLP(4),
279                                        getMapMode().DPtoLP(4), getMapMode().DPtoLP(4),
280                                        getMapMode().DPtoLP(4))));
281                        createContents();
282                }
283 
284                /**
285                 * @generated
286                 */
287                private void createContents() {
288 
289                        fFigureUsageScenarioLabelName = new WrappingLabel();
290                        fFigureUsageScenarioLabelName.setText("");
291                        fFigureUsageScenarioLabelName.setMaximumSize(new Dimension(
292                                        getMapMode().DPtoLP(300), getMapMode().DPtoLP(40)));
293                        fFigureUsageScenarioLabelName.setMinimumSize(new Dimension(
294                                        getMapMode().DPtoLP(30), getMapMode().DPtoLP(40)));
295 
296                        this.add(fFigureUsageScenarioLabelName);
297 
298                }
299 
300                /**
301                 * @generated
302                 */
303                private boolean myUseLocalCoordinates = false;
304 
305                /**
306                 * @generated
307                 */
308                protected boolean useLocalCoordinates() {
309                        return myUseLocalCoordinates;
310                }
311 
312                /**
313                 * @generated
314                 */
315                protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
316                        myUseLocalCoordinates = useLocalCoordinates;
317                }
318 
319                /**
320                 * @generated
321                 */
322                public WrappingLabel getFigureUsageScenarioLabelName() {
323                        return fFigureUsageScenarioLabelName;
324                }
325 
326        }
327 
328}

[all classes][de.uka.ipd.sdq.pcm.gmf.usage.edit.parts]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov