|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectschmitzm.jfree.chart.style.AbstractChartStyle
public abstract class AbstractChartStyle
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.
Field Summary | |
---|---|
protected Map<Integer,ChartAxisStyle> |
axisStyle
Holds the styles of the chart axis. |
protected Color |
bgPaint
Holds the background color for the chart. |
protected boolean |
borderVisible
Stores whether a border is shown around the whole chart. |
protected ChartLabelStyle |
descStyle
Holds a long description for the chart. |
protected String |
id
Holds a (unique) ID for the style. |
protected boolean |
legend
Stores whether a legend is generated for the chart (Default: true). |
protected Category |
LOGGER
Logger for this class |
protected int |
maxRendererDatasetIdx
Holds the maximum dataset index for which a renderer is specified. |
protected PlotOrientation |
orientation
Holds the plot orientation (horizontal/vertical). |
protected ChartPlotStyle |
plotStyle
Holds the style for the chart's plot. |
protected Map<Integer,ChartRendererStyle> |
rendererStyle
Holds the styles for the chart renderers. |
protected CategoryToolTipGenerator |
TIPGEN_CAT
Tooltip generator used for Category-Charts. |
protected XYToolTipGenerator |
TIPGEN_XY
Tooltip generator used for XY-Charts. |
protected ChartLabelStyle |
titleStyle
Holds the chart title. |
protected boolean |
tooltips
Stores whether tooltips are generated for the chart data (Default: true). |
protected ChartType |
type
Holds the chart type. |
protected CategoryURLGenerator |
URLGEN_CAT
URL generator used for Category-Charts. |
protected XYURLGenerator |
URLGEN_XY
URL generator used for XY-Charts. |
protected boolean |
urls
Stores whether URLs are generated for the chart (Default: true). |
Fields inherited from interface schmitzm.jfree.chart.style.ChartStyle |
---|
DOMAIN_AXIS, RANGE_AXIS, RANGE_AXIS2, X_AXIS, Y_AXIS, Y_AXIS_LEFT, Y_AXIS_RIGHT, Y_AXIS2 |
Constructor Summary | |
---|---|
AbstractChartStyle(String id)
Creates a line style with default values. |
|
AbstractChartStyle(String id,
ChartType type)
Creates a style with default values. |
|
AbstractChartStyle(String id,
ChartType type,
String title,
String xTitle,
String yTitle,
boolean legend,
boolean tooltips,
boolean urls)
Creates a style. |
Method Summary | |
---|---|
void |
applyToChart(JFreeChart chart)
Applies the properties of this style to an existing chart. |
int |
getAxisCount()
Returns the axis count. |
ChartAxisStyle |
getAxisStyle(int axis)
Returns the style of a chart axis. |
Color |
getBackground()
Returns the background color of the chart. |
ChartLabelStyle |
getDescStyle()
Returns the style of the long chart description. |
String |
getID()
Returns the (unique) ID for the style. |
PlotOrientation |
getOrientation()
Returns the orientation of the chart. |
ChartPlotStyle |
getPlotStyle()
Returns the style of the chart's plot. |
int |
getRendererCount()
Returns count of renderer for the chart. |
ChartRendererStyle |
getRendererStyle(int dataset)
Returns the style of a dataset renderer. |
ChartLabelStyle |
getTitleStyle()
Returns the style of the charts title. |
ChartType |
getType()
Returns the type of the chart style. |
boolean |
hasLegend()
Returns whether the chart is configured to generate a legend. |
boolean |
hasTooltips()
Returns whether the chart is configured to generate tooltips for the data. |
boolean |
hasURLs()
Returns whether the chart is configured to generate URLs. |
boolean |
isBorderVisible()
Returns whether a border is shown around the whole chart. |
void |
setAxisStyle(int axis,
ChartAxisStyle style)
Sets the style of a chart axis. |
void |
setBackground(Color paint)
Sets the background color of the chart. |
void |
setBorderVisible(boolean visible)
Sets whether a border is shown around the whole chart. |
void |
setDescStyle(ChartLabelStyle descStyle)
Sets the long description for the chart. |
void |
setLegend(boolean legend)
Sets whether the chart is configured to generate a legend. |
void |
setOrientation(PlotOrientation orientation)
Sets the orientation of the chart. |
void |
setPlotStyle(ChartPlotStyle style)
Sets the style of the chart's plot. |
void |
setRendererStyle(int dataset,
ChartRendererStyle style)
Sets the style of a dataset renderer. |
void |
setTitleStyle(ChartLabelStyle style)
Sets the style of the charts title. |
void |
setTooltips(boolean tooltips)
Sets whether the chart is configured to generate tooltips for the data. |
void |
setType(ChartType type)
Sets the type of the chart style. |
void |
setURLs(boolean urls)
Sets whether the chart is configured to generate URLs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface schmitzm.jfree.chart.style.ChartStyle |
---|
applyToDataset |
Field Detail |
---|
protected XYToolTipGenerator TIPGEN_XY
protected CategoryToolTipGenerator TIPGEN_CAT
protected XYURLGenerator URLGEN_XY
protected CategoryURLGenerator URLGEN_CAT
protected final Category LOGGER
protected String id
protected ChartType type
ChartStyle#ChartType
protected ChartLabelStyle titleStyle
protected ChartLabelStyle descStyle
protected Color bgPaint
protected boolean borderVisible
protected Map<Integer,ChartAxisStyle> axisStyle
protected PlotOrientation orientation
protected boolean legend
protected boolean tooltips
protected boolean urls
protected Map<Integer,ChartRendererStyle> rendererStyle
protected int maxRendererDatasetIdx
protected ChartPlotStyle plotStyle
Constructor Detail |
---|
public AbstractChartStyle(String id)
id
- a (unique) ID for the stylepublic AbstractChartStyle(String id, ChartType type)
id
- a (unique) ID for the styletype
- style typepublic AbstractChartStyle(String id, ChartType type, String title, String xTitle, String yTitle, boolean legend, boolean tooltips, boolean urls)
id
- a (unique) ID for the styletype
- style typetitle
- title for the chartxTitle
- title for the chart's X-axisyTitle
- title for the chart's Y-axislegend
- flag whether a legend is generatedtooltips
- flag whether toolstips are generatedurls
- flag whether URLs are generatedMethod Detail |
---|
public String getID()
getID
in interface ChartStyle
public ChartType getType()
getType
in interface ChartStyle
public void setType(ChartType type)
type
- the chart typeChartStyle#ChartType
public PlotOrientation getOrientation()
getOrientation
in interface ChartStyle
PlotOrientation#HORIZONTAL
,
PlotOrientation#VERTICAL
public void setOrientation(PlotOrientation orientation)
setOrientation
in interface ChartStyle
orientation
- the orientation of the chartpublic ChartLabelStyle getTitleStyle()
getTitleStyle
in interface ChartStyle
public void setTitleStyle(ChartLabelStyle style)
setTitleStyle
in interface ChartStyle
style
- the new style (if null
the style is
reset to an empty default style, so that the
getter method always can be accessed!)public ChartLabelStyle getDescStyle()
getDescStyle
in interface ChartStyle
public void setDescStyle(ChartLabelStyle descStyle)
setDescStyle
in interface ChartStyle
descStyle
- the new chart description stylepublic Color getBackground()
getBackground
in interface ChartStyle
public void setBackground(Color paint)
setBackground
in interface ChartStyle
paint
- the background color for the chartpublic boolean isBorderVisible()
isBorderVisible
in interface ChartStyle
public void setBorderVisible(boolean visible)
setBorderVisible
in interface ChartStyle
public boolean hasLegend()
hasLegend
in interface ChartStyle
public void setLegend(boolean legend)
setLegend
in interface ChartStyle
public boolean hasTooltips()
hasTooltips
in interface ChartStyle
public void setTooltips(boolean tooltips)
setTooltips
in interface ChartStyle
public boolean hasURLs()
hasURLs
in interface ChartStyle
public void setURLs(boolean urls)
setURLs
in interface ChartStyle
public int getAxisCount()
getAxisCount
in interface ChartStyle
public ChartAxisStyle getAxisStyle(int axis)
getAxisStyle
in interface ChartStyle
axis
- axis number (0=domain, 1=range, ...)
null
if the chart has no such axispublic void setAxisStyle(int axis, ChartAxisStyle style)
setAxisStyle
in interface ChartStyle
axis
- axis number (0=domain, 1=range, ...)style
- style for the axispublic int getRendererCount()
getRendererCount
in interface ChartStyle
public ChartRendererStyle getRendererStyle(int dataset)
getRendererStyle
in interface ChartStyle
dataset
- dataset number (starting with 0)
null
if the chart has no such rendererpublic void setRendererStyle(int dataset, ChartRendererStyle style)
setRendererStyle
in interface ChartStyle
dataset
- dataset number (starting with 0)style
- style for the dataset rendererpublic ChartPlotStyle getPlotStyle()
getPlotStyle
in interface ChartStyle
null
if no such style is definedpublic void setPlotStyle(ChartPlotStyle style)
setPlotStyle
in interface ChartStyle
style
- style for the plotpublic void applyToChart(JFreeChart chart)
applyToChart
in interface ChartStyle
chart
- chart to be styled
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |