Class OptionBuilder
- java.lang.Object
-
- org.wicketstuff.gchart.gchart.options.builder.OptionBuilder
-
- All Implemented Interfaces:
IOptionBuilder
- Direct Known Subclasses:
ClassicOptionBuilder
public abstract class OptionBuilder extends Object implements IOptionBuilder
- Author:
- Dieter Tremel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classOptionBuilder.SeriesDeclarationClass for a record of sieries axis mapping and associated OptionModifier.
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,IModel<String>>axisMapprotected Map<String,OptionModifier>axisModifierMapprotected Chartchartprotected IModel<String>subTitleModelprotected IModel<String>titleModel
-
Constructor Summary
Constructors Modifier Constructor Description protectedOptionBuilder(Chart chart)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IOptionBuilderaxis(String name)Add a axis with a title from i18n.IOptionBuilderaxis(String name, String title)Add a axis title direct from String.IOptionBuilderaxis(String name, IModel<String> titleModel)Add a axis, give the model for the title of the axis.static ClassicOptionBuilderclassic(Chart chart)StringgetChartBaseResourceKey()Helper function to build resource base key for a chart and it's id according to a convention.static StringgetChartBaseResourceKey(String chartId)Helper function to build resource base key for a chart and it's id according to a convention.IModel<String>getChartLabelResourceModel(String subKey)Generate a wrapped ResourceModel for theChartcomponent.IOptionBuildermapSeries(String axisName)Map a serie to an axis by the axisname.IOptionBuildermapSeries(String axisName, OptionModifier seriesModifier)Map a serie to an axis by the axisname.IOptionBuildermodifyAxis(String name, OptionModifier axisModifier)Add a modifier to configure options for the axis.IOptionBuildersubTitle()Add a subTitle of the chart from i18n.IOptionBuildersubTitle(String subTitle)Add a subTitle of the chart direct from String.IOptionBuildersubTitle(IModel<String> subTitleModel)Give the model for the subTitle of the chart.IOptionBuildertitle()Add a title of the chart from i18n.IOptionBuildertitle(String title)Add a title of the chart direct from String.IOptionBuildertitle(IModel<String> titleModel)Give the model for the title of the chart.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wicketstuff.gchart.gchart.options.builder.IOptionBuilder
build
-
-
-
-
Constructor Detail
-
OptionBuilder
protected OptionBuilder(Chart chart)
-
-
Method Detail
-
classic
public static ClassicOptionBuilder classic(Chart chart)
-
getChartBaseResourceKey
public static String getChartBaseResourceKey(String chartId)
Helper function to build resource base key for a chart and it's id according to a convention. This should be used as left part for all keys for i18n of charts.- Parameters:
chartId- Wicket id of Chart.- Returns:
- Base key with trailing dot, eg.
"Chart.myChart."if param is"myChart".
-
getChartBaseResourceKey
public String getChartBaseResourceKey()
Description copied from interface:IOptionBuilderHelper function to build resource base key for a chart and it's id according to a convention. This should be used as left part for all keys for i18n of charts. Takes the chart id from the chart field.- Specified by:
getChartBaseResourceKeyin interfaceIOptionBuilder- Returns:
- Base key with trailing dot, eg.
"Chart.myChart."if param is"myChart".
-
getChartLabelResourceModel
public IModel<String> getChartLabelResourceModel(String subKey)
Description copied from interface:IOptionBuilderGenerate a wrapped ResourceModel for theChartcomponent.- Specified by:
getChartLabelResourceModelin interfaceIOptionBuilder- Parameters:
subKey- Subkey as suffix ofIOptionBuilder.getChartBaseResourceKey().- Returns:
- ResourceModel for the complete key. There is no default defined, so missing properties can be easyly detected.
-
title
public IOptionBuilder title()
Description copied from interface:IOptionBuilderAdd a title of the chart from i18n. The key of the ResourceModel is constructed by convention.- Specified by:
titlein interfaceIOptionBuilder- Returns:
- IOptionbuilder for fluent api.
- See Also:
getChartBaseResourceKey(java.lang.String),IOptionBuilder.getChartBaseResourceKey()
-
title
public IOptionBuilder title(String title)
Description copied from interface:IOptionBuilderAdd a title of the chart direct from String. Convenient function to wrap String in a model.- Specified by:
titlein interfaceIOptionBuilder- Parameters:
title- Text of title.- Returns:
- IOptionbuilder for fluent api.
-
title
public IOptionBuilder title(IModel<String> titleModel)
Description copied from interface:IOptionBuilderGive the model for the title of the chart.- Specified by:
titlein interfaceIOptionBuilder- Parameters:
titleModel- Model for title.- Returns:
- IOptionbuilder for fluent api.
-
subTitle
public IOptionBuilder subTitle()
Description copied from interface:IOptionBuilderAdd a subTitle of the chart from i18n. The key of the ResourceModel is constructed by convention.- Specified by:
subTitlein interfaceIOptionBuilder- Returns:
- IOptionbuilder for fluent api.
- See Also:
getChartBaseResourceKey(java.lang.String),IOptionBuilder.getChartBaseResourceKey()
-
subTitle
public IOptionBuilder subTitle(String subTitle)
Description copied from interface:IOptionBuilderAdd a subTitle of the chart direct from String. Convenient function to wrap String in a model.- Specified by:
subTitlein interfaceIOptionBuilder- Parameters:
subTitle- Text of subTitle.- Returns:
- IOptionbuilder for fluent api.
-
subTitle
public IOptionBuilder subTitle(IModel<String> subTitleModel)
Description copied from interface:IOptionBuilderGive the model for the subTitle of the chart.- Specified by:
subTitlein interfaceIOptionBuilder- Parameters:
subTitleModel- Model for subTitle.- Returns:
- IOptionbuilder for fluent api.
-
axis
public IOptionBuilder axis(String name)
Description copied from interface:IOptionBuilderAdd a axis with a title from i18n. The key of the ResourceModel is constructed by convention byIOptionBuilder.getChartBaseResourceKey()+"axis.name.title".- Specified by:
axisin interfaceIOptionBuilder- Parameters:
name- Uniq name for the axis.- Returns:
- IOptionbuilder for fluent api.
- See Also:
getChartBaseResourceKey(java.lang.String),IOptionBuilder.getChartBaseResourceKey()
-
axis
public IOptionBuilder axis(String name, String title)
Description copied from interface:IOptionBuilderAdd a axis title direct from String. Convenient function to wrap String in a model.- Specified by:
axisin interfaceIOptionBuilder- Parameters:
name- Uniq name for the axis.title- Text of title.- Returns:
- IOptionbuilder for fluent api.
-
axis
public IOptionBuilder axis(String name, IModel<String> titleModel)
Description copied from interface:IOptionBuilderAdd a axis, give the model for the title of the axis.- Specified by:
axisin interfaceIOptionBuilder- Parameters:
name- Uniq name for the axis.titleModel- Model for title.- Returns:
- IOptionbuilder for fluent api.
-
modifyAxis
public IOptionBuilder modifyAxis(String name, OptionModifier axisModifier)
Description copied from interface:IOptionBuilderAdd a modifier to configure options for the axis.- Specified by:
modifyAxisin interfaceIOptionBuilder- Parameters:
name- Name to refer to an axis.axisModifier- Modifier to handle axis options.- Returns:
- IOptionbuilder for fluent api.
-
mapSeries
public IOptionBuilder mapSeries(String axisName)
Description copied from interface:IOptionBuilderMap a serie to an axis by the axisname.- Specified by:
mapSeriesin interfaceIOptionBuilder- Parameters:
axisName- Name of a previous defined axis.- Returns:
- IOptionbuilder for fluent api.
-
mapSeries
public IOptionBuilder mapSeries(String axisName, OptionModifier seriesModifier)
Description copied from interface:IOptionBuilderMap a serie to an axis by the axisname. Aply a modifier to the options of this series.- Specified by:
mapSeriesin interfaceIOptionBuilder- Parameters:
axisName- Name of a previous defined axis.seriesModifier- Modifierer for the opts of this series.- Returns:
- IOptionbuilder for fluent api.
-
-