1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
package org.argouml.model.euml; |
14 | |
|
15 | |
import java.util.Collection; |
16 | |
|
17 | |
import org.argouml.model.AbstractModelFactory; |
18 | |
import org.argouml.model.ActivityGraphsFactory; |
19 | |
import org.eclipse.uml2.uml.Activity; |
20 | |
import org.eclipse.uml2.uml.UMLFactory; |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
class ActivityGraphsFactoryEUMLlImpl implements ActivityGraphsFactory, |
26 | |
AbstractModelFactory { |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
private EUMLModelImplementation modelImpl; |
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
public ActivityGraphsFactoryEUMLlImpl( |
39 | 0 | EUMLModelImplementation implementation) { |
40 | 0 | modelImpl = implementation; |
41 | 0 | } |
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
public Object buildActivityGraph(final Object theContext) { |
52 | 0 | if (!(theContext instanceof org.eclipse.uml2.uml.Package)) { |
53 | 0 | throw new IllegalArgumentException( |
54 | |
"Didn't expect a " |
55 | |
+ theContext); |
56 | |
} |
57 | 0 | RunnableClass run = new RunnableClass() { |
58 | |
public void run() { |
59 | 0 | Activity activity = (Activity) createActivityGraph(); |
60 | 0 | activity.setPackage((org.eclipse.uml2.uml.Package) theContext); |
61 | 0 | getParams().add(activity); |
62 | 0 | } |
63 | |
}; |
64 | 0 | ChangeCommand cmd = new ChangeCommand( |
65 | |
modelImpl, run, |
66 | |
"Create the activity # in the package #"); |
67 | 0 | modelImpl.getEditingDomain().getCommandStack().execute(cmd); |
68 | 0 | cmd.setObjects(run.getParams().get(0), theContext); |
69 | |
|
70 | 0 | return (Activity) run.getParams().get(0); |
71 | |
} |
72 | |
|
73 | |
public Object buildClassifierInState(Object classifier, Collection state) { |
74 | 0 | throw new NotYetImplementedException(); |
75 | |
} |
76 | |
|
77 | |
public Object buildObjectFlowState(Object compositeState) { |
78 | 0 | throw new NotYetImplementedException(); |
79 | |
} |
80 | |
|
81 | |
public Object createActionState() { |
82 | 0 | throw new NotYetImplementedException(); |
83 | |
} |
84 | |
|
85 | |
public Object createActivityGraph() { |
86 | 0 | return UMLFactory.eINSTANCE.createActivity(); |
87 | |
} |
88 | |
|
89 | |
public Object createCallState() { |
90 | 0 | throw new NotYetImplementedException(); |
91 | |
} |
92 | |
|
93 | |
public Object createClassifierInState() { |
94 | 0 | throw new NotYetImplementedException(); |
95 | |
} |
96 | |
|
97 | |
public Object createObjectFlowState() { |
98 | 0 | throw new NotYetImplementedException(); |
99 | |
} |
100 | |
|
101 | |
public Object createPartition() { |
102 | 0 | throw new NotYetImplementedException(); |
103 | |
} |
104 | |
|
105 | |
public Object createSubactivityState() { |
106 | 0 | throw new NotYetImplementedException(); |
107 | |
} |
108 | |
|
109 | |
} |