1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2011, 2014 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.sysdyn.ui.properties;
\r
14 import java.util.Collection;
\r
15 import java.util.Collections;
\r
16 import java.util.HashMap;
\r
17 import java.util.Map;
\r
19 import org.eclipse.core.runtime.IAdaptable;
\r
20 import org.eclipse.jface.layout.GridDataFactory;
\r
21 import org.eclipse.jface.layout.GridLayoutFactory;
\r
22 import org.eclipse.jface.resource.JFaceResources;
\r
23 import org.eclipse.jface.resource.LocalResourceManager;
\r
24 import org.eclipse.jface.viewers.ISelectionProvider;
\r
25 import org.eclipse.jface.viewers.IStructuredSelection;
\r
26 import org.eclipse.jface.viewers.StructuredSelection;
\r
27 import org.eclipse.swt.SWT;
\r
28 import org.eclipse.swt.custom.ScrolledComposite;
\r
29 import org.eclipse.swt.events.DisposeEvent;
\r
30 import org.eclipse.swt.events.DisposeListener;
\r
31 import org.eclipse.swt.events.SelectionAdapter;
\r
32 import org.eclipse.swt.events.SelectionEvent;
\r
33 import org.eclipse.swt.graphics.Point;
\r
34 import org.eclipse.swt.widgets.Composite;
\r
35 import org.eclipse.swt.widgets.Event;
\r
36 import org.eclipse.swt.widgets.Group;
\r
37 import org.eclipse.swt.widgets.Label;
\r
38 import org.eclipse.swt.widgets.Listener;
\r
39 import org.eclipse.swt.widgets.Tree;
\r
40 import org.eclipse.swt.widgets.TreeItem;
\r
41 import org.eclipse.ui.IWorkbenchSite;
\r
42 import org.simantics.browsing.ui.BuiltinKeys;
\r
43 import org.simantics.browsing.ui.Column;
\r
44 import org.simantics.browsing.ui.Column.Align;
\r
45 import org.simantics.browsing.ui.NodeContext;
\r
46 import org.simantics.browsing.ui.common.ColumnKeys;
\r
47 import org.simantics.browsing.ui.common.NodeContextBuilder.MapNodeContext;
\r
48 import org.simantics.browsing.ui.swt.SingleSelectionInputSource;
\r
49 import org.simantics.browsing.ui.swt.widgets.Button;
\r
50 import org.simantics.browsing.ui.swt.widgets.GraphExplorerComposite;
\r
51 import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory;
\r
52 import org.simantics.browsing.ui.swt.widgets.StringPropertyModifier;
\r
53 import org.simantics.browsing.ui.swt.widgets.TrackedCombo;
\r
54 import org.simantics.browsing.ui.swt.widgets.TrackedText;
\r
55 import org.simantics.browsing.ui.swt.widgets.impl.ComboModifyListenerImpl;
\r
56 import org.simantics.browsing.ui.swt.widgets.impl.ReadFactoryImpl;
\r
57 import org.simantics.browsing.ui.swt.widgets.impl.SelectionListenerImpl;
\r
58 import org.simantics.browsing.ui.swt.widgets.impl.TextModifyListener;
\r
59 import org.simantics.browsing.ui.swt.widgets.impl.TrackedModifyEvent;
\r
60 import org.simantics.browsing.ui.swt.widgets.impl.Widget;
\r
61 import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;
\r
62 import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupportImpl;
\r
63 import org.simantics.db.ReadGraph;
\r
64 import org.simantics.db.Resource;
\r
65 import org.simantics.db.WriteGraph;
\r
66 import org.simantics.db.common.procedure.adapter.DisposableListener;
\r
67 import org.simantics.db.common.utils.ListUtils;
\r
68 import org.simantics.db.exception.DatabaseException;
\r
69 import org.simantics.db.management.ISessionContext;
\r
70 import org.simantics.db.request.Read;
\r
71 import org.simantics.jfreechart.chart.ChartUtils;
\r
72 import org.simantics.jfreechart.chart.properties.AdjustableTab;
\r
73 import org.simantics.jfreechart.chart.properties.RangeComposite;
\r
74 import org.simantics.jfreechart.chart.properties.xyline.AxisAndVariablesExplorerComposite;
\r
75 import org.simantics.layer0.Layer0;
\r
76 import org.simantics.layer0.utils.direct.GraphUtils;
\r
77 import org.simantics.sysdyn.SysdynResource;
\r
78 import org.simantics.sysdyn.ui.properties.widgets.factories.IntegerPropertyFactory;
\r
79 import org.simantics.sysdyn.ui.properties.widgets.factories.IntegerPropertyModifier;
\r
80 import org.simantics.sysdyn.ui.properties.widgets.sensitivity.DistributionPropertyWidget;
\r
81 import org.simantics.sysdyn.ui.properties.widgets.sensitivity.ParameterChildRule;
\r
82 import org.simantics.sysdyn.ui.properties.widgets.sensitivity.VariableNameModifier;
\r
83 import org.simantics.sysdyn.ui.validation.ParameterExistsValidator;
\r
84 import org.simantics.ui.SimanticsUI;
\r
85 import org.simantics.utils.RunnableWithObject;
\r
86 import org.simantics.utils.datastructures.ArrayMap;
\r
87 import org.simantics.utils.ui.AdaptionUtils;
\r
88 import org.simantics.utils.ui.validators.IntegerValidator;
\r
91 * Tab for displaying sensitivity analysis experiment properties
\r
93 * @author Tuomas Miettinen
\r
96 public class SensitivityAnalysisExperimentTab extends AdjustableTab implements Widget {
\r
98 private GraphExplorerComposite explorer;
\r
99 private WidgetSupportImpl parameterSupport = new WidgetSupportImpl();
\r
100 private ScrolledComposite propertyContainer;
\r
101 private Composite parameterProperties;
\r
102 private Composite content;
\r
103 private Button remove;
\r
104 private Resource experiment;
\r
106 private boolean dirty = false;
\r
107 private boolean dirtyMethod = false;
\r
109 private DisposableListener<Collection<Resource>> contentListener;
\r
110 private Composite labelComposite;
\r
111 private Label labelName;
\r
112 private Label labelNumber;
\r
113 private Label labelMethod;
\r
114 private TrackedCombo methodSelector;
\r
115 private Label labelSeed;
\r
116 private TrackedText seed;
\r
118 private Composite buttonComposite;
\r
119 private Group parameterPropertyGroup;
\r
120 private Label labelVariable;
\r
121 private TrackedText variable;
\r
122 private Label labelRange;
\r
123 private RangeComposite rangeComposite;
\r
124 private Label labelDistribution;
\r
125 private TrackedCombo distributionSelector;
\r
126 private DistributionPropertyWidget dpw;
\r
127 private TrackedText name;
\r
128 private TrackedText n;
\r
129 private Button addVariable;
\r
132 public void createControls(Composite body, IWorkbenchSite site,
\r
133 final ISessionContext context, final WidgetSupport support) {
\r
134 support.register(this);
\r
135 super.createControls(body, site, context, support);
\r
139 * Updates the content of propertyContainer
\r
142 private void updateSelection(ISessionContext context) {
\r
143 ISelectionProvider selectionProvider = (ISelectionProvider)explorer.getAdapter(ISelectionProvider.class);
\r
144 IStructuredSelection selection = (IStructuredSelection)selectionProvider.getSelection();
\r
145 parameterSupport.fireInput(context, selection);
\r
147 propertyContainer.setContent(content);
\r
148 Point size = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);
\r
149 propertyContainer.setMinSize(size);
\r
154 public void setInput(ISessionContext context, Object input) {
\r
155 experiment = AdaptionUtils.adaptToSingle(input, Resource.class);
\r
156 if(contentListener == null) {
\r
157 contentListener = new DisposableListener<Collection<Resource>>() {
\r
160 public void execute(Collection<Resource> result) {
\r
161 if(remove != null && !remove.getWidget().isDisposed() && result != null) {
\r
162 remove.getWidget().getDisplay().asyncExec(new RunnableWithObject(result) {
\r
164 public void run() {
\r
165 if(!remove.getWidget().isDisposed()) {
\r
166 @SuppressWarnings("unchecked")
\r
167 Collection<Resource> result = (Collection<Resource>) getObject();
\r
168 if(result.size() > 1)
\r
169 remove.getWidget().setEnabled(true);
\r
171 remove.getWidget().setEnabled(false);
\r
180 public void exception(Throwable t) {
\r
181 t.printStackTrace();
\r
185 SimanticsUI.getSession().asyncRequest(new Read<Collection<Resource>> () {
\r
187 @SuppressWarnings("unchecked")
\r
189 public Collection<Resource> perform(ReadGraph graph) throws DatabaseException {
\r
190 return (Collection<Resource>) new ParameterChildRule().getChildren(graph, experiment);
\r
193 }, contentListener);
\r
200 protected void createAndAddControls(Composite body, IWorkbenchSite site,
\r
201 final ISessionContext context, final WidgetSupport support) {
\r
203 composite = new RemoveFocusBeforeExperimentComposite(body, SWT.NONE);
\r
205 // Scrolled composite for displaying properties of a selection in explorer
\r
206 propertyContainer = new ScrolledComposite(composite, SWT.H_SCROLL | SWT.V_SCROLL);
\r
207 propertyContainer.setExpandHorizontal(true);
\r
208 propertyContainer.setExpandVertical(true);
\r
210 content = new Composite(propertyContainer, SWT.NONE);
\r
213 labelComposite = new Composite(content, SWT.NONE);
\r
214 labelName = new Label(labelComposite, SWT.NONE);
\r
215 labelName.setText("Name");
\r
217 name = new TrackedText(labelComposite, support, SWT.BORDER);
\r
218 name.setTextFactory(new StringPropertyFactory(Layer0.URIs.HasLabel));
\r
219 name.addModifyListener(new StringPropertyModifier(context, Layer0.URIs.HasLabel));
\r
220 name.addModifyListener(new StringPropertyModifier(context, Layer0.URIs.HasName));
\r
221 name.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), name.getWidget())));
\r
223 labelNumber = new Label(labelComposite, SWT.NONE);
\r
224 labelNumber.setText("Number of runs");
\r
226 n = new TrackedText(labelComposite, support, SWT.BORDER);
\r
227 n.setTextFactory(new IntegerPropertyFactory(SysdynResource.URIs.SensitivityAnalysisExperiment_numberOfValues));
\r
228 n.addModifyListener(new IntegerPropertyModifier(context, SysdynResource.URIs.SensitivityAnalysisExperiment_numberOfValues));
\r
229 n.setInputValidator(new IntegerValidator());
\r
230 n.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), n.getWidget())));
\r
232 labelMethod = new Label(labelComposite, SWT.NONE);
\r
233 labelMethod.setText("Method");
\r
235 methodSelector = new TrackedCombo(labelComposite, support, SWT.DROP_DOWN);
\r
236 methodSelector.setItemFactory(new ReadFactoryImpl<Resource, Map<String,Object>>() {
\r
239 public Map<String, Object> perform(ReadGraph graph, Resource input) throws DatabaseException {
\r
240 SysdynResource SR = SysdynResource.getInstance(graph);
\r
241 Map<String, Object> items = new HashMap<String, Object>();
\r
243 items.put("Halton", SR.HaltonSequenceGenerator);
\r
244 items.put("Random", SR.RandomGenerator);
\r
250 methodSelector.setSelectionFactory(new ReadFactoryImpl<Resource, String>() {
\r
253 public String perform(ReadGraph graph, Resource parameter) throws DatabaseException {
\r
254 SysdynResource SR = SysdynResource.getInstance(graph);
\r
255 Resource method = graph.getPossibleObject(parameter, SR.SensitivityAnalysisExperiment_method);
\r
259 if(graph.isInstanceOf(method, SR.RandomGenerator))
\r
261 else if(graph.isInstanceOf(method, SR.HaltonSequenceGenerator))
\r
268 methodSelector.addModifyListener(new ComboModifyListenerImpl<Resource>() {
\r
271 public void applyText(WriteGraph graph, Resource input, String text)
\r
272 throws DatabaseException {
\r
273 if(text == null || text.isEmpty())
\r
276 SysdynResource SR = SysdynResource.getInstance(graph);
\r
278 Resource type = SR.RandomGenerator;
\r
280 if("Halton".equals(text))
\r
281 type = SR.HaltonSequenceGenerator;
\r
283 graph.deny(input, SR.SensitivityAnalysisExperiment_method);
\r
285 GraphUtils.create2(graph, type,
\r
286 SR.SensitivityAnalysisExperiment_method_Inverse, input);
\r
288 dirtyMethod = true;
\r
291 methodSelector.addModifyListener(new TextModifyListener() {
\r
294 public void modifyText(TrackedModifyEvent e) {
\r
297 dirtyMethod = false;
\r
298 propertyContainer.setContent(content);
\r
299 Point size = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);
\r
300 propertyContainer.setMinSize(size);
\r
305 labelSeed = new Label(labelComposite, SWT.NONE);
\r
306 labelSeed.setText("Seed");
\r
308 seed = new TrackedText(labelComposite, support, SWT.BORDER);
\r
309 seed.setTextFactory(new IntegerPropertyFactory(SysdynResource.URIs.SensitivityAnalysisExperiment_randomSeed));
\r
310 seed.addModifyListener(new IntegerPropertyModifier(context, SysdynResource.URIs.SensitivityAnalysisExperiment_randomSeed));
\r
311 seed.setInputValidator(new IntegerValidator());
\r
312 seed.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), seed.getWidget())));
\r
314 // (Ontology-based) GraphExplorer displaying range axis and variables mapped to those axis
\r
315 explorer = new AxisAndVariablesExplorerComposite(ArrayMap.keys(
\r
316 "displaySelectors", "displayFilter", "treeView").values(false, false, true), site, content, support, SWT.FULL_SELECTION | SWT.BORDER | SWT.SINGLE);
\r
318 explorer.setBrowseContexts(SysdynResource.URIs.SensitivityAnalysisExperiment_ParameterBrowseContext);
\r
319 explorer.setInputSource(new SingleSelectionInputSource(
\r
321 explorer.getExplorer().setAutoExpandLevel(2); // Expand everything in the beginning
\r
322 explorer.setColumns( new Column[] { new Column(ColumnKeys.SINGLE, Align.LEFT, 0, "", true) });
\r
326 ((Tree)explorer.getExplorerControl()).addSelectionListener(new SelectionAdapter() {
\r
327 public void widgetSelected(SelectionEvent e) {
\r
328 updateSelection(context);
\r
332 /* Listener for displaying information of the first parameter during view initialization
\r
333 * The view does not have focus, so normal selection listener mechanisms do not work.
\r
334 * Need to do it the hard way.
\r
336 Listener listener = new Listener() {
\r
338 boolean flag = false;
\r
340 public void handleEvent(Event event) {
\r
341 switch (event.type) {
\r
346 if(!flag && ((Tree) event.widget).getItems().length > 0) {
\r
348 TreeItem item = ((Tree) event.widget).getItems()[0];
\r
349 IAdaptable adaptable = (IAdaptable) item.getData();
\r
350 MapNodeContext nc = (MapNodeContext) adaptable.getAdapter(NodeContext.class);
\r
351 parameterSupport.fireInput(context, new StructuredSelection(nc.getConstant(BuiltinKeys.INPUT)));
\r
352 propertyContainer.setContent(content);
\r
353 Point size = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);
\r
354 propertyContainer.setMinSize(size);
\r
361 tree = explorer.getExplorerControl();
\r
362 tree.addListener(SWT.Activate, listener);
\r
363 tree.addListener(SWT.Show, listener);
\r
364 tree.addListener(SWT.Paint,listener);
\r
365 /* End listener for displaying information for first parameter during view initialization*/
\r
367 explorer.addDisposeListener(new DisposeListener() {
\r
370 public void widgetDisposed(DisposeEvent e) {
\r
371 if(contentListener != null)
\r
372 contentListener.dispose();
\r
377 buttonComposite = new Composite(explorer, SWT.NONE);
\r
379 addVariable = new Button(buttonComposite, support, SWT.NONE);
\r
380 addVariable.setText("Add parameter");
\r
381 addVariable.addSelectionListener(new SelectionListenerImpl<Resource>(context) {
\r
384 public void apply(WriteGraph graph, Resource input) throws DatabaseException {
\r
385 SysdynResource sr = SysdynResource.getInstance(graph);
\r
386 Layer0 L0 = Layer0.getInstance(graph);
\r
388 Resource distribution = GraphUtils.create2(graph, sr.UniformDistribution,
\r
389 sr.UniformDistribution_minValue, 0.0,
\r
390 sr.UniformDistribution_maxValue, 10.0);
\r
392 Resource parameter = GraphUtils.create2(graph, sr.SensitivityAnalysisExperiment_Parameter,
\r
393 sr.SensitivityAnalysisExperiment_Parameter_propabilityDistribution, distribution,
\r
394 sr.SensitivityAnalysisExperiment_Parameter_variable, ChartUtils.emptyVariableName,
\r
397 Resource parameterList = graph.getPossibleObject(input, sr.SensitivityAnalysisExperiment_parameterList);
\r
398 ListUtils.insertBack(graph, parameterList, Collections.singleton(parameter));
\r
402 remove = new Button(buttonComposite, parameterSupport, SWT.NONE);
\r
403 remove.setText("Remove");
\r
404 remove.addSelectionListener(new SelectionListenerImpl<Resource>(context) {
\r
407 public void apply(WriteGraph graph, Resource input) throws DatabaseException {
\r
411 SysdynResource sr = SysdynResource.getInstance(graph);
\r
412 Layer0 L0 = Layer0.getInstance(graph);
\r
414 Resource experiment = graph.getPossibleObject(input, L0.PartOf);
\r
415 Resource parameterList = graph.getPossibleObject(experiment, sr.SensitivityAnalysisExperiment_parameterList);
\r
417 if(ListUtils.toList(graph, parameterList).size() > 1)
\r
418 ListUtils.removeElement(graph, parameterList, input);
\r
423 propertyContainer.setContent(content);
\r
426 parameterPropertyGroup = new Group(content, SWT.NONE);
\r
428 parameterProperties = new Composite(parameterPropertyGroup, SWT.NONE);
\r
431 labelVariable = new Label(parameterProperties, SWT.NONE);
\r
432 labelVariable.setText("Variable:");
\r
434 variable = new TrackedText(parameterProperties, parameterSupport, SWT.BORDER);
\r
435 variable.setTextFactory(new StringPropertyFactory(SysdynResource.URIs.SensitivityAnalysisExperiment_Parameter_variable));
\r
436 variable.addModifyListener(new VariableNameModifier(variable.getWidget(), parameterSupport, SysdynResource.URIs.SensitivityAnalysisExperiment_Parameter_variable, SysdynResource.URIs.SensitivityAnalysisExperiment_Parameter_indexes));
\r
437 variable.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), variable.getWidget())));
\r
438 variable.setInputValidator(new ParameterExistsValidator(parameterSupport, variable));
\r
440 labelRange = new Label(parameterProperties, SWT.NONE);
\r
441 labelRange.setText("Range:");
\r
443 rangeComposite = new RangeComposite(parameterProperties, context, parameterSupport, SWT.NONE) {
\r
445 protected Resource getIndexRelation(ReadGraph graph) {
\r
446 return SysdynResource.getInstance(graph).SensitivityAnalysisExperiment_Parameter_indexes;
\r
450 // TrackedText variable = new TrackedText(parameterProperties, parameterSupport, SWT.BORDER);
\r
451 // variable.setTextFactory(new StringPropertyFactory(SysdynResource.URIs.SensitivityAnalysisExperiment_Parameter_variable));
\r
452 // variable.addModifyListener(new StringPropertyModifier(context, SysdynResource.URIs.SensitivityAnalysisExperiment_Parameter_variable));
\r
453 // variable.setColorProvider(new SysdynBasicColorProvider(new LocalResourceManager(JFaceResources.getResources(), variable.getWidget())));
\r
454 // GridDataFactory.fillDefaults().grab(true, false).applyTo(variable.getWidget());
\r
456 labelDistribution = new Label(parameterProperties, SWT.NONE);
\r
457 labelDistribution.setText("Distribution:");
\r
459 distributionSelector = new TrackedCombo(parameterProperties, parameterSupport, SWT.DROP_DOWN);
\r
460 distributionSelector.setItemFactory(new ReadFactoryImpl<Resource, Map<String,Object>>() {
\r
463 public Map<String, Object> perform(ReadGraph graph, Resource input) throws DatabaseException {
\r
464 SysdynResource SR = SysdynResource.getInstance(graph);
\r
465 Map<String, Object> items = new HashMap<String, Object>();
\r
467 items.put("Normal", SR.NormalDistribution);
\r
468 items.put("Uniform", SR.UniformDistribution);
\r
469 items.put("Interval", SR.Interval);
\r
476 distributionSelector.setSelectionFactory(new ReadFactoryImpl<Resource, String>() {
\r
479 public String perform(ReadGraph graph, Resource parameter) throws DatabaseException {
\r
480 SysdynResource SR = SysdynResource.getInstance(graph);
\r
481 Resource distribution = graph.getPossibleObject(parameter, SR.SensitivityAnalysisExperiment_Parameter_propabilityDistribution);
\r
482 if(distribution == null)
\r
485 if(graph.isInstanceOf(distribution, SR.UniformDistribution))
\r
487 else if(graph.isInstanceOf(distribution, SR.NormalDistribution))
\r
489 else if(graph.isInstanceOf(distribution, SR.Interval))
\r
497 distributionSelector.addModifyListener(new ComboModifyListenerImpl<Resource>() {
\r
500 public void applyText(WriteGraph graph, Resource input, String text)
\r
501 throws DatabaseException {
\r
502 if(text == null || text.isEmpty())
\r
505 SysdynResource SR = SysdynResource.getInstance(graph);
\r
507 Resource type = SR.UniformDistribution;
\r
509 if("Normal".equals(text))
\r
510 type = SR.NormalDistribution;
\r
511 else if("Interval".equals(text))
\r
512 type = SR.Interval;
\r
514 graph.deny(input, SR.SensitivityAnalysisExperiment_Parameter_propabilityDistribution);
\r
516 GraphUtils.create2(graph, type,
\r
517 SR.SensitivityAnalysisExperiment_Parameter_propabilityDistribution_Inverse, input);
\r
523 distributionSelector.addModifyListener(new TextModifyListener() {
\r
526 public void modifyText(TrackedModifyEvent e) {
\r
528 parameterSupport.update();
\r
530 propertyContainer.setContent(content);
\r
531 Point size = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);
\r
532 propertyContainer.setMinSize(size);
\r
537 dpw = new DistributionPropertyWidget(parameterProperties, context, parameterSupport, SWT.NONE);
\r
542 protected void createControlLayoutVertical() {
\r
544 GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
\r
545 GridLayoutFactory.fillDefaults().margins(3, 3).applyTo(composite);
\r
547 // Scrolled composite for displaying properties of a selection in explorer
\r
548 GridDataFactory.fillDefaults().grab(true, true).applyTo(propertyContainer);
\r
549 GridLayoutFactory.fillDefaults().applyTo(propertyContainer);
\r
551 GridDataFactory.fillDefaults().grab(true, true).applyTo(content);
\r
552 GridLayoutFactory.fillDefaults().numColumns(1).applyTo(content);
\r
555 GridDataFactory.fillDefaults().grab(true, false).span(1, 1).applyTo(labelComposite);
\r
556 GridLayoutFactory.fillDefaults().numColumns(2).applyTo(labelComposite);
\r
558 GridDataFactory.fillDefaults().grab(true, false).applyTo(name.getWidget());
\r
560 GridDataFactory.fillDefaults().hint(50, SWT.DEFAULT).applyTo(n.getWidget());
\r
562 GridDataFactory.fillDefaults().hint(50, SWT.DEFAULT).applyTo(seed.getWidget());
\r
564 GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).grab(false, true).applyTo(explorer);
\r
566 GridDataFactory.fillDefaults().applyTo(buttonComposite);
\r
567 GridLayoutFactory.fillDefaults().numColumns(3).applyTo(buttonComposite);
\r
569 Point tsize = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);
\r
570 propertyContainer.setMinSize(tsize);
\r
571 GridDataFactory.fillDefaults().grab(true, false).applyTo(parameterPropertyGroup);
\r
572 GridLayoutFactory.fillDefaults().applyTo(parameterPropertyGroup);
\r
574 GridDataFactory.fillDefaults().grab(true, false).applyTo(parameterProperties);
\r
575 GridLayoutFactory.fillDefaults().numColumns(3).applyTo(parameterProperties);
\r
578 GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(labelVariable);
\r
580 GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(variable.getWidget());
\r
582 GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(labelRange);
\r
584 GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(rangeComposite);
\r
586 GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(labelDistribution);
\r
588 GridDataFactory.fillDefaults().span(3, 1).grab(true, true).applyTo(dpw);
\r
589 GridLayoutFactory.fillDefaults().margins(6, 0).applyTo(dpw);
\r
593 protected void createControlLayoutHorizontal(boolean wideScreen) {
\r
594 GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
\r
595 GridLayoutFactory.fillDefaults().margins(3, 3).applyTo(composite);
\r
597 // Scrolled composite for displaying properties of a selection in explorer
\r
598 GridDataFactory.fillDefaults().grab(true, true).applyTo(propertyContainer);
\r
599 GridLayoutFactory.fillDefaults().applyTo(propertyContainer);
\r
601 GridDataFactory.fillDefaults().grab(true, true).applyTo(content);
\r
602 GridLayoutFactory.fillDefaults().numColumns(2).applyTo(content);
\r
605 GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(labelComposite);
\r
606 GridLayoutFactory.fillDefaults().numColumns(8).applyTo(labelComposite);
\r
608 GridDataFactory.fillDefaults().grab(true, false).applyTo(name.getWidget());
\r
610 GridDataFactory.fillDefaults().hint(50, SWT.DEFAULT).applyTo(n.getWidget());
\r
612 GridDataFactory.fillDefaults().hint(50, SWT.DEFAULT).applyTo(seed.getWidget());
\r
614 GridDataFactory.fillDefaults().hint(250, SWT.DEFAULT).grab(false, true).applyTo(explorer);
\r
616 GridDataFactory.fillDefaults().applyTo(buttonComposite);
\r
617 GridLayoutFactory.fillDefaults().numColumns(3).applyTo(buttonComposite);
\r
619 Point tsize = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);
\r
620 propertyContainer.setMinSize(tsize);
\r
621 GridDataFactory.fillDefaults().grab(true, false).applyTo(parameterPropertyGroup);
\r
622 GridLayoutFactory.fillDefaults().applyTo(parameterPropertyGroup);
\r
624 GridDataFactory.fillDefaults().grab(true, false).applyTo(parameterProperties);
\r
625 GridLayoutFactory.fillDefaults().numColumns(3).applyTo(parameterProperties);
\r
628 GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(labelVariable);
\r
630 GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(variable.getWidget());
\r
632 GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(labelRange);
\r
634 GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(rangeComposite);
\r
636 GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(labelDistribution);
\r
638 GridDataFactory.fillDefaults().span(1, 1).grab(true, true).applyTo(dpw);
\r
639 GridLayoutFactory.fillDefaults().margins(6, 0).applyTo(dpw);
\r