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

nameclass, %method, %block, %line, %
StopEditPart.java0%   (0/3)0%   (0/28)0%   (0/405)0%   (0/128)

COVERAGE BREAKDOWN BY CLASS AND METHOD

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

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