r,\r
"General"));\r
tabs.add(new ComparableTabContributor(\r
- new BarSeriesTab(),\r
+ new BarSeriesTab(options),\r
9,\r
r,\r
"Variables"));\r
r,\r
"General"));\r
tabs.add(new ComparableTabContributor(\r
- new PieSeriesTab(),\r
+ new PieSeriesTab(options),\r
9,\r
r,\r
"Variables"));\r
r,\r
"General"));\r
tabs.add(new ComparableTabContributor(\r
- new BarSeriesTab2(),\r
+ new BarSeriesTab2(options),\r
9,\r
r,\r
"Variables"));\r
r,\r
"General"));\r
tabs.add(new ComparableTabContributor(\r
- new PieSeriesTab2(),\r
+ new PieSeriesTab2(options),\r
9,\r
r,\r
"Variables"));\r
import org.simantics.browsing.ui.swt.widgets.TrackedText;\r
import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
import org.simantics.db.management.ISessionContext;\r
+import org.simantics.jfreechart.ChartPropertyOptions;\r
import org.simantics.jfreechart.chart.properties.DoubleValidator;\r
import org.simantics.jfreechart.chart.properties.JFreeChartPropertyColorProvider;\r
import org.simantics.jfreechart.chart.properties.RVIFactory;\r
\r
private TrackedText variable, label, time;\r
\r
- public BarSeriesPropertyComposite(Composite parent, final ISessionContext context, WidgetSupport support, int style) {\r
+ public BarSeriesPropertyComposite(Composite parent, final ISessionContext context, WidgetSupport support, int options, int style) {\r
super(parent, style);\r
\r
GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(2).applyTo(this);\r
GridDataFactory.fillDefaults().grab(true, false).applyTo(this.label.getWidget());\r
\r
// Time\r
- label = new Label(this, SWT.NONE);\r
- GridDataFactory.fillDefaults().align(SWT.END, SWT.FILL).applyTo(label);\r
- label.setText("Time:");\r
- \r
- Composite composite = new Composite(this, SWT.NONE);\r
- GridDataFactory.fillDefaults().applyTo(composite);\r
- GridLayoutFactory.fillDefaults().applyTo(composite);\r
- \r
- time = new org.simantics.browsing.ui.swt.widgets.TrackedText(composite, support, SWT.BORDER);\r
- time.setTextFactory(new DoublePropertyFactory(JFreeChartResource.URIs.Series_time));\r
- time.addModifyListener(new DoublePropertyModifier(context, JFreeChartResource.URIs.Series_time));\r
- time.setInputValidator(new DoubleValidator(true));\r
- time.setColorProvider(new JFreeChartPropertyColorProvider(time.getResourceManager()));\r
- GridDataFactory.fillDefaults().applyTo(time.getWidget());\r
+ if ((options & ChartPropertyOptions.SHOW_TIME) > 0) {\r
+ label = new Label(this, SWT.NONE);\r
+ GridDataFactory.fillDefaults().align(SWT.END, SWT.FILL).applyTo(label);\r
+ label.setText("Time:");\r
+ \r
+ Composite composite = new Composite(this, SWT.NONE);\r
+ GridDataFactory.fillDefaults().applyTo(composite);\r
+ GridLayoutFactory.fillDefaults().applyTo(composite);\r
+ \r
+ time = new org.simantics.browsing.ui.swt.widgets.TrackedText(composite, support, SWT.BORDER);\r
+ time.setTextFactory(new DoublePropertyFactory(JFreeChartResource.URIs.Series_time));\r
+ time.addModifyListener(new DoublePropertyModifier(context, JFreeChartResource.URIs.Series_time));\r
+ time.setInputValidator(new DoubleValidator(true));\r
+ time.setColorProvider(new JFreeChartPropertyColorProvider(time.getResourceManager()));\r
+ GridDataFactory.fillDefaults().applyTo(time.getWidget());\r
+ }\r
}\r
}\r
import org.simantics.browsing.ui.swt.widgets.TrackedText;\r
import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
import org.simantics.db.management.ISessionContext;\r
+import org.simantics.jfreechart.ChartPropertyOptions;\r
import org.simantics.jfreechart.chart.properties.ChartVariable;\r
import org.simantics.jfreechart.chart.properties.ChartVariableFactory;\r
import org.simantics.jfreechart.chart.properties.ChartVariableModifier;\r
private TrackedText label, time;\r
private StringChooser<ChartVariable> variable;\r
\r
- public BarSeriesPropertyComposite2(Composite parent, final ISessionContext context, WidgetSupport support, Collection<ChartVariable> variables, int style) {\r
+ public BarSeriesPropertyComposite2(Composite parent, final ISessionContext context, WidgetSupport support, Collection<ChartVariable> variables, int options, int style) {\r
super(parent, style);\r
\r
GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(2).applyTo(this);\r
this.label.setColorProvider(new JFreeChartPropertyColorProvider(this.label.getResourceManager()));\r
GridDataFactory.fillDefaults().grab(true, false).applyTo(this.label.getWidget());\r
\r
- // Time\r
- label = new Label(this, SWT.NONE);\r
- GridDataFactory.fillDefaults().align(SWT.END, SWT.FILL).applyTo(label);\r
- label.setText("Time:");\r
- \r
- Composite composite = new Composite(this, SWT.NONE);\r
- GridDataFactory.fillDefaults().applyTo(composite);\r
- GridLayoutFactory.fillDefaults().applyTo(composite);\r
- \r
- time = new org.simantics.browsing.ui.swt.widgets.TrackedText(composite, support, SWT.BORDER);\r
- time.setTextFactory(new DoublePropertyFactory(JFreeChartResource.URIs.Series_time));\r
- time.addModifyListener(new DoublePropertyModifier(context, JFreeChartResource.URIs.Series_time));\r
- time.setInputValidator(new DoubleValidator(true));\r
- time.setColorProvider(new JFreeChartPropertyColorProvider(time.getResourceManager()));\r
- GridDataFactory.fillDefaults().applyTo(time.getWidget());\r
+ if ((options & ChartPropertyOptions.SHOW_TIME) > 0) {\r
+ // Time\r
+ label = new Label(this, SWT.NONE);\r
+ GridDataFactory.fillDefaults().align(SWT.END, SWT.FILL).applyTo(label);\r
+ label.setText("Time:");\r
+ \r
+ Composite composite = new Composite(this, SWT.NONE);\r
+ GridDataFactory.fillDefaults().applyTo(composite);\r
+ GridLayoutFactory.fillDefaults().applyTo(composite);\r
+ \r
+ time = new org.simantics.browsing.ui.swt.widgets.TrackedText(composite, support, SWT.BORDER);\r
+ time.setTextFactory(new DoublePropertyFactory(JFreeChartResource.URIs.Series_time));\r
+ time.addModifyListener(new DoublePropertyModifier(context, JFreeChartResource.URIs.Series_time));\r
+ time.setInputValidator(new DoubleValidator(true));\r
+ time.setColorProvider(new JFreeChartPropertyColorProvider(time.getResourceManager()));\r
+ GridDataFactory.fillDefaults().applyTo(time.getWidget());\r
+ }\r
}\r
}\r
private Button add, remove;\r
private Resource chartResource;\r
private BarSeriesPropertyComposite spc;\r
+ private int options;\r
\r
-\r
- public BarSeriesTab() {\r
+ public BarSeriesTab(int options) {\r
additionalSupport = new WidgetSupportImpl();\r
+ this.options = options;\r
}\r
\r
@Override\r
for(Control child : propertyContainer.getChildren()) {\r
child.dispose();\r
}\r
- spc = new BarSeriesPropertyComposite(propertyContainer, context, additionalSupport, SWT.NONE);\r
+ spc = new BarSeriesPropertyComposite(propertyContainer, context, additionalSupport, options,SWT.NONE);\r
\r
additionalSupport.fireInput(context, selection);\r
\r
private Button add, remove;\r
private Resource chartResource;\r
private BarSeriesPropertyComposite2 spc;\r
+ private int options;\r
\r
-\r
- public BarSeriesTab2() {\r
+ public BarSeriesTab2(int options) {\r
additionalSupport = new WidgetSupportImpl();\r
+ this.options = options;\r
}\r
\r
@Override\r
try {\r
Collection<ChartVariable> variables = context.getSession().syncRequest(new AllVariablesOfModel(resource));\r
\r
- spc = new BarSeriesPropertyComposite2(propertyContainer, context, additionalSupport, variables, SWT.NONE);\r
+ spc = new BarSeriesPropertyComposite2(propertyContainer, context, additionalSupport, variables, options, SWT.NONE);\r
\r
additionalSupport.fireInput(context, selection);\r
\r
import org.simantics.browsing.ui.swt.widgets.TrackedText;\r
import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
import org.simantics.db.management.ISessionContext;\r
+import org.simantics.jfreechart.ChartPropertyOptions;\r
import org.simantics.jfreechart.chart.properties.BooleanPropertyFactory;\r
import org.simantics.jfreechart.chart.properties.BooleanSelectionListener;\r
import org.simantics.jfreechart.chart.properties.ColorPicker;\r
\r
private TrackedText variable, label, time;\r
\r
- public PieSeriesPropertyComposite(Composite parent, ISessionContext context, WidgetSupport support, int style) {\r
+ public PieSeriesPropertyComposite(Composite parent, ISessionContext context, WidgetSupport support, int options, int style) {\r
super(parent, style);\r
\r
GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(2).applyTo(this);\r
GridDataFactory.fillDefaults().grab(true, false).applyTo(colorPicker);\r
\r
// Time\r
- label = new Label(this, SWT.NONE);\r
- GridDataFactory.fillDefaults().align(SWT.END, SWT.FILL).applyTo(label);\r
- label.setText("Time:");\r
- \r
- Composite composite = new Composite(this, SWT.NONE);\r
- GridDataFactory.fillDefaults().applyTo(composite);\r
- GridLayoutFactory.fillDefaults().applyTo(composite);\r
- \r
- time = new org.simantics.browsing.ui.swt.widgets.TrackedText(composite, support, SWT.BORDER);\r
- time.setTextFactory(new DoublePropertyFactory(JFreeChartResource.URIs.Series_time));\r
- time.addModifyListener(new DoublePropertyModifier(context, JFreeChartResource.URIs.Series_time));\r
- time.setInputValidator(new DoubleValidator(true));\r
- time.setColorProvider(new JFreeChartPropertyColorProvider(time.getResourceManager()));\r
- GridDataFactory.fillDefaults().applyTo(time.getWidget());\r
- \r
+ if ((options & ChartPropertyOptions.SHOW_TIME) > 0) {\r
+ label = new Label(this, SWT.NONE);\r
+ GridDataFactory.fillDefaults().align(SWT.END, SWT.FILL).applyTo(label);\r
+ label.setText("Time:");\r
+ \r
+ Composite composite = new Composite(this, SWT.NONE);\r
+ GridDataFactory.fillDefaults().applyTo(composite);\r
+ GridLayoutFactory.fillDefaults().applyTo(composite);\r
+ \r
+ time = new org.simantics.browsing.ui.swt.widgets.TrackedText(composite, support, SWT.BORDER);\r
+ time.setTextFactory(new DoublePropertyFactory(JFreeChartResource.URIs.Series_time));\r
+ time.addModifyListener(new DoublePropertyModifier(context, JFreeChartResource.URIs.Series_time));\r
+ time.setInputValidator(new DoubleValidator(true));\r
+ time.setColorProvider(new JFreeChartPropertyColorProvider(time.getResourceManager()));\r
+ GridDataFactory.fillDefaults().applyTo(time.getWidget());\r
+ }\r
// Exploded\r
label = new Label(this, SWT.NONE);\r
label.setText("");\r
import org.simantics.browsing.ui.swt.widgets.TrackedText;\r
import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
import org.simantics.db.management.ISessionContext;\r
+import org.simantics.jfreechart.ChartPropertyOptions;\r
import org.simantics.jfreechart.chart.properties.BooleanPropertyFactory;\r
import org.simantics.jfreechart.chart.properties.BooleanSelectionListener;\r
import org.simantics.jfreechart.chart.properties.ChartVariable;\r
private TrackedText label, time;\r
private StringChooser<ChartVariable> variable;\r
\r
- public PieSeriesPropertyComposite2(Composite parent, ISessionContext context, WidgetSupport support, Collection<ChartVariable> variables,int style) {\r
+ public PieSeriesPropertyComposite2(Composite parent, ISessionContext context, WidgetSupport support, Collection<ChartVariable> variables,int options, int style) {\r
super(parent, style);\r
\r
GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(2).applyTo(this);\r
Composite colorPicker = new ColorPicker(this, context, support, SWT.NONE);\r
GridDataFactory.fillDefaults().grab(true, false).applyTo(colorPicker);\r
\r
- // Time\r
- label = new Label(this, SWT.NONE);\r
- GridDataFactory.fillDefaults().align(SWT.END, SWT.FILL).applyTo(label);\r
- label.setText("Time:");\r
- \r
- Composite composite = new Composite(this, SWT.NONE);\r
- GridDataFactory.fillDefaults().applyTo(composite);\r
- GridLayoutFactory.fillDefaults().applyTo(composite);\r
- \r
- time = new org.simantics.browsing.ui.swt.widgets.TrackedText(composite, support, SWT.BORDER);\r
- time.setTextFactory(new DoublePropertyFactory(JFreeChartResource.URIs.Series_time));\r
- time.addModifyListener(new DoublePropertyModifier(context, JFreeChartResource.URIs.Series_time));\r
- time.setInputValidator(new DoubleValidator(true));\r
- time.setColorProvider(new JFreeChartPropertyColorProvider(time.getResourceManager()));\r
- GridDataFactory.fillDefaults().applyTo(time.getWidget());\r
- \r
+ if ((options & ChartPropertyOptions.SHOW_TIME) > 0) {\r
+ // Time\r
+ label = new Label(this, SWT.NONE);\r
+ GridDataFactory.fillDefaults().align(SWT.END, SWT.FILL).applyTo(label);\r
+ label.setText("Time:");\r
+ \r
+ Composite composite = new Composite(this, SWT.NONE);\r
+ GridDataFactory.fillDefaults().applyTo(composite);\r
+ GridLayoutFactory.fillDefaults().applyTo(composite);\r
+ \r
+ time = new org.simantics.browsing.ui.swt.widgets.TrackedText(composite, support, SWT.BORDER);\r
+ time.setTextFactory(new DoublePropertyFactory(JFreeChartResource.URIs.Series_time));\r
+ time.addModifyListener(new DoublePropertyModifier(context, JFreeChartResource.URIs.Series_time));\r
+ time.setInputValidator(new DoubleValidator(true));\r
+ time.setColorProvider(new JFreeChartPropertyColorProvider(time.getResourceManager()));\r
+ GridDataFactory.fillDefaults().applyTo(time.getWidget());\r
+ }\r
// Exploded\r
label = new Label(this, SWT.NONE);\r
label.setText("");\r
private WidgetSupportImpl additionalSupport;\r
private Button add, remove;\r
private Resource chartResource;\r
-\r
- public PieSeriesTab() {\r
+ private int options;\r
+ \r
+ public PieSeriesTab(int options) {\r
additionalSupport = new WidgetSupportImpl();\r
+ this.options = options;\r
}\r
\r
@Override\r
child.dispose();\r
}\r
\r
- PieSeriesPropertyComposite spc = new PieSeriesPropertyComposite(propertyContainer, context, additionalSupport, SWT.NONE);\r
+ PieSeriesPropertyComposite spc = new PieSeriesPropertyComposite(propertyContainer, context, additionalSupport, options,SWT.NONE);\r
propertyContainer.setContent(spc);\r
Point size = spc.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r
propertyContainer.setMinSize(size);\r
private WidgetSupportImpl additionalSupport;\r
private Button add, remove;\r
private Resource chartResource;\r
+ private int options;\r
\r
- public PieSeriesTab2() {\r
+ public PieSeriesTab2(int options) {\r
additionalSupport = new WidgetSupportImpl();\r
+ this.options = options;\r
}\r
\r
@Override\r
\r
try {\r
Collection<ChartVariable> variables = context.getSession().syncRequest(new AllVariablesOfModel(resource));\r
- PieSeriesPropertyComposite2 spc = new PieSeriesPropertyComposite2(propertyContainer, context, additionalSupport, variables, SWT.NONE);\r
+ PieSeriesPropertyComposite2 spc = new PieSeriesPropertyComposite2(propertyContainer, context, additionalSupport, variables, options, SWT.NONE);\r
propertyContainer.setContent(spc);\r
Point size = spc.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r
propertyContainer.setMinSize(size);\r