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