Package net.simplace.core.ui.jfreechart
Class AbstractChartStyle
java.lang.Object
net.simplace.core.ui.jfreechart.AbstractChartStyle
- All Implemented Interfaces:
ChartStyle
- Direct Known Subclasses:
BasicChartStyle,DefaultSimChartStyle,XMLChartStyle
This class provides an abstract implementation for chart styles.
It implements the variables and methods for maintaining the type, the title(s)
and flags of the
ChartStyle interface.- Version:
- 1.0
- Author:
- Martin Schmitz
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.simplace.core.ui.jfreechart.ChartStyle
ChartStyle.ChartType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanStores whether a legend is generated for the chart (Default: true).protected FWObservableInstance of the used Observable.protected StringStores the chart title.protected booleanStores whether tool tips are generated for the chart data (Default: true).protected ChartStyle.ChartTypeStores the chart type.protected booleanStores whether URLs are generated for the chart (Default: true).protected StringStores the title of the charts X-Axis.protected StringStores the title of the charts Y-Axis. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a line style with default values.Creates a style with default values.AbstractChartStyle(ChartStyle.ChartType aType, String aTitle, String aXTitle, String aYTitle, boolean aLegend, boolean aTooltips, boolean aURLs) Creates a style. -
Method Summary
Modifier and TypeMethodDescriptiongetTitle()Returns the title for the chart.getType()Returns the type of the chart style.Returns the title for the chart's x-axis.Returns the title for the chart's y-axis.booleanReturns whether the chart is configured to generate a legend.booleanReturns whether the chart is configured to generate tooltips for the data.booleanhasURLs()Returns whether the chart is configured to generate URLs.voidsetLegend(boolean aLegend) Sets whether the chart is configured to generate a legend.voidsetObservable(FWObservable aObservable) voidSets the title for the chart.voidsetTooltips(boolean aTooltips) Sets whether the chart is configured to generate tooltips for the data.voidsetType(ChartStyle.ChartType aType) Sets the type of the chart style.voidsetURLs(boolean aURLs) Sets whether the chart is configured to generate URLs.voidsetXAxisTitle(String aTitle) Sets the title for the chart's X-axis.voidsetYAxisTitle(String aTitle) Sets the title for the chart's Y-axis.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.simplace.core.ui.jfreechart.ChartStyle
applyToDataset
-
Field Details
-
iType
Stores the chart type.- See Also:
-
ChartStyle#ChartType
-
iTitle
Stores the chart title. -
iXAxisTitle
Stores the title of the charts X-Axis. -
iYAxisTitle
Stores the title of the charts Y-Axis. -
iLegend
protected boolean iLegendStores whether a legend is generated for the chart (Default: true). -
iTooltips
protected boolean iTooltipsStores whether tool tips are generated for the chart data (Default: true). -
iURLs
protected boolean iURLsStores whether URLs are generated for the chart (Default: true). -
iObservable
Instance of the used Observable.
-
-
Constructor Details
-
AbstractChartStyle
public AbstractChartStyle()Creates a line style with default values. -
AbstractChartStyle
Creates a style with default values.- Parameters:
aType- style type
-
AbstractChartStyle
public AbstractChartStyle(ChartStyle.ChartType aType, String aTitle, String aXTitle, String aYTitle, boolean aLegend, boolean aTooltips, boolean aURLs) Creates a style.- Parameters:
aType- style typeaTitle- title for the chartaXTitle- title for the chart's X-axisaYTitle- title for the chart's Y-axisaLegend- flag whether a legend is generatedaTooltips- flag whether toolstips are generatedaURLs- flag whether URLs are generated
-
-
Method Details
-
getType
Description copied from interface:ChartStyleReturns the type of the chart style.- Specified by:
getTypein interfaceChartStyle- Returns:
- the type of the chart style.
-
setType
Sets the type of the chart style.- Parameters:
aType- the chart type
-
getTitle
Returns the title for the chart.- Specified by:
getTitlein interfaceChartStyle- Returns:
- empty string if no title is set
-
setTitle
Sets the title for the chart.- Specified by:
setTitlein interfaceChartStyle- Parameters:
aTitle- the new chart's title
-
getXAxisTitle
Returns the title for the chart's x-axis.- Specified by:
getXAxisTitlein interfaceChartStyle- Returns:
- empty string if no title is set
-
setXAxisTitle
Sets the title for the chart's X-axis.- Parameters:
aTitle- the new X-axis title
-
getYAxisTitle
Returns the title for the chart's y-axis.- Specified by:
getYAxisTitlein interfaceChartStyle- Returns:
- empty string if no title is set
-
setYAxisTitle
Sets the title for the chart's Y-axis.- Parameters:
aTitle- the new Y-axis title
-
hasLegend
public boolean hasLegend()Returns whether the chart is configured to generate a legend.- Specified by:
hasLegendin interfaceChartStyle- Returns:
- Returns whether the chart is configured to generate a legend.
-
setLegend
public void setLegend(boolean aLegend) Sets whether the chart is configured to generate a legend.- Parameters:
aLegend-
-
hasTooltips
public boolean hasTooltips()Returns whether the chart is configured to generate tooltips for the data.- Specified by:
hasTooltipsin interfaceChartStyle- Returns:
- Returns whether the chart is configured to generate tooltips for the data.
-
setTooltips
public void setTooltips(boolean aTooltips) Sets whether the chart is configured to generate tooltips for the data.- Parameters:
aTooltips-
-
hasURLs
public boolean hasURLs()Returns whether the chart is configured to generate URLs.- Specified by:
hasURLsin interfaceChartStyle- Returns:
- Returns whether the chart is configured to generate URLs.
-
setURLs
public void setURLs(boolean aURLs) Sets whether the chart is configured to generate URLs.- Parameters:
aURLs-
-
setObservable
- Specified by:
setObservablein interfaceChartStyle
-