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

COVERAGE SUMMARY FOR SOURCE FILE [ResourceContainerAllocationCompartmentCanonicalEditPolicy.java]

nameclass, %method, %block, %line, %
ResourceContainerAllocationCompartmentCanonicalEditPolicy.java0%   (0/1)0%   (0/5)0%   (0/103)0%   (0/30)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ResourceContainerAllocationCompartmentCanonicalEditPolicy0%   (0/1)0%   (0/5)0%   (0/103)0%   (0/30)
ResourceContainerAllocationCompartmentCanonicalEditPolicy (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getDefaultFactoryHint (): String 0%   (0/1)0%   (0/2)0%   (0/1)
getFeaturesToSynchronize (): Set 0%   (0/1)0%   (0/17)0%   (0/5)
getSemanticChildrenList (): List 0%   (0/1)0%   (0/56)0%   (0/16)
isOrphaned (Collection, View): boolean 0%   (0/1)0%   (0/25)0%   (0/7)

1/*
2 *Copyright 2007, SDQ, IPD, U KA
3 */
4package de.uka.ipd.sdq.pcm.gmf.allocation.edit.policies;
5 
6import java.util.Collection;
7import java.util.HashSet;
8import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
9import org.eclipse.gmf.runtime.notation.View;
10import de.uka.ipd.sdq.pcm.allocation.Allocation;
11import de.uka.ipd.sdq.pcm.allocation.AllocationContext;
12 
13import de.uka.ipd.sdq.pcm.allocation.AllocationPackage;
14import de.uka.ipd.sdq.pcm.gmf.allocation.edit.parts.AllocationContextEditPart;
15 
16import de.uka.ipd.sdq.pcm.gmf.allocation.part.PalladioComponentModelDiagramUpdater;
17import de.uka.ipd.sdq.pcm.gmf.allocation.part.PalladioComponentModelNodeDescriptor;
18import de.uka.ipd.sdq.pcm.gmf.allocation.part.PalladioComponentModelVisualIDRegistry;
19 
20import java.util.Iterator;
21import java.util.LinkedList;
22import java.util.List;
23 
24import java.util.Set;
25import org.eclipse.emf.ecore.EObject;
26 
27/**
28 * @generated
29 */
30public class ResourceContainerAllocationCompartmentCanonicalEditPolicy extends
31                CanonicalEditPolicy {
32 
33        /**
34         * @generated
35         */
36        Set myFeaturesToSynchronize;
37 
38        /**
39         * @generated not
40         */
41        protected List getSemanticChildrenList() {
42                List result = new LinkedList();
43                EObject modelObject = ((View) getHost().getModel()).getElement();
44                EObject allocation = ((View) getHost().getParent().getParent()
45                                .getModel()).getElement();
46                View viewObject = (View) getHost().getModel();
47                EObject nextValue;
48                int nodeVID;
49                for (Iterator values = ((Allocation) allocation)
50                                .getAllocationContexts_Allocation().iterator(); values
51                                .hasNext();) {
52                        nextValue = (EObject) values.next();
53                        AllocationContext ac = (AllocationContext) nextValue;
54                        if (ac.getResourceContainer_AllocationContext() == modelObject) {
55                                nodeVID = PalladioComponentModelVisualIDRegistry
56                                                .getNodeVisualID(viewObject, nextValue);
57                                if (AllocationContextEditPart.VISUAL_ID == nodeVID) {
58                                        result.add(nextValue);
59                                }
60                        }
61                }
62                return result;
63        }
64 
65        /**
66         * @generated
67         */
68        protected boolean isOrphaned(Collection semanticChildren, final View view) {
69                int visualID = PalladioComponentModelVisualIDRegistry.getVisualID(view);
70                switch (visualID) {
71                case AllocationContextEditPart.VISUAL_ID:
72                        return !semanticChildren.contains(view.getElement())
73                                        || visualID != PalladioComponentModelVisualIDRegistry
74                                                        .getNodeVisualID((View) getHost().getModel(), view
75                                                                        .getElement());
76                }
77                return false;
78        }
79 
80        /**
81         * @generated
82         */
83        protected String getDefaultFactoryHint() {
84                return null;
85        }
86 
87        /**
88         * @generated
89         */
90        protected Set getFeaturesToSynchronize() {
91                if (myFeaturesToSynchronize == null) {
92                        myFeaturesToSynchronize = new HashSet();
93                        myFeaturesToSynchronize.add(AllocationPackage.eINSTANCE
94                                        .getAllocation_AllocationContexts_Allocation());
95                }
96                return myFeaturesToSynchronize;
97        }
98 
99}

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