<
From version < 18.1 >
edited by ssm
on 2016/04/21 19:30
To version < 17.1 >
edited by ssm
on 2016/04/21 17:19
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -135,6 +135,18 @@
135 135  
136 136  {{layout-section ac:type="single"}}
137 137  {{layout-cell}}
138 +
139 +{{/layout-cell}}
140 +{{/layout-section}}
141 +
142 +{{layout-section ac:type="single"}}
143 +{{layout-cell}}
144 +
145 +{{/layout-cell}}
146 +{{/layout-section}}
147 +
148 +{{layout-section ac:type="single"}}
149 +{{layout-cell}}
138 138  = Creating SCCharts Models Programmatically =
139 139  
140 140  == Creating a Test Project ==
... ... @@ -141,7 +141,6 @@
141 141  
142 142  We need a project for testing. Do the following:
143 143  
144 -1. If you used the standard KIELER Oomph installation setup, create a new Working Set named Tutorial in the Package Explorer. Then...
145 145  1. Create a new empty //Plug-In Project//.
146 146  1. Add the project that contains the sccharts metamodel as a dependency of your new project through the //Plugin Manifest Editor//.
147 147  1. Create a simple Java class that implements a main method. Hint: In a new Java class, simply type main and hit Ctrl+Space. Eclipse content assist will create the method for you.
... ... @@ -148,7 +148,7 @@
148 148  
149 149  == Creating a Model ==
150 150  
151 -To create a model programmatically you cannot directly use the Java classes generated for the model. Instead, the main package contains interfaces for all of your model object classes. The {{code language="none"}}impl{{/code}} package contains the actual implementation and the {{code language="none"}}util{{/code}} package contains some helper classes. Do not instantiate objects directly by manually calling {{code language="none"}}new{{/code}}. EMF generates a Factory to create new objects. The factory itself uses the singleton pattern to get access to it:
162 +To create a model programmatically you cannot directly use the Java classes generated for the model. Instead, the main package contains interfaces for all of your model object classes. The {{code language="none"}}impl{{/code}} package contains the actual implementation and the {{code language="none"}}util{{/code}} package contains some helper classes. Do not instantiate objects directly by manually calling {{code language="none"}}new{{/code}}. EMF generates a Factory to create new objects. The factory itself uses the singleton pattern to get access to it:
152 152  
153 153  {{code language="java"}}
154 154  SCChartsFactory sccFactory = SCChartsFactory.eINSTANCE;
... ... @@ -160,7 +160,7 @@
160 160  
161 161  {{code language="java"}}
162 162  KExpressionsFactory kFactory = KExpressionsFactory.eINSTANCE;
163 -BoolValue boolValue = kFactory.createBoolValue();
174 +BooleanValue boolValue = kFactory.createBooleanValue();
164 164  {{/code}}
165 165  
166 166  For all simple attributes, there are getter and setter methods:
... ... @@ -179,13 +179,9 @@
179 179  List references (multiplicity of > 1) have only a list getter, which is used to manipulate the list:
180 180  
181 181  {{code language="java"}}
182 -state.getOutgoingTransitions().add(transition);
193 +state.outgoingTransitions.add(transition);
183 183  {{/code}}
184 184  
185 -{{info title="Plugin Dependencies"}}
186 -You may have noticed that is was not necessary to add a dependency for the kexpressions classes. The SCCharts plugin reexports the dependencies of the other EMF metamodels. Look at the plugin.xml in the SCCharts plugin in the dependency tab for more information.
187 -{{/info}}
188 -
189 189  == Saving a Model ==
190 190  
191 191  EMF uses the [[Eclipse Resource concept>>url:http://help.eclipse.org/juno/topic/org.eclipse.platform.doc.isv/guide/resInt.htm?cp=2_0_10||rel="nofollow" shape="rect" class="external-link"]] to save models to files and load models from files. It can use different //Resource Factories// that determine how exactly models are serialized. We will use the [[XMIResourceFactoryImpl>>url:http://download.eclipse.org/modeling/emf/emf/javadoc/2.8.0/org/eclipse/emf/ecore/xmi/impl/XMIResourceFactoryImpl.html||rel="nofollow" shape="rect" class="external-link"]] to save our models to XML files:
... ... @@ -230,17 +230,7 @@
230 230  1. Execute the main method.
231 231  1. Inspect your SCT file.
232 232  1. Start your SCChart Editor Eclipse instance and load your SCT file. KLighD should now be able to visualize your ABO correctly.
233 -{{/layout-cell}}
234 -{{/layout-section}}
235 235  
236 -{{layout-section ac:type="single"}}
237 -{{layout-cell}}
238 -
239 -{{/layout-cell}}
240 -{{/layout-section}}
241 -
242 -{{layout-section ac:type="single"}}
243 -{{layout-cell}}
244 244  = Transforming SCCharts =
245 245  
246 246  Transformations from one model to another may be performed within the same metamodel or from metamodel to a different metamodel. Both methods are used in KIELER and in principle they do not really differ in implementation. Nevertheless, if working within the same metamodel you should keep in mind that you're potentially changing the actual model instead of changing another instance (after copying). Both is possible. Just make sure that you know what you're doing.
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -16810318
1 +16810316
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/TUT/pages/16810318/SCCharts Development
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/TUT/pages/16810316/SCCharts Development