|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectschmitzm.jfree.JFreeChartUtil
public class JFreeChartUtil
In dieser Klasse sind Hilfsmethoden fuer JFreeChart hinterlegt.
Field Summary | |
---|---|
static ChartStyleXMLFactory<ChartStyle> |
CHART_STYLE_FACTORY
Instance of ChartStyleXMLFactory . |
static ResourceProvider |
RESOURCE
ResourceProvider , der die Lokalisation fuer GUI-Komponenten
zur Verfuegung stellt. |
Constructor Summary | |
---|---|
JFreeChartUtil()
|
Method Summary | |
---|---|
static void |
addRegressionLineToPlot(XYPlot plot,
XYDataset regressionData,
Color lineColor)
Adds a line plot for regression data to a plot. |
static void |
applyDatasetProperties(Dataset dataset,
Dataset sample)
Applies general dataset properties to a Dataset . |
static CategoryItemRenderer |
createCategoryRenderer(BasicChartStyle style)
Creates a CategoryItemRenderer for the given stepped and stacked
properties. |
static CategoryItemRenderer |
createCategoryRenderer(ChartType type,
boolean stepped,
boolean stacked)
Creates a CategoryItemRenderer for the given stepped and stacked
properties. |
static JFreeChart |
createRegressionChart(XYDataset dataset,
String title,
String xAxisTitle,
String yAxisTitle,
boolean regressionLine)
Creates a JFreeChart which shows a point for each data iten and
a the appropriate regression line. |
static XYDataset |
createRegressionLineDataset(XYDataset dataset,
int series,
Comparable<?> seriesKey,
double startX,
double endX,
int sampleCount)
Creates sample data for a regression line of an XYDataset . |
static XYDataset |
createRegressionLineDataset(XYSeriesCollection dataset,
int series,
Comparable<?> seriesKey,
int sampleCount)
Creates sample data for a regression line of an XYDataset . |
static XYItemRenderer |
createXYRenderer(BasicChartStyle style)
Creates a XYItemRenderer for the given stepped and stacked
properties. |
static XYItemRenderer |
createXYRenderer(ChartType type,
boolean stepped,
boolean stacked)
Creates a XYItemRenderer for the given stepped and stacked
properties. |
static void |
fireChangeEvent(AbstractRenderer renderer)
Fires a change event to all RendererChangeListener connected
to the renderer. |
static void |
fireChangeEvent(Plot plot)
Fires a change event to all PlotChangeListener connected
to the plot. |
static Dataset |
getDatasetForRenderer(Plot plot,
Object renderer)
Returns the (first) dataset of a Plot which is rendererd
by a renderer. |
static Object |
getRendererForDataset(Plot plot,
int i)
Returns the renderer for the i -th dataset of a plot. |
static DatasetSelectionModel<?,?,?> |
getSelectionModelForDataset(Plot plot,
Dataset dataset)
Searchs the renderers of a plot for SelectionRenderer for
a Dataset and returns its DatasetSelectionModel . |
static Map<Integer,DatasetSelectionModel<?,?,?>> |
getSelectionModels(Plot plot)
Searchs the renderers of a plot for all SelectionRenderer
and returns their DatasetSelectionModels . |
static Map<Integer,SelectionRenderer<?>> |
getSelectionRenderer(Plot plot)
Returns all SelectionRenderer for a Plot . |
static SelectionRenderer<?> |
getSelectionRendererForDataset(Plot plot,
Dataset dataset)
Searchs the renderers of a plot for SelectionRenderer for
a Dataset . |
static String |
R(String key,
Object... values)
Convenience method to access the ResourceProvider . |
static void |
setLegendVisible(JFreeChart chart,
boolean visible)
Sets all chart legends (in)visible. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static ResourceProvider RESOURCE
ResourceProvider
, der die Lokalisation fuer GUI-Komponenten
zur Verfuegung stellt. Diese sind in properties-Datein unter
schmitzm.jfree.resource.locales.JFreeResourceBundle_XXX.properties
hinterlegt.
public static final ChartStyleXMLFactory<ChartStyle> CHART_STYLE_FACTORY
ChartStyleXMLFactory
.
Constructor Detail |
---|
public JFreeChartUtil()
Method Detail |
---|
public static String R(String key, Object... values)
ResourceProvider
.
public static void setLegendVisible(JFreeChart chart, boolean visible)
chart
- a chart to applyvisible
- indicates the visible propertypublic static void fireChangeEvent(Plot plot)
PlotChangeListener
connected
to the plot.
plot
- a plotpublic static void fireChangeEvent(AbstractRenderer renderer)
RendererChangeListener
connected
to the renderer.
renderer
- a rendererpublic static XYItemRenderer createXYRenderer(BasicChartStyle style)
XYItemRenderer
for the given stepped and stacked
properties.
type
- chart typestepped
- stepped propertystacked
- stacked propertypublic static XYItemRenderer createXYRenderer(ChartType type, boolean stepped, boolean stacked)
XYItemRenderer
for the given stepped and stacked
properties.
type
- chart typestepped
- stepped propertystacked
- stacked propertypublic static CategoryItemRenderer createCategoryRenderer(BasicChartStyle style)
CategoryItemRenderer
for the given stepped and stacked
properties.
type
- chart typestepped
- stepped propertystacked
- stacked propertypublic static CategoryItemRenderer createCategoryRenderer(ChartType type, boolean stepped, boolean stacked)
CategoryItemRenderer
for the given stepped and stacked
properties.
type
- chart typestepped
- stepped propertystacked
- stacked propertypublic static Object getRendererForDataset(Plot plot, int i)
i
-th dataset of a plot.
plot
- a plotindex
- the dataset index
i
public static SelectionRenderer<?> getSelectionRendererForDataset(Plot plot, Dataset dataset)
SelectionRenderer
for
a Dataset
.
plot
- the plot to check for rendererdataset
- the dataset a SelectionRenderer
is
searched for
null
if there is no SelectionRenderer
defined
for the datasetpublic static DatasetSelectionModel<?,?,?> getSelectionModelForDataset(Plot plot, Dataset dataset)
SelectionRenderer
for
a Dataset
and returns its DatasetSelectionModel
.
plot
- the plot to check for rendererdataset
- the dataset a SelectionRenderer
is
searched for
null
if there is no SelectionRenderer
defined
for the datasetpublic static Map<Integer,SelectionRenderer<?>> getSelectionRenderer(Plot plot)
SelectionRenderer
for a Plot
.
plot
- the plot to check for renderer
null
public static Map<Integer,DatasetSelectionModel<?,?,?>> getSelectionModels(Plot plot)
SelectionRenderer
and returns their DatasetSelectionModels
.
plot
- the plot to check for renderer
null
public static Dataset getDatasetForRenderer(Plot plot, Object renderer)
Plot
which is rendererd
by a renderer.
plot
- the plot which holds the datasets and rendererrenderer
- the renderer a dataset is seached for
null
if there is no dataset which is rendered
by the given rendererpublic static void applyDatasetProperties(Dataset dataset, Dataset sample)
Dataset
.
dataset
- dataset the properties are applied tosample
- dataset the properties are taken frompublic static JFreeChart createRegressionChart(XYDataset dataset, String title, String xAxisTitle, String yAxisTitle, boolean regressionLine)
JFreeChart
which shows a point for each data iten and
a the appropriate regression line.
dataset
- the datatitle
- title for the chartxAxisTitle
- title for the X-AxisyAxisTitle
- title for the Y-AxisregressionLine
- indicates whether the regression line is shownpublic static XYDataset createRegressionLineDataset(XYSeriesCollection dataset, int series, Comparable<?> seriesKey, int sampleCount)
XYDataset
.
dataset
- data the regression line is created forseries
- series of dataset
the regression line is created forseriesKey
- the key for the created datasetsampleCnt
- count of created samplespublic static XYDataset createRegressionLineDataset(XYDataset dataset, int series, Comparable<?> seriesKey, double startX, double endX, int sampleCount)
XYDataset
.
dataset
- data the regression line is created forseries
- series of dataset
the regression line is created forseriesKey
- the key for the created datasetstartX
- the first value the sample data is created forendX
- the last value the sample data is created forsampleCnt
- count of created samplespublic static void addRegressionLineToPlot(XYPlot plot, XYDataset regressionData, Color lineColor)
plot
- the plot the line is added to (at the end)regressionData
- the regression datalineColor
- the color for the regression line
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |