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 [StartEditPart.java]

nameclass, %method, %block, %line, %
StartEditPart.java0%   (0/3)0%   (0/27)0%   (0/366)0%   (0/119)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StartEditPart0%   (0/1)0%   (0/20)0%   (0/296)0%   (0/100)
StartEditPart (View): void 0%   (0/1)0%   (0/4)0%   (0/2)
access$0 (StartEditPart): IMapMode 0%   (0/1)0%   (0/3)0%   (0/1)
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)
getMARelTypesOnSource (): List 0%   (0/1)0%   (0/10)0%   (0/4)
getMARelTypesOnSourceAndTarget (IGraphicalEditPart): List 0%   (0/1)0%   (0/48)0%   (0/20)
getMARelTypesOnTarget (): List 0%   (0/1)0%   (0/10)0%   (0/4)
getMATypesForSource (IElementType): List 0%   (0/1)0%   (0/48)0%   (0/15)
getMATypesForTarget (IElementType): List 0%   (0/1)0%   (0/48)0%   (0/15)
getPrimaryDragEditPolicy (): EditPolicy 0%   (0/1)0%   (0/14)0%   (0/5)
getPrimaryShape (): StartEditPart$StartFigure 0%   (0/1)0%   (0/4)0%   (0/1)
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/2)0%   (0/1)
     
