]> gerrit.simantics Code Review - simantics/sysdyn.git/blob
2dcfc4caf6e9595db8b1067e18ec17e2620b747d
[simantics/sysdyn.git] /
1 package org.simantics.sysdyn.ui.properties;\r
2 \r
3 import java.util.Collection;\r
4 import java.util.Collections;\r
5 import java.util.HashMap;\r
6 import java.util.Map;\r
7 \r
8 import org.eclipse.core.runtime.IAdaptable;\r
9 import org.eclipse.jface.layout.GridDataFactory;\r
10 import org.eclipse.jface.layout.GridLayoutFactory;\r
11 import org.eclipse.jface.resource.JFaceResources;\r
12 import org.eclipse.jface.resource.LocalResourceManager;\r
13 import org.eclipse.jface.viewers.ISelectionProvider;\r
14 import org.eclipse.jface.viewers.IStructuredSelection;\r
15 import org.eclipse.jface.viewers.StructuredSelection;\r
16 import org.eclipse.swt.SWT;\r
17 import org.eclipse.swt.custom.ScrolledComposite;\r
18 import org.eclipse.swt.events.DisposeEvent;\r
19 import org.eclipse.swt.events.DisposeListener;\r
20 import org.eclipse.swt.events.SelectionAdapter;\r
21 import org.eclipse.swt.events.SelectionEvent;\r
22 import org.eclipse.swt.graphics.Point;\r
23 import org.eclipse.swt.widgets.Composite;\r
24 import org.eclipse.swt.widgets.Event;\r
25 import org.eclipse.swt.widgets.Group;\r
26 import org.eclipse.swt.widgets.Label;\r
27 import org.eclipse.swt.widgets.Listener;\r
28 import org.eclipse.swt.widgets.Tree;\r
29 import org.eclipse.swt.widgets.TreeItem;\r
30 import org.eclipse.ui.IWorkbenchSite;\r
31 import org.simantics.browsing.ui.BuiltinKeys;\r
32 import org.simantics.browsing.ui.Column;\r
33 import org.simantics.browsing.ui.Column.Align;\r
34 import org.simantics.browsing.ui.NodeContext;\r
35 import org.simantics.browsing.ui.common.ColumnKeys;\r
36 import org.simantics.browsing.ui.common.NodeContextBuilder.MapNodeContext;\r
37 import org.simantics.browsing.ui.swt.SingleSelectionInputSource;\r
38 import org.simantics.browsing.ui.swt.widgets.Button;\r
39 import org.simantics.browsing.ui.swt.widgets.GraphExplorerComposite;\r
40 import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory;\r
41 import org.simantics.browsing.ui.swt.widgets.StringPropertyModifier;\r
42 import org.simantics.browsing.ui.swt.widgets.TrackedCombo;\r
43 import org.simantics.browsing.ui.swt.widgets.TrackedText;\r
44 import org.simantics.browsing.ui.swt.widgets.impl.ComboModifyListenerImpl;\r
45 import org.simantics.browsing.ui.swt.widgets.impl.ReadFactoryImpl;\r
46 import org.simantics.browsing.ui.swt.widgets.impl.SelectionListenerImpl;\r
47 import org.simantics.browsing.ui.swt.widgets.impl.TextModifyListener;\r
48 import org.simantics.browsing.ui.swt.widgets.impl.TrackedModifyEvent;\r
49 import org.simantics.browsing.ui.swt.widgets.impl.Widget;\r
50 import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
51 import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupportImpl;\r
52 import org.simantics.db.ReadGraph;\r
53 import org.simantics.db.Resource;\r
54 import org.simantics.db.WriteGraph;\r
55 import org.simantics.db.common.procedure.adapter.DisposableListener;\r
56 import org.simantics.db.common.utils.ListUtils;\r
57 import org.simantics.db.exception.DatabaseException;\r
58 import org.simantics.db.management.ISessionContext;\r
59 import org.simantics.db.request.Read;\r
60 import org.simantics.jfreechart.chart.properties.RangeComposite;\r
61 import org.simantics.jfreechart.chart.properties.VariableExistsValidator;\r
62 import org.simantics.jfreechart.chart.properties.xyline.AxisAndVariablesExplorerComposite;\r
63 import org.simantics.layer0.Layer0;\r
64 import org.simantics.layer0.utils.direct.GraphUtils;\r
65 import org.simantics.sysdyn.SysdynResource;\r
66 import org.simantics.sysdyn.ui.properties.widgets.factories.IntegerPropertyFactory;\r
67 import org.simantics.sysdyn.ui.properties.widgets.factories.IntegerPropertyModifier;\r
68 import org.simantics.sysdyn.ui.properties.widgets.sensitivity.DistributionPropertyWidget;\r
69 import org.simantics.sysdyn.ui.properties.widgets.sensitivity.ParameterChildRule;\r
70 import org.simantics.sysdyn.ui.properties.widgets.sensitivity.VariableNameModifier;\r
71 import org.simantics.ui.SimanticsUI;\r
72 import org.simantics.utils.RunnableWithObject;\r
73 import org.simantics.utils.datastructures.ArrayMap;\r
74 import org.simantics.utils.ui.AdaptionUtils;\r
75 import org.simantics.utils.ui.validators.IntegerValidator;\r
76 \r
77 /**\r
78  * Tab for displaying sensitivity analysis experiment properties\r
79  * \r
80  * @author Tuomas Miettinen\r
81  *\r
82  */\r
83 public class SensitivityAnalysisExperimentTab extends LabelPropertyTabContributor implements Widget {\r
84 \r
85     private GraphExplorerComposite explorer;\r
86     private WidgetSupportImpl parameterSupport = new WidgetSupportImpl();\r
87     private ScrolledComposite propertyContainer;\r
88     private Composite parameterProperties;\r
89     private Composite content;\r
90     private Button remove;\r
91     private Resource experiment;\r
92     \r
93     private boolean dirty = false;\r
94     \r
95     private DisposableListener<Collection<Resource>> contentListener;\r
96 \r
97     @Override\r
98     public void createControls(Composite body, IWorkbenchSite site,\r
99             final ISessionContext context, WidgetSupport support) {\r
100         support.register(this);\r
101 \r
102         Composite composite = new RemoveFocusBeforeExperimentComposite(body, SWT.NONE);\r
103         GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);\r
104         GridLayoutFactory.fillDefaults().margins(3, 3).applyTo(composite);\r
105         \r
106         // Scrolled composite for displaying properties of a selection in explorer\r
107         propertyContainer = new ScrolledComposite(composite, SWT.H_SCROLL | SWT.V_SCROLL);\r
108         GridDataFactory.fillDefaults().grab(true, true).applyTo(propertyContainer);\r
109         GridLayoutFactory.fillDefaults().applyTo(propertyContainer);\r
110         propertyContainer.setExpandHorizontal(true);\r
111         propertyContainer.setExpandVertical(true);\r
112         \r
113         content = new Composite(propertyContainer, SWT.NONE);\r
114         GridDataFactory.fillDefaults().grab(true, true).applyTo(content);\r
115         GridLayoutFactory.fillDefaults().numColumns(2).applyTo(content);\r
116 \r
117         // Label\r
118         Composite labelComposite = new Composite(content, SWT.NONE);\r
119         GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(labelComposite);\r
120         GridLayoutFactory.fillDefaults().numColumns(4).applyTo(labelComposite);\r
121         Label label = new Label(labelComposite, SWT.NONE);\r
122         label.setText("Name");\r
123 \r
124         TrackedText name = new TrackedText(labelComposite, support, SWT.BORDER);\r
125         name.setTextFactory(new StringPropertyFactory(Layer0.URIs.HasLabel));\r
126         name.addModifyListener(new StringPropertyModifier(context, Layer0.URIs.HasLabel));\r
127         name.addModifyListener(new StringPropertyModifier(context, Layer0.URIs.HasName));\r
128         name.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), name.getWidget())));\r
129         GridDataFactory.fillDefaults().grab(true, false).applyTo(name.getWidget());\r
130         \r
131         label = new Label(labelComposite, SWT.NONE);\r
132         label.setText("Seed");\r
133         \r
134         TrackedText seed = new TrackedText(labelComposite, support, SWT.BORDER);\r
135         seed.setTextFactory(new IntegerPropertyFactory(SysdynResource.URIs.SensitivityAnalysisExperiment_randomSeed));\r
136         seed.addModifyListener(new IntegerPropertyModifier(context, SysdynResource.URIs.SensitivityAnalysisExperiment_randomSeed));\r
137         seed.setInputValidator(new IntegerValidator());\r
138         seed.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), seed.getWidget())));\r
139         GridDataFactory.fillDefaults().hint(80, SWT.DEFAULT).applyTo(seed.getWidget());\r
140 \r
141 \r
142         // (Ontology-based) GraphExplorer displaying range axis and variables mapped to those axis\r
143         explorer = new AxisAndVariablesExplorerComposite(ArrayMap.keys(\r
144                 "displaySelectors", "displayFilter", "treeView").values(false, false, true), site, content, support, SWT.FULL_SELECTION | SWT.BORDER | SWT.SINGLE);\r
145         \r
146         explorer.setBrowseContexts(SysdynResource.URIs.SensitivityAnalysisExperiment_ParameterBrowseContext);\r
147         explorer.setInputSource(new SingleSelectionInputSource(\r
148                 Resource.class));\r
149         explorer.getExplorer().setAutoExpandLevel(2); // Expand everything in the beginning\r
150         explorer.setColumns( new Column[] { new Column(ColumnKeys.SINGLE, Align.LEFT, 0, "", true) });\r
151         explorer.finish();\r
152         \r
153         \r
154         ((Tree)explorer.getExplorerControl()).addSelectionListener(new SelectionAdapter() {\r
155             public void widgetSelected(SelectionEvent e) {\r
156                 updateSelection(context);\r
157             }\r
158         });\r
159 \r
160         /* Listener for displaying information of the first parameter during view initialization\r
161          * The view does not have focus, so normal selection listener mechanisms do not work. \r
162          * Need to do it the hard way. \r
163          */ \r
164         Listener listener = new Listener() {\r
165 \r
166             boolean flag = false;\r
167             @Override\r
168             public void handleEvent(Event event) {\r
169                 switch (event.type) {\r
170                     case SWT.Activate:\r
171                     case SWT.Show:\r
172                     case SWT.Paint:\r
173                     {\r
174                         if(!flag && ((Tree) event.widget).getItems().length > 0) {\r
175                             flag = true;\r
176                             TreeItem item = ((Tree) event.widget).getItems()[0];\r
177                             IAdaptable adaptable = (IAdaptable) item.getData();\r
178                             MapNodeContext nc = (MapNodeContext) adaptable.getAdapter(NodeContext.class);\r
179                             parameterSupport.fireInput(context, new StructuredSelection(nc.getConstant(BuiltinKeys.INPUT)));\r
180                             propertyContainer.setContent(content);\r
181                             Point size = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r
182                             propertyContainer.setMinSize(size);\r
183                         }\r
184                     }\r
185                 }\r
186             }\r
187         };\r
188 \r
189         Tree tree = explorer.getExplorerControl();\r
190         tree.addListener(SWT.Activate, listener);\r
191         tree.addListener(SWT.Show, listener);\r
192         tree.addListener(SWT.Paint,listener);\r
193         /* End listener for displaying information for first parameter during view initialization*/\r
194         \r
195         explorer.addDisposeListener(new DisposeListener() {\r
196             \r
197             @Override\r
198             public void widgetDisposed(DisposeEvent e) {\r
199                 if(contentListener != null)\r
200                     contentListener.dispose();              \r
201             }\r
202         });\r
203         \r
204         \r
205         GridDataFactory.fillDefaults().hint(250, SWT.DEFAULT).grab(false, true).applyTo(explorer);\r
206 \r
207         Group parameterPropertyGroup = new Group(content, SWT.NONE);\r
208         GridDataFactory.fillDefaults().grab(true, false).applyTo(parameterPropertyGroup);\r
209         GridLayoutFactory.fillDefaults().applyTo(parameterPropertyGroup);\r
210         \r
211         parameterProperties = new Composite(parameterPropertyGroup, SWT.NONE);\r
212         GridDataFactory.fillDefaults().grab(true, false).applyTo(parameterProperties);\r
213         GridLayoutFactory.fillDefaults().numColumns(2).applyTo(parameterProperties);\r
214 \r
215         // Label\r
216         label = new Label(parameterProperties, SWT.NONE);\r
217         label.setText("Variable:");\r
218         GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(label);\r
219 \r
220         TrackedText variable = new TrackedText(parameterProperties, parameterSupport, SWT.BORDER);\r
221         variable.setTextFactory(new StringPropertyFactory(SysdynResource.URIs.SensitivityAnalysisExperiment_Parameter_variable));\r
222         variable.addModifyListener(new VariableNameModifier(variable.getWidget(), parameterSupport, SysdynResource.URIs.SensitivityAnalysisExperiment_Parameter_variable, SysdynResource.URIs.SensitivityAnalysisExperiment_Parameter_indexes));\r
223         variable.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), variable.getWidget())));\r
224         variable.setInputValidator(new VariableExistsValidator(parameterSupport, variable));\r
225         GridDataFactory.fillDefaults().grab(true, false).applyTo(variable.getWidget());\r
226         \r
227         label = new Label(parameterProperties, SWT.NONE);\r
228         label.setText("Range:");\r
229         GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(label);\r
230         \r
231         RangeComposite rangeComposite = new RangeComposite(parameterProperties, context, parameterSupport, SWT.NONE) {\r
232             @Override\r
233             protected Resource getIndexRelation(ReadGraph graph) {\r
234                 return SysdynResource.getInstance(graph).SensitivityAnalysisExperiment_Parameter_indexes;\r
235             }\r
236         };\r
237         GridDataFactory.fillDefaults().grab(true, false).applyTo(rangeComposite);\r
238         \r
239 //        TrackedText variable = new TrackedText(parameterProperties, parameterSupport, SWT.BORDER);\r
240 //        variable.setTextFactory(new StringPropertyFactory(SysdynResource.URIs.SensitivityAnalysisExperiment_Parameter_variable));\r
241 //        variable.addModifyListener(new StringPropertyModifier(context, SysdynResource.URIs.SensitivityAnalysisExperiment_Parameter_variable));\r
242 //        variable.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), variable.getWidget())));\r
243 //        GridDataFactory.fillDefaults().grab(true, false).applyTo(variable.getWidget());\r
244 \r
245         label = new Label(parameterProperties, SWT.NONE);\r
246         label.setText("Number of values:");\r
247         GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(label);\r
248 \r
249 \r
250         TrackedText numValues = new TrackedText(parameterProperties, parameterSupport, SWT.BORDER);\r
251         numValues.setTextFactory(new IntegerPropertyFactory(SysdynResource.URIs.SensitivityAnalysisExperiment_Parameter_numberOfValues));\r
252         numValues.addModifyListener(new IntegerPropertyModifier(context, SysdynResource.URIs.SensitivityAnalysisExperiment_Parameter_numberOfValues));\r
253         numValues.setInputValidator(new IntegerValidator());\r
254         numValues.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), numValues.getWidget())));\r
255         GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).hint(80, SWT.DEFAULT).applyTo(numValues.getWidget());\r
256         \r
257         label = new Label(parameterProperties, SWT.NONE);\r
258         label.setText("Distribution:");\r
259         GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(label);\r
260 \r
261         TrackedCombo distributionSelector = new TrackedCombo(parameterProperties, parameterSupport, SWT.DROP_DOWN);\r
262         distributionSelector.setItemFactory(new ReadFactoryImpl<Resource, Map<String,Object>>() {\r
263 \r
264             @Override\r
265             public Map<String, Object> perform(ReadGraph graph, Resource input) throws DatabaseException {\r
266                 SysdynResource SR = SysdynResource.getInstance(graph);\r
267                 Map<String, Object> items = new HashMap<String, Object>();\r
268 \r
269                 items.put("Normal", SR.NormalDistribution);\r
270                 items.put("Uniform", SR.UniformDistribution);\r
271                 items.put("Interval", SR.Interval);\r
272 \r
273                 return items;\r
274             }\r
275 \r
276         });\r
277 \r
278         distributionSelector.setSelectionFactory(new ReadFactoryImpl<Resource, String>() {\r
279 \r
280             @Override\r
281             public String perform(ReadGraph graph, Resource parameter) throws DatabaseException {\r
282                 SysdynResource SR = SysdynResource.getInstance(graph);\r
283                 Resource distribution = graph.getPossibleObject(parameter, SR.SensitivityAnalysisExperiment_Parameter_propabilityDistribution);\r
284                 if(distribution == null)\r
285                     return null;\r
286                 \r
287                 if(graph.isInstanceOf(distribution, SR.UniformDistribution))\r
288                     return "Uniform";\r
289                 else if(graph.isInstanceOf(distribution, SR.NormalDistribution))\r
290                     return "Normal";\r
291                 else if(graph.isInstanceOf(distribution, SR.Interval))\r
292                     return "Interval";\r
293                 else\r
294                     return "";\r
295 \r
296             }\r
297         });\r
298 \r
299         distributionSelector.addModifyListener(new ComboModifyListenerImpl<Resource>() {\r
300 \r
301             @Override\r
302             public void applyText(WriteGraph graph, Resource input, String text)\r
303                     throws DatabaseException {\r
304                 if(text == null || text.isEmpty())\r
305                     return;\r
306 \r
307                 SysdynResource SR = SysdynResource.getInstance(graph);\r
308 \r
309                 Resource type = SR.UniformDistribution;\r
310 \r
311                 if("Normal".equals(text))\r
312                     type = SR.NormalDistribution;\r
313                 else if("Interval".equals(text))\r
314                     type = SR.Interval; \r
315 \r
316                 graph.deny(input, SR.SensitivityAnalysisExperiment_Parameter_propabilityDistribution);\r
317 \r
318                 GraphUtils.create2(graph, type,\r
319                         SR.SensitivityAnalysisExperiment_Parameter_propabilityDistribution_Inverse, input);\r
320 \r
321                 dirty = true;\r
322             }\r
323         });\r
324 \r
325         distributionSelector.addModifyListener(new TextModifyListener() {\r
326 \r
327             @Override\r
328             public void modifyText(TrackedModifyEvent e) {\r
329                 if(dirty) {\r
330                     parameterSupport.update();\r
331                     dirty = false;\r
332                     propertyContainer.setContent(content);\r
333                     Point size = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r
334                     propertyContainer.setMinSize(size);\r
335                 }\r
336             }\r
337         });\r
338 \r
339         label = new Label(parameterProperties, SWT.NONE);\r
340         \r
341         DistributionPropertyWidget dpw = new DistributionPropertyWidget(parameterProperties, context, parameterSupport, SWT.NONE);\r
342         GridDataFactory.fillDefaults().grab(true, true).applyTo(dpw);\r
343 \r
344         \r
345         Composite buttonComposite = new Composite(content, SWT.NONE);\r
346         GridDataFactory.fillDefaults().applyTo(buttonComposite);\r
347         GridLayoutFactory.fillDefaults().numColumns(3).applyTo(buttonComposite);\r
348         \r
349         \r
350         Button addVariable = new Button(buttonComposite, support, SWT.NONE);\r
351         addVariable.setText("Add parameter");\r
352         addVariable.addSelectionListener(new SelectionListenerImpl<Resource>(context) {\r
353 \r
354             @Override\r
355             public void apply(WriteGraph graph, Resource input) throws DatabaseException {\r
356                 SysdynResource sr = SysdynResource.getInstance(graph);\r
357                 Layer0 L0 = Layer0.getInstance(graph);\r
358                 \r
359                 Resource distribution = GraphUtils.create2(graph, sr.UniformDistribution,\r
360                         sr.UniformDistribution_minValue, 0.0,\r
361                         sr.UniformDistribution_maxValue, 10.0);\r
362                 \r
363                 Resource parameter = GraphUtils.create2(graph, sr.SensitivityAnalysisExperiment_Parameter,\r
364                         sr.SensitivityAnalysisExperiment_Parameter_propabilityDistribution, distribution,\r
365                         sr.SensitivityAnalysisExperiment_Parameter_variable, "",\r
366                         sr.SensitivityAnalysisExperiment_Parameter_numberOfValues, 10,\r
367                         L0.PartOf, input);\r
368                 \r
369                 Resource parameterList = graph.getPossibleObject(input, sr.SensitivityAnalysisExperiment_parameterList);\r
370                 ListUtils.insertBack(graph, parameterList, Collections.singleton(parameter));\r
371             }\r
372         });\r
373 \r
374         remove = new Button(buttonComposite, parameterSupport, SWT.NONE);\r
375         remove.setText("Remove");\r
376         remove.addSelectionListener(new SelectionListenerImpl<Resource>(context) {\r
377 \r
378             @Override\r
379             public void apply(WriteGraph graph, Resource input) throws DatabaseException {\r
380                 if(input == null)\r
381                     return;\r
382                 \r
383                 SysdynResource sr = SysdynResource.getInstance(graph);\r
384                 Layer0 L0 = Layer0.getInstance(graph);\r
385                 \r
386                 Resource experiment = graph.getPossibleObject(input, L0.PartOf);\r
387                 Resource parameterList = graph.getPossibleObject(experiment, sr.SensitivityAnalysisExperiment_parameterList);\r
388                 \r
389                 if(ListUtils.toList(graph, parameterList).size() > 1)\r
390                     ListUtils.removeElement(graph, parameterList, input);\r
391  \r
392             }\r
393             \r
394         });\r
395         \r
396 \r
397         propertyContainer.setContent(content);\r
398         Point size = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r
399         propertyContainer.setMinSize(size);\r
400 \r
401     }\r
402 \r
403 \r
404     /**\r
405      * Updates the content of propertyContainer  \r
406      * @param context\r
407      */\r
408     private void updateSelection(ISessionContext context) {\r
409         ISelectionProvider selectionProvider = (ISelectionProvider)explorer.getAdapter(ISelectionProvider.class);\r
410         IStructuredSelection selection = (IStructuredSelection)selectionProvider.getSelection();\r
411         parameterSupport.fireInput(context, selection);\r
412 \r
413         propertyContainer.setContent(content);\r
414         Point size = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r
415         propertyContainer.setMinSize(size);\r
416     }\r
417 \r
418 \r
419     @Override\r
420     public void setInput(ISessionContext context, Object input) {\r
421         experiment = AdaptionUtils.adaptToSingle(input, Resource.class);\r
422         if(contentListener == null) {\r
423             contentListener = new DisposableListener<Collection<Resource>>() {\r
424 \r
425                 @Override\r
426                 public void execute(Collection<Resource> result) {\r
427                     if(remove != null && !remove.getWidget().isDisposed() && result != null) {\r
428                         remove.getWidget().getDisplay().asyncExec(new RunnableWithObject(result) {\r
429                             @Override\r
430                             public void run() {\r
431                                 if(!remove.getWidget().isDisposed()) {\r
432                                     @SuppressWarnings("unchecked")\r
433                                     Collection<Resource> result = (Collection<Resource>) getObject();\r
434                                     if(result.size() > 1)\r
435                                         remove.getWidget().setEnabled(true);\r
436                                     else\r
437                                         remove.getWidget().setEnabled(false);\r
438                                 }\r
439                             }\r
440                         });\r
441 \r
442                     }\r
443                 }\r
444 \r
445                 @Override\r
446                 public void exception(Throwable t) {\r
447                     t.printStackTrace();\r
448                 }\r
449             };\r
450 \r
451             SimanticsUI.getSession().asyncRequest(new Read<Collection<Resource>> () {\r
452 \r
453                 @SuppressWarnings("unchecked")\r
454                 @Override\r
455                 public Collection<Resource> perform(ReadGraph graph) throws DatabaseException {\r
456                     return (Collection<Resource>) new ParameterChildRule().getChildren(graph, experiment);\r
457                 }\r
458 \r
459             }, contentListener);\r
460         }\r
461 \r
462         \r
463     }\r
464 \r
465 }\r