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
Modifier and TypeFieldDescriptionprotected boolean
Stores whether a legend is generated for the chart (Default: true).protected FWObservable
Instance of the used Observable.protected String
Stores the chart title.protected boolean
Stores whether tool tips are generated for the chart data (Default: true).protected ChartStyle.ChartType
Stores the chart type.protected boolean
Stores whether URLs are generated for the chart (Default: true).protected String
Stores the title of the charts X-Axis.protected String
Stores the title of the charts Y-Axis. -
Constructor Summary
ConstructorDescriptionCreates 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.boolean
Returns whether the chart is configured to generate a legend.boolean
Returns whether the chart is configured to generate tooltips for the data.boolean
hasURLs()
Returns whether the chart is configured to generate URLs.void
setLegend
(boolean aLegend) Sets whether the chart is configured to generate a legend.void
setObservable
(FWObservable aObservable) void
Sets the title for the chart.void
setTooltips
(boolean aTooltips) Sets whether the chart is configured to generate tooltips for the data.void
setType
(ChartStyle.ChartType aType) Sets the type of the chart style.void
setURLs
(boolean aURLs) Sets whether the chart is configured to generate URLs.void
setXAxisTitle
(String aTitle) Sets the title for the chart's X-axis.void
setYAxisTitle
(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, wait
Methods 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:ChartStyle
Returns the type of the chart style.- Specified by:
getType
in 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:
getTitle
in interfaceChartStyle
- Returns:
- empty string if no title is set
-
setTitle
Sets the title for the chart.- Specified by:
setTitle
in interfaceChartStyle
- Parameters:
aTitle
- the new chart's title
-
getXAxisTitle
Returns the title for the chart's x-axis.- Specified by:
getXAxisTitle
in 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:
getYAxisTitle
in 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:
hasLegend
in 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:
hasTooltips
in 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:
hasURLs
in 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:
setObservable
in interfaceChartStyle
-