1 | /** | | 1 | /** |
2 | * If there are instances that have no classifiers they belong to | | 2 | * If there are instances that have no classifiers they belong to |
3 | * the returned ListSet is not null. Then in the ListSet | | 3 | * the returned vector-set is not null. Then in the vector-set |
4 | * are the UMLDeploymentDiagram and all FigObjects, FigComponentInstances | | 4 | * are the UMLSequenceDiagram and all FigObjects, FigComponentInstances |
5 | * and FigMNodeInstances with no classifier. | | 5 | * and FigMNodeInstances with no classifier. |
6 | * | | 6 | * |
7 | * @param dd the diagram to check | | 7 | * @param sd the diagram to check |
8 | * @return the set of offenders | | 8 | * @return the set of offenders |
9 | */ | | 9 | */ |
10 | public ListSet computeOffenders(UMLDeploymentDiagram dd) { | | 10 | public ListSet computeOffenders(ArgoDiagram sd) { |
11 | Collection figs = dd.getLayer().getContents(); | | 11 | Collection figs = sd.getLayer().getContents(); |
12 | ListSet offs = null; | | 12 | ListSet offs = null; |
13 | Iterator figIter = figs.iterator(); | | 13 | for (Object obj : figs) { |
14 | while (figIter.hasNext()) { | | 14 | if (!(obj instanceof FigNodeModelElement)) { |
15 | Object obj = figIter.next(); | | 15 | continue; |
16 | if (!(obj instanceof FigNodeModelElement)) { | | 16 | } |
17 | continue; | | 17 | FigNodeModelElement fn = (FigNodeModelElement) obj; |
18 | } | | 18 | if (fn != null && (Model.getFacade().isAInstance(fn.getOwner()))) { |
19 | FigNodeModelElement figNodeModelElement = (FigNodeModelElement) obj; | | 19 | Object minst = fn.getOwner(); |
20 | if (figNodeModelElement != null | | 20 | if (minst != null) { |
21 | && (Model.getFacade().isAInstance( | | 21 | Collection col = Model.getFacade().getClassifiers(minst); |
22 | figNodeModelElement.getOwner()))) { | | 22 | if (col.size() > 0) { |
23 | Object instance = figNodeModelElement.getOwner(); | | 23 | continue; |
24 | if (instance != null) { | | 24 | } |
25 | Collection col = Model.getFacade().getClassifiers(instance); | | 25 | } |
26 | if (col.size() > 0) { | | 26 | if (offs == null) { |
27 | continue; | | 27 | offs = new ListSet(); |
28 | } | | 28 | offs.add(sd); |
29 | } | | 29 | } |
30 | if (offs == null) { | | 30 | offs.add(fn); |
31 | offs = new ListSet(); | | 31 | } |
32 | offs.add(dd); | | 32 | } |
33 | } | | 33 | retur |
34 | offs.add(figNodeModelElement); | | | |
35 | } | | | |
36 | } | | | |
37 | return offs; | | | |
38 | } | | | |