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

COVERAGE SUMMARY FOR SOURCE FILE [ResourceContainerEditPart.java]

nameclass, %method, %block, %line, %
ResourceContainerEditPart.java0%   (0/3)0%   (0/25)0%   (0/223)0%   (0/76)

COVERAGE BREAKDOWN BY CLASS AND METHOD

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

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