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

nameclass, %method, %block, %line, %
AllocationContextEditPart.java0%   (0/3)0%   (0/27)0%   (0/254)0%   (0/87)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AllocationContextEditPart0%   (0/1)0%   (0/15)0%   (0/155)0%   (0/51)
AllocationContextEditPart (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/24)0%   (0/10)
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 (): AllocationContextEditPart$AllocationContextFigure 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 AllocationContextEditPart$10%   (0/1)0%   (0/4)0%   (0/22)0%   (0/9)
AllocationContextEditPart$1 (AllocationContextEditPart): 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 AllocationContextEditPart$AllocationContextFigure0%   (0/1)0%   (0/8)0%   (0/77)0%   (0/28)
AllocationContextEditPart$AllocationContextFigure (AllocationContextEditPart)... 0%   (0/1)0%   (0/29)0%   (0/10)
createContents (): void 0%   (0/1)0%   (0/27)0%   (0/9)
getFigureAllocationComponentLabelFigure (): WrapLabel 0%   (0/1)0%   (0/3)0%   (0/1)
getFigureAllocationNameFigure (): WrapLabel 0%   (0/1)0%   (0/3)0%   (0/1)
setFigureAllocationComponentLabelFigure (WrapLabel): void 0%   (0/1)0%   (0/4)0%   (0/2)
setFigureAllocationNameFigure (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.AllocationContextItemSemanticEditPolicy;
27import de.uka.ipd.sdq.pcm.gmf.allocation.part.PalladioComponentModelVisualIDRegistry;
28 
29/**
30 * @generated
31 */
32public class AllocationContextEditPart extends ShapeNodeEditPart {
33 
34        /**
35         * @generated
36         */
37        public static final int VISUAL_ID = 3001;
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 AllocationContextEditPart(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 AllocationContextItemSemanticEditPolicy());
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                AllocationContextFigure figure = new AllocationContextFigure();
99                return primaryShape = figure;
100        }
101 
102        /**
103         * @generated
104         */
105        public AllocationContextFigure getPrimaryShape() {
106                return (AllocationContextFigure) primaryShape;
107        }
108 
109        /**
110         * @generated
111         */
112        protected boolean addFixedChild(EditPart childEditPart) {
113                if (childEditPart instanceof AllocationContextEntityNameEditPart) {
114                        ((AllocationContextEntityNameEditPart) childEditPart)
115                                        .setLabel(getPrimaryShape().getFigureAllocationNameFigure());
116                        return true;
117                }
118                if (childEditPart instanceof AllocationComponentLabelEditPart) {
119                        ((AllocationComponentLabelEditPart) childEditPart)
120                                        .setLabel(getPrimaryShape()
121                                                        .getFigureAllocationComponentLabelFigure());
122                        return true;
123                }
124                return false;
125        }
126 
127        /**
128         * @generated
129         */
130        protected boolean removeFixedChild(EditPart childEditPart) {
131 
132                return false;
133        }
134 
135        /**
136         * @generated
137         */
138        protected void addChildVisual(EditPart childEditPart, int index) {
139                if (addFixedChild(childEditPart)) {
140                        return;
141                }
142                super.addChildVisual(childEditPart, -1);
143        }
144 
145        /**
146         * @generated
147         */
148        protected void removeChildVisual(EditPart childEditPart) {
149                if (removeFixedChild(childEditPart)) {
150                        return;
151                }
152                super.removeChildVisual(childEditPart);
153        }
154 
155        /**
156         * @generated
157         */
158        protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
159 
160                return super.getContentPaneFor(editPart);
161        }
162 
163        /**
164         * @generated
165         */
166        protected NodeFigure createNodePlate() {
167                DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode()
168                                .DPtoLP(40), getMapMode().DPtoLP(40));
169                return result;
170        }
171 
172        /**
173         * Creates figure for this edit part.
174         * 
175         * Body of this method does not depend on settings in generation model
176         * so you may safely remove <i>generated</i> tag and modify it.
177         * 
178         * @generated
179         */
180        protected NodeFigure createNodeFigure() {
181                NodeFigure figure = createNodePlate();
182                figure.setLayoutManager(new StackLayout());
183                IFigure shape = createNodeShape();
184                figure.add(shape);
185                contentPane = setupContentPane(shape);
186                return figure;
187        }
188 
189        /**
190         * Default implementation treats passed figure as content pane.
191         * Respects layout one may have set for generated figure.
192         * @param nodeShape instance of generated figure class
193         * @generated
194         */
195        protected IFigure setupContentPane(IFigure nodeShape) {
196                if (nodeShape.getLayoutManager() == null) {
197                        ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
198                        layout.setSpacing(getMapMode().DPtoLP(5));
199                        nodeShape.setLayoutManager(layout);
200                }
201                return nodeShape; // use nodeShape itself as contentPane
202        }
203 
204        /**
205         * @generated
206         */
207        public IFigure getContentPane() {
208                if (contentPane != null) {
209                        return contentPane;
210                }
211                return super.getContentPane();
212        }
213 
214        /**
215         * @generated
216         */
217        public EditPart getPrimaryChildEditPart() {
218                return getChildBySemanticHint(PalladioComponentModelVisualIDRegistry
219                                .getType(AllocationContextEntityNameEditPart.VISUAL_ID));
220        }
221 
222        /**
223         * @generated
224         */
225        public class AllocationContextFigure extends RectangleFigure {
226                /**
227                 * @generated
228                 */
229                public AllocationContextFigure() {
230                        this.setFill(true);
231                        this.setFillXOR(false);
232                        this.setOutline(true);
233                        this.setOutlineXOR(false);
234                        this.setLineWidth(1);
235                        this.setLineStyle(Graphics.LINE_SOLID);
236                        createContents();
237                }
238 
239                /**
240                 * @generated
241                 */
242                private void createContents() {
243 
244                        WrapLabel allocationNameFigure0 = new PcmWrapLabel();
245                        allocationNameFigure0.setText("<...>");
246 
247                        this.add(allocationNameFigure0);
248                        setFigureAllocationNameFigure(allocationNameFigure0);
249 
250                        WrapLabel allocationComponentLabelFigure0 = new PcmWrapLabel();
251                        allocationComponentLabelFigure0.setText("");
252 
253                        this.add(allocationComponentLabelFigure0);
254                        setFigureAllocationComponentLabelFigure(allocationComponentLabelFigure0);
255 
256                }
257 
258                /**
259                 * @generated
260                 */
261                private WrapLabel fAllocationNameFigure;
262 
263                /**
264                 * @generated
265                 */
266                public WrapLabel getFigureAllocationNameFigure() {
267                        return fAllocationNameFigure;
268                }
269 
270                /**
271                 * @generated
272                 */
273                private void setFigureAllocationNameFigure(WrapLabel fig) {
274                        fAllocationNameFigure = fig;
275                }
276 
277                /**
278                 * @generated
279                 */
280                private WrapLabel fAllocationComponentLabelFigure;
281 
282                /**
283                 * @generated
284                 */
285                public WrapLabel getFigureAllocationComponentLabelFigure() {
286                        return fAllocationComponentLabelFigure;
287                }
288 
289                /**
290                 * @generated
291                 */
292                private void setFigureAllocationComponentLabelFigure(WrapLabel fig) {
293                        fAllocationComponentLabelFigure = fig;
294                }
295 
296                /**
297                 * @generated
298                 */
299                private boolean myUseLocalCoordinates = false;
300 
301                /**
302                 * @generated
303                 */
304                protected boolean useLocalCoordinates() {
305                        return myUseLocalCoordinates;
306                }
307 
308                /**
309                 * @generated
310                 */
311                protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
312                        myUseLocalCoordinates = useLocalCoordinates;
313                }
314 
315        }
316 
317}

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