\r
final private String propertyURI;\r
final private String typeUri;\r
+ final private boolean defaultValue;\r
\r
/**\r
* Boolean selection listener for property with propertyURI\r
* @param propertyURI uri of the boolean property\r
*/\r
public BooleanSelectionListener(ISessionContext context, String propertyURI) {\r
- this(context, null, propertyURI);\r
+ this(context, null, propertyURI, false);\r
}\r
\r
/**\r
* @param context ISessionContext\r
* @param typeUri URI for a resource (resource ConsistsOf type) (null allowed -> not used)\r
* @param propertyURI uri of the boolean property\r
+ * @param defaultValue expected value if the property does not exist\r
*/\r
- public BooleanSelectionListener(ISessionContext context, String typeUri, String propertyURI) {\r
+ public BooleanSelectionListener(ISessionContext context, String typeUri, String propertyURI, boolean defaultValue) {\r
super(context);\r
this.propertyURI = propertyURI;\r
this.typeUri = typeUri;\r
+ this.defaultValue = defaultValue;\r
}\r
+ \r
+ public BooleanSelectionListener(ISessionContext context, String typeUri, String propertyURI) {\r
+ this(context, typeUri, propertyURI, false);\r
+ }\r
+\r
\r
@Override\r
public void apply(WriteGraph graph, Resource chart) throws DatabaseException {\r
private void setValue(WriteGraph graph, Resource resource) throws DatabaseException {\r
Resource property = graph.getResource(propertyURI);\r
Boolean value = graph.getPossibleRelatedValue(resource, property, Bindings.BOOLEAN);\r
- graph.claimLiteral(resource, property, Boolean.FALSE.equals(value));\r
+ if (value == null)\r
+ graph.claimLiteral(resource, property, !defaultValue);\r
+ else\r
+ graph.claimLiteral(resource, property, Boolean.FALSE.equals(value));\r
}\r
}
\ No newline at end of file
hgrid = new Button(hideGroup, support, SWT.CHECK);\r
hgrid.setText("Grid");\r
hgrid.setSelectionFactory(new BooleanPropertyFactory(JFreeChartResource.URIs.Plot, JFreeChartResource.URIs.Plot_visibleGrid, true));\r
- hgrid.addSelectionListener(new BooleanSelectionListener(context, JFreeChartResource.URIs.Plot, JFreeChartResource.URIs.Plot_visibleGrid));\r
+ hgrid.addSelectionListener(new BooleanSelectionListener(context, JFreeChartResource.URIs.Plot, JFreeChartResource.URIs.Plot_visibleGrid,true));\r
htitle = new Button(hideGroup, support, SWT.CHECK);\r
htitle.setText("Title");\r
htitle.setSelectionFactory(new BooleanPropertyFactory(JFreeChartResource.URIs.TextTitle, JFreeChartResource.URIs.visible, true));\r
- htitle.addSelectionListener(new BooleanSelectionListener(context, JFreeChartResource.URIs.TextTitle, JFreeChartResource.URIs.visible));\r
+ htitle.addSelectionListener(new BooleanSelectionListener(context, JFreeChartResource.URIs.TextTitle, JFreeChartResource.URIs.visible,true));\r
hlegend = new Button(hideGroup, support, SWT.CHECK);\r
hlegend.setText("Legend");\r
hlegend.setSelectionFactory(new BooleanPropertyFactory(null, JFreeChartResource.URIs.Chart_visibleLegend, true));\r
- hlegend.addSelectionListener(new BooleanSelectionListener(context, null, JFreeChartResource.URIs.Chart_visibleLegend));\r
+ hlegend.addSelectionListener(new BooleanSelectionListener(context, null, JFreeChartResource.URIs.Chart_visibleLegend,true));\r
\r
if (showFilter) {\r
filteringGroup = new Group(composite, SWT.NONE);\r
htitle = new Button(hideGroup, support, SWT.CHECK);\r
htitle.setText("Title");\r
htitle.setSelectionFactory(new BooleanPropertyFactory(JFreeChartResource.URIs.TextTitle, JFreeChartResource.URIs.visible, true));\r
- htitle.addSelectionListener(new BooleanSelectionListener(context, JFreeChartResource.URIs.TextTitle, JFreeChartResource.URIs.visible));\r
+ htitle.addSelectionListener(new BooleanSelectionListener(context, JFreeChartResource.URIs.TextTitle, JFreeChartResource.URIs.visible,true));\r
hlegend = new Button(hideGroup, support, SWT.CHECK);\r
hlegend.setText("Legend");\r
hlegend.setSelectionFactory(new BooleanPropertyFactory(null, JFreeChartResource.URIs.Chart_visibleLegend, true));\r
- hlegend.addSelectionListener(new BooleanSelectionListener(context, null, JFreeChartResource.URIs.Chart_visibleLegend));\r
+ hlegend.addSelectionListener(new BooleanSelectionListener(context, null, JFreeChartResource.URIs.Chart_visibleLegend,true));\r
hlabels = new Button(hideGroup, support, SWT.CHECK);\r
hlabels.setText("Section labels");\r
hlabels.setSelectionFactory(new BooleanPropertyFactory(JFreeChartResource.URIs.Plot, JFreeChartResource.URIs.Plot_visibleLabels, true));\r
- hlabels.addSelectionListener(new BooleanSelectionListener(context, JFreeChartResource.URIs.Plot, JFreeChartResource.URIs.Plot_visibleLabels));\r
+ hlabels.addSelectionListener(new BooleanSelectionListener(context, JFreeChartResource.URIs.Plot, JFreeChartResource.URIs.Plot_visibleLabels,true));\r
\r
if (showFilter) {\r
filteringGroup = new Group(composite, SWT.NONE);\r
hgrid = new Button(hideGroup, support, SWT.CHECK);\r
hgrid.setText("Grid");\r
hgrid.setSelectionFactory(new BooleanPropertyFactory(JFreeChartResource.URIs.Plot, JFreeChartResource.URIs.Plot_visibleGrid, true));\r
- hgrid.addSelectionListener(new BooleanSelectionListener(context, JFreeChartResource.URIs.Plot, JFreeChartResource.URIs.Plot_visibleGrid));\r
+ hgrid.addSelectionListener(new BooleanSelectionListener(context, JFreeChartResource.URIs.Plot, JFreeChartResource.URIs.Plot_visibleGrid,true));\r
htitle = new Button(hideGroup, support, SWT.CHECK);\r
htitle.setText("Title");\r
htitle.setSelectionFactory(new BooleanPropertyFactory(JFreeChartResource.URIs.TextTitle, JFreeChartResource.URIs.visible, true));\r
- htitle.addSelectionListener(new BooleanSelectionListener(context, JFreeChartResource.URIs.TextTitle, JFreeChartResource.URIs.visible));\r
+ htitle.addSelectionListener(new BooleanSelectionListener(context, JFreeChartResource.URIs.TextTitle, JFreeChartResource.URIs.visible,true));\r
hlegend = new Button(hideGroup, support, SWT.CHECK);\r
hlegend.setText("Legend");\r
hlegend.setSelectionFactory(new BooleanPropertyFactory(null, JFreeChartResource.URIs.Chart_visibleLegend, true));\r
- hlegend.addSelectionListener(new BooleanSelectionListener(context, null, JFreeChartResource.URIs.Chart_visibleLegend));\r
+ hlegend.addSelectionListener(new BooleanSelectionListener(context, null, JFreeChartResource.URIs.Chart_visibleLegend,true));\r
\r
\r
// X-Axis properties\r