class StartEditPart$10%   (0/1)0%   (0/4)0%   (0/22)0%   (0/9)
StartEditPart$1 (StartEditPart): 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 StartEditPart$StartFigure0%   (0/1)0%   (0/3)0%   (0/48)0%   (0/12)
StartEditPart$StartFigure (StartEditPart): void 0%   (0/1)0%   (0/41)0%   (0/9)
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 java.util.ArrayList;
7import java.util.List;
8 
9import org.eclipse.draw2d.ColorConstants;
10import org.eclipse.draw2d.Ellipse;
11import org.eclipse.draw2d.IFigure;
12import org.eclipse.draw2d.PositionConstants;
13import org.eclipse.draw2d.Shape;
14import org.eclipse.draw2d.StackLayout;
15import org.eclipse.draw2d.geometry.Dimension;
16import org.eclipse.gef.EditPart;
17import org.eclipse.gef.EditPolicy;
18import org.eclipse.gef.Request;
19import org.eclipse.gef.commands.Command;
20import org.eclipse.gef.editpolicies.LayoutEditPolicy;
21import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
22import org.eclipse.gef.editpolicies.ResizableEditPolicy;
23import org.eclipse.gef.requests.CreateRequest;
24import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
25import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
26import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
27import org.eclipse.gmf.runtime.emf.type.core.IElementType;
28import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
29import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
30import org.eclipse.gmf.runtime.notation.View;
31import org.eclipse.swt.graphics.Color;
32 
33import de.uka.ipd.sdq.pcm.gmf.usage.edit.policies.StartItemSemanticEditPolicy;
34import de.uka.ipd.sdq.pcm.gmf.usage.providers.PalladioComponentModelElementTypes;
35 
36/**
37 * @generated
38 */
39public class StartEditPart extends ShapeNodeEditPart {
40 
41        /**
42         * @generated
43         */
44        public static final int VISUAL_ID = 3001;
45 
46        /**
47         * @generated
48         */
49        protected IFigure contentPane;
50 
51        /**
52         * @generated
53         */
54        protected IFigure primaryShape;
55 
56        /**
57         * @generated
58         */
59        public StartEditPart(View view) {
60                super(view);
61        }
62 
63        /**
64         * @generated
65         */
66        protected void createDefaultEditPolicies() {
67                super.createDefaultEditPolicies();
68                installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
69                                new StartItemSemanticEditPolicy());
70                installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
71                // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
72                // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
73        }
74 
75        /**
76         * @generated
77         */
78        protected LayoutEditPolicy createLayoutEditPolicy() {
79                LayoutEditPolicy lep = new LayoutEditPolicy() {
80 
81                        protected EditPolicy createChildEditPolicy(EditPart child) {
82                                EditPolicy result = child
83                                                .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
84                                if (result == null) {
85                                        result = new NonResizableEditPolicy();
86                                }
87                                return result;
88                        }
89 
90                        protected Command getMoveChildrenCommand(Request request) {
91                                return null;
92                        }
93 
94                        protected Command getCreateCommand(CreateRequest request) {
95                                return null;
96                        }
97                };
98                return lep;
99        }
100 
101        /**
102         * @generated
103         */
104        protected IFigure createNodeShape() {
105                StartFigure figure = new StartFigure();
106                return primaryShape = figure;
107        }
108 
109        /**
110         * @generated
111         */
112        public StartFigure getPrimaryShape() {
113                return (StartFigure) primaryShape;
114        }
115 
116        /**
117         * @generated
118         */
119        protected NodeFigure createNodePlate() {
120                DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(20, 20);
121                return result;
122        }
123 
124        /**
125         * @generated
126         */
127        public EditPolicy getPrimaryDragEditPolicy() {
128                EditPolicy result = super.getPrimaryDragEditPolicy();
129                if (result instanceof ResizableEditPolicy) {
130                        ResizableEditPolicy ep = (ResizableEditPolicy) result;
131                        ep.setResizeDirections(PositionConstants.NONE);
132                }
133                return result;
134        }
135 
136        /**
137         * Creates figure for this edit part.
138         * 
139         * Body of this method does not depend on settings in generation model
140         * so you may safely remove <i>generated</i> tag and modify it.
141         * 
142         * @generated
143         */
144        protected NodeFigure createNodeFigure() {
145                NodeFigure figure = createNodePlate();
146                figure.setLayoutManager(new StackLayout());
147                IFigure shape = createNodeShape();
148                figure.add(shape);
149                contentPane = setupContentPane(shape);
150                return figure;
151        }
152 
153        /**
154         * Default implementation treats passed figure as content pane.
155         * Respects layout one may have set for generated figure.
156         * @param nodeShape instance of generated figure class
157         * @generated
158         */
159        protected IFigure setupContentPane(IFigure nodeShape) {
160                return nodeShape; // use nodeShape itself as contentPane
161        }
162 
163        /**
164         * @generated
165         */
166        public IFigure getContentPane() {
167                if (contentPane != null) {
168                        return contentPane;
169                }
170                return super.getContentPane();
171        }
172 
173        /**
174         * @generated
175         */
176        protected void setForegroundColor(Color color) {
177                if (primaryShape != null) {
178                        primaryShape.setForegroundColor(color);
179                }
180        }
181 
182        /**
183         * @generated
184         */
185        protected void setBackgroundColor(Color color) {
186                if (primaryShape != null) {
187                        primaryShape.setBackgroundColor(color);
188                }
189        }
190 
191        /**
192         * @generated
193         */
194        protected void setLineWidth(int width) {
195                if (primaryShape instanceof Shape) {
196                        ((Shape) primaryShape).setLineWidth(width);
197                }
198        }
199 
200        /**
201         * @generated
202         */
203        protected void setLineType(int style) {
204                if (primaryShape instanceof Shape) {
205                        ((Shape) primaryShape).setLineStyle(style);
206                }
207        }
208 
209        /**
210         * @generated
211         */
212        public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMARelTypesOnSource() {
213                List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/();
214                types
215                                .add(PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002);
216                return types;
217        }
218 
219        /**
220         * @generated
221         */
222        public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMARelTypesOnSourceAndTarget(
223                        IGraphicalEditPart targetEditPart) {
224                List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/();
225                if (targetEditPart instanceof de.uka.ipd.sdq.pcm.gmf.usage.edit.parts.StartEditPart) {
226                        types
227                                        .add(PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002);
228                }
229                if (targetEditPart instanceof StopEditPart) {
230                        types
231                                        .add(PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002);
232                }
233                if (targetEditPart instanceof EntryLevelSystemCallEditPart) {
234                        types
235                                        .add(PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002);
236                }
237                if (targetEditPart instanceof LoopEditPart) {
238                        types
239                                        .add(PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002);
240                }
241                if (targetEditPart instanceof BranchEditPart) {
242                        types
243                                        .add(PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002);
244                }
245                if (targetEditPart instanceof DelayEditPart) {
246                        types
247                                        .add(PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002);
248                }
249                return types;
250        }
251 
252        /**
253         * @generated
254         */
255        public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMATypesForTarget(
256                        IElementType relationshipType) {
257                List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/();
258                if (relationshipType == PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002) {
259                        types.add(PalladioComponentModelElementTypes.Start_3001);
260                }
261                if (relationshipType == PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002) {
262                        types.add(PalladioComponentModelElementTypes.Stop_3002);
263                }
264                if (relationshipType == PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002) {
265                        types
266                                        .add(PalladioComponentModelElementTypes.EntryLevelSystemCall_3003);
267                }
268                if (relationshipType == PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002) {
269                        types.add(PalladioComponentModelElementTypes.Loop_3005);
270                }
271                if (relationshipType == PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002) {
272                        types.add(PalladioComponentModelElementTypes.Branch_3008);
273                }
274                if (relationshipType == PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002) {
275                        types.add(PalladioComponentModelElementTypes.Delay_3017);
276                }
277                return types;
278        }
279 
280        /**
281         * @generated
282         */
283        public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMARelTypesOnTarget() {
284                List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/();
285                types
286                                .add(PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002);
287                return types;
288        }
289 
290        /**
291         * @generated
292         */
293        public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMATypesForSource(
294                        IElementType relationshipType) {
295                List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/();
296                if (relationshipType == PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002) {
297                        types.add(PalladioComponentModelElementTypes.Start_3001);
298                }
299                if (relationshipType == PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002) {
300                        types.add(PalladioComponentModelElementTypes.Stop_3002);
301                }
302                if (relationshipType == PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002) {
303                        types
304                                        .add(PalladioComponentModelElementTypes.EntryLevelSystemCall_3003);
305                }
306                if (relationshipType == PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002) {
307                        types.add(PalladioComponentModelElementTypes.Loop_3005);
308                }
309                if (relationshipType == PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002) {
310                        types.add(PalladioComponentModelElementTypes.Branch_3008);
311                }
312                if (relationshipType == PalladioComponentModelElementTypes.AbstractUserActionSuccessor_4002) {
313                        types.add(PalladioComponentModelElementTypes.Delay_3017);
314                }
315                return types;
316        }
317 
318        /**
319         * @generated
320         */
321        public class StartFigure extends Ellipse {
322                /**
323                 * @generated
324                 */
325                public StartFigure() {
326                        this.setLineWidth(1);
327                        this.setBackgroundColor(ColorConstants.black);
328                        this.setPreferredSize(new Dimension(getMapMode().DPtoLP(20),
329                                        getMapMode().DPtoLP(20)));
330                        this.setMinimumSize(new Dimension(getMapMode().DPtoLP(0),
331                                        getMapMode().DPtoLP(0)));
332                }
333 
334                /**
335                 * @generated
336                 */
337                private boolean myUseLocalCoordinates = false;
338 
339                /**
340                 * @generated
341                 */
342                protected boolean useLocalCoordinates() {
343                        return myUseLocalCoordinates;
344                }
345 
346                /**
347                 * @generated
348                 */
349                protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
350                        myUseLocalCoordinates = useLocalCoordinates;
351                }
352 
353        }
354 
355}

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