|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.xy.AbstractXYItemRenderer
org.jfree.chart.renderer.xy.XYDifferenceRenderer
A renderer for an XYPlot
that highlights the differences between two
series. The renderer expects a dataset that:
null
values;
Field Summary |
Fields inherited from class org.jfree.chart.renderer.AbstractRenderer |
DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO |
Constructor Summary | |
XYDifferenceRenderer()
Creates a new renderer with default attributes. |
|
XYDifferenceRenderer(java.awt.Paint positivePaint,
java.awt.Paint negativePaint,
boolean shapes)
Creates a new renderer. |
Method Summary | |
java.lang.Object |
clone()
Returns a clone of the renderer. |
void |
drawItem(java.awt.Graphics2D g2,
XYItemRendererState state,
java.awt.geom.Rectangle2D dataArea,
PlotRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset dataset,
int series,
int item,
CrosshairState crosshairState,
int pass)
Draws the visual representation of a single data item. |
protected void |
drawItemPass0(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
PlotRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset dataset,
int series,
int item,
CrosshairState crosshairState)
Draws the visual representation of a single data item, first pass. |
protected void |
drawItemPass1(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
PlotRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset dataset,
int series,
int item,
CrosshairState crosshairState)
Draws the visual representation of a single data item, second pass. |
LegendItem |
getLegendItem(int datasetIndex,
int series)
Returns a default legend item for the specified series. |
protected java.awt.Shape |
getNegativeArea(float x0,
float y0A,
float y0B,
float x1,
float y1A,
float y1B,
PlotOrientation orientation)
Returns the negative area for a cross-over section. |
java.awt.Paint |
getNegativePaint()
Returns the paint used to highlight negative differences. |
int |
getPassCount()
Returns 2 , the number of passes required by the renderer. |
boolean |
getPlotShapes()
Returns a flag that controls whether or not shapes are drawn for each data value. |
protected java.awt.Shape |
getPositiveArea(float x0,
float y0A,
float y0B,
float x1,
float y1A,
float y1B,
PlotOrientation orientation)
Returns the positive area for a crossover point. |
java.awt.Paint |
getPositivePaint()
Returns the paint used to highlight positive differences. |
XYItemRendererState |
initialise(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
XYPlot plot,
XYDataset data,
PlotRenderingInfo info)
Initialises the renderer and returns a state object that should be passed to subsequent calls to the drawItem() method. |
void |
setNegativePaint(java.awt.Paint paint)
Sets the paint used to highlight negative differences. |
void |
setPlotShapes(boolean flag)
Sets a flag that controls whether or not shapes are drawn for each data value. |
void |
setPositivePaint(java.awt.Paint paint)
Sets the paint used to highlight positive differences. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jfree.chart.LegendItemSource |
getLegendItems |
Constructor Detail |
public XYDifferenceRenderer()
public XYDifferenceRenderer(java.awt.Paint positivePaint, java.awt.Paint negativePaint, boolean shapes)
positivePaint
- the highlight color for positive differences
(null
not permitted).negativePaint
- the highlight color for negative differences
(null
not permitted).shapes
- draw shapes?Method Detail |
public java.awt.Paint getPositivePaint()
null
).public void setPositivePaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).public java.awt.Paint getNegativePaint()
null
).public void setNegativePaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).public boolean getPlotShapes()
public void setPlotShapes(boolean flag)
flag
- the flag.public XYItemRendererState initialise(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info)
initialise
in interface XYItemRenderer
initialise
in class AbstractXYItemRenderer
g2
- the graphics device.dataArea
- the area inside the axes.plot
- the plot.data
- the data.info
- an optional info collection object to return data back to
the caller.
public int getPassCount()
2
, the number of passes required by the renderer.
The XYPlot
will run through the dataset this number of times.
getPassCount
in interface XYItemRenderer
getPassCount
in class AbstractXYItemRenderer
public void drawItem(java.awt.Graphics2D g2, XYItemRendererState state, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass)
drawItem
in interface XYItemRenderer
g2
- the graphics device.state
- the renderer state.dataArea
- the area within which the data is being drawn.info
- collects information about the drawing.plot
- the plot (can be used to obtain standard color
information etc).domainAxis
- the domain (horizontal) axis.rangeAxis
- the range (vertical) axis.dataset
- the dataset.series
- the series index (zero-based).item
- the item index (zero-based).crosshairState
- crosshair information for the plot
(null
permitted).pass
- the pass index.protected void drawItemPass0(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState)
g2
- the graphics device.dataArea
- the area within which the data is being drawn.info
- collects information about the drawing.plot
- the plot (can be used to obtain standard color
information etc).domainAxis
- the domain (horizontal) axis.rangeAxis
- the range (vertical) axis.dataset
- the dataset.series
- the series index (zero-based).item
- the item index (zero-based).crosshairState
- crosshair information for the plot
(null
permitted).protected void drawItemPass1(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState)
g2
- the graphics device.dataArea
- the area within which the data is being drawn.info
- collects information about the drawing.plot
- the plot (can be used to obtain standard color information
etc).domainAxis
- the domain (horizontal) axis.rangeAxis
- the range (vertical) axis.dataset
- the dataset.series
- the series index (zero-based).item
- the item index (zero-based).crosshairState
- crosshair information for the plot
(null
permitted).protected java.awt.Shape getPositiveArea(float x0, float y0A, float y0B, float x1, float y1A, float y1B, PlotOrientation orientation)
x0
- x coordinate.y0A
- y coordinate A.y0B
- y coordinate B.x1
- x coordinate.y1A
- y coordinate A.y1B
- y coordinate B.orientation
- the plot orientation.
protected java.awt.Shape getNegativeArea(float x0, float y0A, float y0B, float x1, float y1A, float y1B, PlotOrientation orientation)
x0
- x coordinate.y0A
- y coordinate A.y0B
- y coordinate B.x1
- x coordinate.y1A
- y coordinate A.y1B
- y coordinate B.orientation
- the plot orientation.
public LegendItem getLegendItem(int datasetIndex, int series)
getLegendItem
in interface XYItemRenderer
getLegendItem
in class AbstractXYItemRenderer
datasetIndex
- the dataset index (zero-based).series
- the series index (zero-based).
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractXYItemRenderer
java.lang.CloneNotSupportedException
- if the renderer cannot be cloned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |