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

nameclass, %method, %block, %line, %
ProbabilisticBranchTransitionEditPart.java0%   (0/3)0%   (0/32)0%   (0/535)0%   (0/161)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ProbabilisticBranchTransitionEditPart0%   (0/1)0%   (0/20)0%   (0/212)0%   (0/74)
ProbabilisticBranchTransitionEditPart (View): void 0%   (0/1)0%   (0/4)0%   (0/2)
access$0 (ProbabilisticBranchTransitionEditPart): IMapMode 0%   (0/1)0%   (0/3)0%   (0/1)
addChildVisual (EditPart, int): void 0%   (0/1)0%   (0/10)0%   (0/4)
addFixedChild (EditPart): boolean 0%   (0/1)0%   (0/24)0%   (0/11)
createDefaultEditPolicies (): void 0%   (0/1)0%   (0/32)0%   (0/11)
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)
getContentPaneFor (IGraphicalEditPart): IFigure 0%   (0/1)0%   (0/3)0%   (0/1)
getPrimaryChildEditPart (): EditPart 0%   (0/1)0%   (0/5)0%   (0/2)
getPrimaryShape (): ProbabilisticBranchTransitionEditPart$BranchTransitionFigure 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/12)0%   (0/5)
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 ProbabilisticBranchTransitionEditPart$10%   (0/1)0%   (0/4)0%   (0/22)0%   (0/9)
ProbabilisticBranchTransitionEditPart$1 (ProbabilisticBranchTransitionEditPar... 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 ProbabilisticBranchTransitionEditPart$BranchTransitionFigure0%   (0/1)0%   (0/8)0%   (0/301)0%   (0/80)
ProbabilisticBranchTransitionEditPart$BranchTransitionFigure (ProbabilisticBr... 0%   (0/1)0%   (0/55)0%   (0/16)
add (IFigure, Object, int): void 0%   (0/1)0%   (0/34)0%   (0/12)
createContents (): void 0%   (0/1)0%   (0/196)0%   (0/46)
getFigureBranchTransitionConditionLabel (): WrappingLabel 0%   (0/1)0%   (0/3)0%   (0/1)
getFigureBranchTransitionNameLabel (): WrappingLabel 0%   (0/1)0%   (0/3)0%   (0/1)
getFigureBranchTransitionProbabilityLabel (): WrappingLabel 0%   (0/1)0%   (0/3)0%   (0/1)
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.Graphics;
7import org.eclipse.draw2d.GridData;
8import org.eclipse.draw2d.GridLayout;
9import org.eclipse.draw2d.IFigure;
10import org.eclipse.draw2d.MarginBorder;
11import org.eclipse.draw2d.RectangleFigure;
12import org.eclipse.draw2d.Shape;
13import org.eclipse.draw2d.StackLayout;
14import org.eclipse.draw2d.geometry.Dimension;
15import org.eclipse.gef.EditPart;
16import org.eclipse.gef.EditPolicy;
17import org.eclipse.gef.Request;
18import org.eclipse.gef.commands.Command;
19import org.eclipse.gef.editpolicies.LayoutEditPolicy;
20import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
21import org.eclipse.gef.requests.CreateRequest;
22import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
23import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
24import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
25import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
26import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
27import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
28import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
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.SWT;
33import org.eclipse.swt.graphics.Color;
34 
35import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.ProbabilisticBranchTransitionCanonicalEditPolicy;
36import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.ProbabilisticBranchTransitionItemSemanticEditPolicy;
37import de.uka.ipd.sdq.pcm.gmf.seff.part.PalladioComponentModelVisualIDRegistry;
38 
39/**
40 * @generated
41 */
42public class ProbabilisticBranchTransitionEditPart extends ShapeNodeEditPart {
43 
44        /**
45         * @generated
46         */
47        public static final int VISUAL_ID = 3010;
48 
49        /**
50         * @generated
51         */
52        protected IFigure contentPane;
53 
54        /**
55         * @generated
56         */
57        protected IFigure primaryShape;
58 
59        /**
60         * @generated
61         */
62        public ProbabilisticBranchTransitionEditPart(View view) {
63                super(view);
64        }
65 
66        /**
67         * @generated
68         */
69        protected void createDefaultEditPolicies() {
70                installEditPolicy(EditPolicyRoles.CREATION_ROLE,
71                                new CreationEditPolicy());
72                super.createDefaultEditPolicies();
73                installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
74                                new ProbabilisticBranchTransitionItemSemanticEditPolicy());
75                installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE,
76                                new DragDropEditPolicy());
77                installEditPolicy(EditPolicyRoles.CANONICAL_ROLE,
78                                new ProbabilisticBranchTransitionCanonicalEditPolicy());
79                installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
80                // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
81                // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
82        }
83 
84        /**
85         * @generated
86         */
87        protected LayoutEditPolicy createLayoutEditPolicy() {
88                LayoutEditPolicy lep = new LayoutEditPolicy() {
89 
90                        protected EditPolicy createChildEditPolicy(EditPart child) {
91                                EditPolicy result = child
92                                                .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
93                                if (result == null) {
94                                        result = new NonResizableEditPolicy();
95                                }
96                                return result;
97                        }
98 
99                        protected Command getMoveChildrenCommand(Request request) {
100                                return null;
101                        }
102 
103                        protected Command getCreateCommand(CreateRequest request) {
104                                return null;
105                        }
106                };
107                return lep;
108        }
109 
110        /**
111         * @generated
112         */
113        protected IFigure createNodeShape() {
114                BranchTransitionFigure figure = new BranchTransitionFigure();
115                return primaryShape = figure;
116        }
117 
118        /**
119         * @generated
120         */
121        public BranchTransitionFigure getPrimaryShape() {
122                return (BranchTransitionFigure) primaryShape;
123        }
124 
125        /**
126         * @generated
127         */
128        protected boolean addFixedChild(EditPart childEditPart) {
129                if (childEditPart instanceof ProbabilisticBranchTransitionEntityNameEditPart) {
130                        ((ProbabilisticBranchTransitionEntityNameEditPart) childEditPart)
131                                        .setLabel(getPrimaryShape()
132                                                        .getFigureBranchTransitionNameLabel());
133                        return true;
134                }
135                if (childEditPart instanceof ProbabilisticBranchTransitionBranchProbabilityEditPart) {
136                        ((ProbabilisticBranchTransitionBranchProbabilityEditPart) childEditPart)
137                                        .setLabel(getPrimaryShape()
138                                                        .getFigureBranchTransitionProbabilityLabel());
139                        return true;
140                }
141                return false;
142        }
143 
144        /**
145         * @generated
146         */
147        protected boolean removeFixedChild(EditPart childEditPart) {
148                if (childEditPart instanceof ProbabilisticBranchTransitionEntityNameEditPart) {
149                        return true;
150                }
151                if (childEditPart instanceof ProbabilisticBranchTransitionBranchProbabilityEditPart) {
152                        return true;
153                }
154                return false;
155        }
156 
157        /**
158         * @generated
159         */
160        protected void addChildVisual(EditPart childEditPart, int index) {
161                if (addFixedChild(childEditPart)) {
162                        return;
163                }
164                super.addChildVisual(childEditPart, -1);
165        }
166 
167        /**
168         * @generated
169         */
170        protected void removeChildVisual(EditPart childEditPart) {
171                if (removeFixedChild(childEditPart)) {
172                        return;
173                }
174                super.removeChildVisual(childEditPart);
175        }
176 
177        /**
178         * @generated
179         */
180        protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
181                return getContentPane();
182        }
183 
184        /**
185         * @generated
186         */
187        protected NodeFigure createNodePlate() {
188                DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
189                return result;
190        }
191 
192        /**
193         * Creates figure for this edit part.
194         * 
195         * Body of this method does not depend on settings in generation model
196         * so you may safely remove <i>generated</i> tag and modify it.
197         * 
198         * @generated
199         */
200        protected NodeFigure createNodeFigure() {
201                NodeFigure figure = createNodePlate();
202                figure.setLayoutManager(new StackLayout());
203                IFigure shape = createNodeShape();
204                figure.add(shape);
205                contentPane = setupContentPane(shape);
206                return figure;
207        }
208 
209        /**
210         * Default implementation treats passed figure as content pane.
211         * Respects layout one may have set for generated figure.
212         * @param nodeShape instance of generated figure class
213         * @generated
214         */
215        protected IFigure setupContentPane(IFigure nodeShape) {
216                if (nodeShape.getLayoutManager() == null) {
217                        ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
218                        layout.setSpacing(5);
219                        nodeShape.setLayoutManager(layout);
220                }
221                return nodeShape; // use nodeShape itself as contentPane
222        }
223 
224        /**
225         * @generated
226         */
227        public IFigure getContentPane() {
228                if (contentPane != null) {
229                        return contentPane;
230                }
231                return super.getContentPane();
232        }
233 
234        /**
235         * @generated
236         */
237        protected void setForegroundColor(Color color) {
238                if (primaryShape != null) {
239                        primaryShape.setForegroundColor(color);
240                }
241        }
242 
243        /**
244         * @generated
245         */
246        protected void setBackgroundColor(Color color) {
247                if (primaryShape != null) {
248                        primaryShape.setBackgroundColor(color);
249                }
250        }
251 
252        /**
253         * @generated
254         */
255        protected void setLineWidth(int width) {
256                if (primaryShape instanceof Shape) {
257                        ((Shape) primaryShape).setLineWidth(width);
258                }
259        }
260 
261        /**
262         * @generated
263         */
264        protected void setLineType(int style) {
265                if (primaryShape instanceof Shape) {
266                        ((Shape) primaryShape).setLineStyle(style);
267                }
268        }
269 
270        /**
271         * @generated
272         */
273        public EditPart getPrimaryChildEditPart() {
274                return getChildBySemanticHint(PalladioComponentModelVisualIDRegistry
275                                .getType(ProbabilisticBranchTransitionEntityNameEditPart.VISUAL_ID));
276        }
277 
278        /**
279         * @generated
280         */
281        public class BranchTransitionFigure extends RectangleFigure {
282                /**
283                 * @generated
284                 */
285                private WrappingLabel fFigureBranchTransitionNameLabel;
286                /**
287                 * @generated
288                 */
289                private WrappingLabel fFigureBranchTransitionConditionLabel;
290                /**
291                 * @generated
292                 */
293                private WrappingLabel fFigureBranchTransitionProbabilityLabel;
294 
295                /**
296                 * @generated
297                 */
298                public BranchTransitionFigure() {
299 
300                        GridLayout layoutThis = new GridLayout();
301                        layoutThis.numColumns = 1;
302                        layoutThis.makeColumnsEqualWidth = true;
303                        layoutThis.horizontalSpacing = 0;
304                        layoutThis.verticalSpacing = 0;
305                        layoutThis.marginWidth = 0;
306                        layoutThis.marginHeight = 0;
307                        this.setLayoutManager(layoutThis);
308 
309                        this.setLineWidth(2);
310                        this.setLineStyle(Graphics.LINE_DASH);
311                        this.setMinimumSize(new Dimension(getMapMode().DPtoLP(0),
312                                        getMapMode().DPtoLP(0)));
313                        createContents();
314                }
315 
316                /**
317                 * @generated
318                 */
319                private void createContents() {
320 
321                        fFigureBranchTransitionNameLabel = new WrappingLabel();
322                        fFigureBranchTransitionNameLabel.setText("");
323                        fFigureBranchTransitionNameLabel.setBorder(new MarginBorder(
324                                        getMapMode().DPtoLP(2), getMapMode().DPtoLP(0),
325                                        getMapMode().DPtoLP(2), getMapMode().DPtoLP(0)));
326 
327                        GridData constraintFFigureBranchTransitionNameLabel = new GridData();
328                        constraintFFigureBranchTransitionNameLabel.verticalAlignment = GridData.CENTER;
329                        constraintFFigureBranchTransitionNameLabel.horizontalAlignment = GridData.CENTER;
330                        constraintFFigureBranchTransitionNameLabel.horizontalIndent = 0;
331                        constraintFFigureBranchTransitionNameLabel.horizontalSpan = 1;
332                        constraintFFigureBranchTransitionNameLabel.verticalSpan = 1;
333                        constraintFFigureBranchTransitionNameLabel.grabExcessHorizontalSpace = false;
334                        constraintFFigureBranchTransitionNameLabel.grabExcessVerticalSpace = false;
335                        this.add(fFigureBranchTransitionNameLabel,
336                                        constraintFFigureBranchTransitionNameLabel);
337 
338                        fFigureBranchTransitionProbabilityLabel = new WrappingLabel();
339                        fFigureBranchTransitionProbabilityLabel.setText("");
340                        fFigureBranchTransitionProbabilityLabel.setBorder(new MarginBorder(
341                                        getMapMode().DPtoLP(2), getMapMode().DPtoLP(0),
342                                        getMapMode().DPtoLP(2), getMapMode().DPtoLP(0)));
343 
344                        GridData constraintFFigureBranchTransitionProbabilityLabel = new GridData();
345                        constraintFFigureBranchTransitionProbabilityLabel.verticalAlignment = GridData.CENTER;
346                        constraintFFigureBranchTransitionProbabilityLabel.horizontalAlignment = GridData.CENTER;
347                        constraintFFigureBranchTransitionProbabilityLabel.horizontalIndent = 0;
348                        constraintFFigureBranchTransitionProbabilityLabel.horizontalSpan = 1;
349                        constraintFFigureBranchTransitionProbabilityLabel.verticalSpan = 1;
350                        constraintFFigureBranchTransitionProbabilityLabel.grabExcessHorizontalSpace = false;
351                        constraintFFigureBranchTransitionProbabilityLabel.grabExcessVerticalSpace = false;
352                        this.add(fFigureBranchTransitionProbabilityLabel,
353                                        constraintFFigureBranchTransitionProbabilityLabel);
354 
355                        fFigureBranchTransitionConditionLabel = new WrappingLabel();
356                        fFigureBranchTransitionConditionLabel.setText("");
357                        fFigureBranchTransitionConditionLabel.setBorder(new MarginBorder(
358                                        getMapMode().DPtoLP(2), getMapMode().DPtoLP(0),
359                                        getMapMode().DPtoLP(2), getMapMode().DPtoLP(0)));
360 
361                        GridData constraintFFigureBranchTransitionConditionLabel = new GridData();
362                        constraintFFigureBranchTransitionConditionLabel.verticalAlignment = GridData.CENTER;
363                        constraintFFigureBranchTransitionConditionLabel.horizontalAlignment = GridData.CENTER;
364                        constraintFFigureBranchTransitionConditionLabel.horizontalIndent = 0;
365                        constraintFFigureBranchTransitionConditionLabel.horizontalSpan = 1;
366                        constraintFFigureBranchTransitionConditionLabel.verticalSpan = 1;
367                        constraintFFigureBranchTransitionConditionLabel.grabExcessHorizontalSpace = false;
368                        constraintFFigureBranchTransitionConditionLabel.grabExcessVerticalSpace = false;
369                        this.add(fFigureBranchTransitionConditionLabel,
370                                        constraintFFigureBranchTransitionConditionLabel);
371 
372                }
373 
374                /**
375                 * @generated
376                 */
377                public WrappingLabel getFigureBranchTransitionProbabilityLabel() {
378                        return fFigureBranchTransitionProbabilityLabel;
379                }
380 
381                /**
382                 * @generated
383                 */
384                private boolean myUseLocalCoordinates = false;
385 
386                /**
387                 * @generated
388                 */
389                protected boolean useLocalCoordinates() {
390                        return myUseLocalCoordinates;
391                }
392 
393                /**
394                 * @generated
395                 */
396                protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
397                        myUseLocalCoordinates = useLocalCoordinates;
398                }
399 
400                /**
401                 * @generated
402                 */
403                public WrappingLabel getFigureBranchTransitionNameLabel() {
404                        return fFigureBranchTransitionNameLabel;
405                }
406 
407                /**
408                 * @generated
409                 */
410                public WrappingLabel getFigureBranchTransitionConditionLabel() {
411                        return fFigureBranchTransitionConditionLabel;
412                }
413 
414                @Override
415                public void add(IFigure figure, Object constraint, int index) {
416                        Object newConstraint = constraint;
417                        if (newConstraint == null) {
418                                GridData layout = new GridData();
419                                layout.grabExcessHorizontalSpace = true;
420                                layout.grabExcessVerticalSpace = true;
421                                layout.horizontalAlignment = SWT.FILL;
422                                layout.verticalAlignment = SWT.FILL;
423                                layout.horizontalSpan = 1;
424                                layout.verticalSpan = 1;
425 
426                                newConstraint = layout;
427                        }
428                        super.add(figure, newConstraint, index);
429                }
430        }
431 
432}

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