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

COVERAGE SUMMARY FOR SOURCE FILE [ResourceDemandingBehaviour3EditPart.java]

nameclass, %method, %block, %line, %
ResourceDemandingBehaviour3EditPart.java0%   (0/3)0%   (0/22)0%   (0/199)0%   (0/60)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ResourceDemandingBehaviour3EditPart0%   (0/1)0%   (0/15)0%   (0/132)0%   (0/42)
ResourceDemandingBehaviour3EditPart (View): void 0%   (0/1)0%   (0/4)0%   (0/2)
access$0 (ResourceDemandingBehaviour3EditPart): 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)
getPrimaryShape (): ResourceDemandingBehaviour3EditPart$BehaviourFigure 0%   (0/1)0%   (0/4)0%   (0/1)
refreshBounds (): void 0%   (0/1)0%   (0/1)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/15)0%   (0/5)
     
class ResourceDemandingBehaviour3EditPart$10%   (0/1)0%   (0/4)0%   (0/22)0%   (0/9)
ResourceDemandingBehaviour3EditPart$1 (ResourceDemandingBehaviour3EditPart): ... 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 ResourceDemandingBehaviour3EditPart$BehaviourFigure0%   (0/1)0%   (0/3)0%   (0/45)0%   (0/11)
ResourceDemandingBehaviour3EditPart$BehaviourFigure (ResourceDemandingBehavio... 0%   (0/1)0%   (0/38)0%   (0/8)
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 2006 SDQ Research Group, University of Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.seff.edit.parts;
5 
6import org.eclipse.draw2d.IFigure;
7import org.eclipse.draw2d.RoundedRectangle;
8import org.eclipse.draw2d.Shape;
9import org.eclipse.draw2d.StackLayout;
10import org.eclipse.draw2d.geometry.Dimension;
11import org.eclipse.gef.EditPart;
12import org.eclipse.gef.EditPolicy;
13import org.eclipse.gef.Request;
14import org.eclipse.gef.commands.Command;
15import org.eclipse.gef.editpolicies.LayoutEditPolicy;
16import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
17import org.eclipse.gef.requests.CreateRequest;
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.gef.ui.figures.DefaultSizeNodeFigure;
22import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
23import org.eclipse.gmf.runtime.notation.View;
24import org.eclipse.swt.graphics.Color;
25 
26import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.ResourceDemandingBehaviour3ItemSemanticEditPolicy;
27 
28/**
29 * @generated
30 */
31public class ResourceDemandingBehaviour3EditPart extends ShapeNodeEditPart {
32 
33        /**
34         * @generated
35         */
36        public static final int VISUAL_ID = 3014;
37 
38        /**
39         * @generated
40         */
41        protected IFigure contentPane;
42 
43        /**
44         * @generated
45         */
46        protected IFigure primaryShape;
47 
48        /**
49         * @generated
50         */
51        public ResourceDemandingBehaviour3EditPart(View view) {
52                super(view);
53        }
54 
55        /**
56         * @generated
57         */
58        protected void createDefaultEditPolicies() {
59                super.createDefaultEditPolicies();
60                installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
61                                new ResourceDemandingBehaviour3ItemSemanticEditPolicy());
62                installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
63                // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
64                // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
65        }
66 
67        /**
68         * @generated
69         */
70        protected LayoutEditPolicy createLayoutEditPolicy() {
71                LayoutEditPolicy lep = new LayoutEditPolicy() {
72 
73                        protected EditPolicy createChildEditPolicy(EditPart child) {
74                                EditPolicy result = child
75                                                .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
76                                if (result == null) {
77                                        result = new NonResizableEditPolicy();
78                                }
79                                return result;
80                        }
81 
82                        protected Command getMoveChildrenCommand(Request request) {
83                                return null;
84                        }
85 
86                        protected Command getCreateCommand(CreateRequest request) {
87                                return null;
88                        }
89                };
90                return lep;
91        }
92 
93        /**
94         * @generated
95         */
96        protected IFigure createNodeShape() {
97                BehaviourFigure figure = new BehaviourFigure();
98                return primaryShape = figure;
99        }
100 
101        /**
102         * @generated
103         */
104        public BehaviourFigure getPrimaryShape() {
105                return (BehaviourFigure) primaryShape;
106        }
107 
108        /**
109         * @generated
110         */
111        protected NodeFigure createNodePlate() {
112                DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
113                return result;
114        }
115 
116        /**
117         * Creates figure for this edit part.
118         * 
119         * Body of this method does not depend on settings in generation model
120         * so you may safely remove <i>generated</i> tag and modify it.
121         * 
122         * @generated
123         */
124        protected NodeFigure createNodeFigure() {
125                NodeFigure figure = createNodePlate();
126                figure.setLayoutManager(new StackLayout());
127                IFigure shape = createNodeShape();
128                figure.add(shape);
129                contentPane = setupContentPane(shape);
130                return figure;
131        }
132 
133        /**
134         * Default implementation treats passed figure as content pane.
135         * Respects layout one may have set for generated figure.
136         * @param nodeShape instance of generated figure class
137         * @generated
138         */
139        protected IFigure setupContentPane(IFigure nodeShape) {
140                if (nodeShape.getLayoutManager() == null) {
141                        ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
142                        layout.setSpacing(5);
143                        nodeShape.setLayoutManager(layout);
144                }
145                return nodeShape; // use nodeShape itself as contentPane
146        }
147 
148        /**
149         * @generated
150         */
151        public IFigure getContentPane() {
152                if (contentPane != null) {
153                        return contentPane;
154                }
155                return super.getContentPane();
156        }
157 
158        /**
159         * @generated
160         */
161        protected void setForegroundColor(Color color) {
162                if (primaryShape != null) {
163                        primaryShape.setForegroundColor(color);
164                }
165        }
166 
167        /**
168         * @generated
169         */
170        protected void setBackgroundColor(Color color) {
171                if (primaryShape != null) {
172                        primaryShape.setBackgroundColor(color);
173                }
174        }
175 
176        /**
177         * @generated
178         */
179        protected void setLineWidth(int width) {
180                if (primaryShape instanceof Shape) {
181                        ((Shape) primaryShape).setLineWidth(width);
182                }
183        }
184 
185        /**
186         * @generated
187         */
188        protected void setLineType(int style) {
189                if (primaryShape instanceof Shape) {
190                        ((Shape) primaryShape).setLineStyle(style);
191                }
192        }
193 
194        /**
195         * @generated
196         */
197        public class BehaviourFigure extends RoundedRectangle {
198 
199                /**
200                 * @generated
201                 */
202                public BehaviourFigure() {
203                        this.setCornerDimensions(new Dimension(getMapMode().DPtoLP(8),
204                                        getMapMode().DPtoLP(8)));
205                        this.setLineWidth(1);
206                        this.setMinimumSize(new Dimension(getMapMode().DPtoLP(0),
207                                        getMapMode().DPtoLP(0)));
208                }
209 
210                /**
211                 * @generated
212                 */
213                private boolean myUseLocalCoordinates = false;
214 
215                /**
216                 * @generated
217                 */
218                protected boolean useLocalCoordinates() {
219                        return myUseLocalCoordinates;
220                }
221 
222                /**
223                 * @generated
224                 */
225                protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
226                        myUseLocalCoordinates = useLocalCoordinates;
227                }
228 
229        }
230 
231        @Override
232        protected void refreshBounds() {
233        }
234}

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