org.jfree.chart.renderer.xy

Class CyclicXYItemRenderer

Implemented Interfaces:
Cloneable, Serializable, LegendItemSource, PublicCloneable, Serializable, XYItemRenderer

public class CyclicXYItemRenderer
extends StandardXYItemRenderer
implements Serializable

The Cyclic XY item renderer is specially designed to handle cyclic axis. While the standard renderer would draw a line across the plot when a cycling occurs, the cyclic renderer splits the line at each cycle end instead. This is done by interpolating new points at cycle boundary. Thus, correct appearance is restored. The Cyclic XY item renderer works exactly like a standard XY item renderer with non-cyclic axis.

Nested Class Summary

protected static class
CyclicXYItemRenderer.OverwriteDataSet
A dataset to hold the interpolated points when drawing new lines.

Nested classes/interfaces inherited from class org.jfree.chart.renderer.xy.StandardXYItemRenderer

StandardXYItemRenderer.State

Field Summary

Fields inherited from class org.jfree.chart.renderer.xy.StandardXYItemRenderer

DISCONTINUOUS, DISCONTINUOUS_LINES, IMAGES, LINES, SHAPES, SHAPES_AND_LINES

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

CyclicXYItemRenderer()
Default constructor.
CyclicXYItemRenderer(int type)
Creates a new renderer.
CyclicXYItemRenderer(int type, XYToolTipGenerator labelGenerator)
Creates a new renderer.
CyclicXYItemRenderer(int type, XYToolTipGenerator labelGenerator, XYURLGenerator urlGenerator)
Creates a new renderer.

Method Summary

void
drawItem(Graphics2D g2, XYItemRendererState state, 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.

Methods inherited from class org.jfree.chart.renderer.xy.StandardXYItemRenderer

clone, drawItem, equals, getBaseShapesFilled, getBaseShapesVisible, getDrawSeriesLineAsPath, getGapThreshold, getGapThresholdType, getImage, getImageHotspot, getItemShapeFilled, getLegendItem, getLegendLine, getPlotDiscontinuous, getPlotImages, getPlotLines, getSeriesShapesFilled, getShapesFilled, initialise, setBaseShapesFilled, setBaseShapesVisible, setDrawSeriesLineAsPath, setGapThreshold, setGapThresholdType, setLegendLine, setPlotDiscontinuous, setPlotImages, setPlotLines, setSeriesShapesFilled, setShapesFilled, setShapesFilled

Methods inherited from class org.jfree.chart.renderer.xy.AbstractXYItemRenderer

addAnnotation, addAnnotation, addEntity, calculateDomainMarkerTextAnchorPoint, clone, drawAnnotations, drawDomainGridLine, drawDomainLine, drawDomainMarker, drawItemLabel, drawRangeLine, drawRangeMarker, equals, fillDomainGridBand, fillRangeGridBand, findDomainBounds, findRangeBounds, getBaseItemLabelGenerator, getBaseToolTipGenerator, getDefaultEntityRadius, getDrawingSupplier, getItemLabelGenerator, getItemLabelGenerator, getLegendItem, getLegendItemLabelGenerator, getLegendItemToolTipGenerator, getLegendItemURLGenerator, getLegendItems, getPassCount, getPlot, getSeriesItemLabelGenerator, getSeriesToolTipGenerator, getToolTipGenerator, getToolTipGenerator, getURLGenerator, initialise, removeAnnotation, removeAnnotations, setBaseItemLabelGenerator, setBaseToolTipGenerator, setDefaultEntityRadius, setItemLabelGenerator, setLegendItemLabelGenerator, setLegendItemToolTipGenerator, setLegendItemURLGenerator, setPlot, setSeriesItemLabelGenerator, setSeriesToolTipGenerator, setToolTipGenerator, setURLGenerator, updateCrosshairValues, updateCrosshairValues

Methods inherited from class org.jfree.chart.renderer.AbstractRenderer

addChangeListener, calculateLabelAnchorPoint, clone, equals, fireChangeEvent, getBaseCreateEntities, getBaseFillPaint, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getCreateEntities, getDrawingSupplier, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, hasListener, hashCode, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, notifyListeners, removeChangeListener, setBaseCreateEntities, setBaseCreateEntities, setBaseFillPaint, setBaseFillPaint, setBaseItemLabelFont, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setCreateEntities, setCreateEntities, setFillPaint, setFillPaint, setItemLabelAnchorOffset, setItemLabelFont, setItemLabelFont, setItemLabelPaint, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlinePaint, setOutlineStroke, setOutlineStroke, setPaint, setPaint, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesCreateEntities, setSeriesCreateEntities, setSeriesFillPaint, setSeriesFillPaint, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setShape, setShape, setStroke, setStroke

Constructor Details

CyclicXYItemRenderer

public CyclicXYItemRenderer()
Default constructor.

CyclicXYItemRenderer

public CyclicXYItemRenderer(int type)
Creates a new renderer.
Parameters:
type - the renderer type.

CyclicXYItemRenderer

public CyclicXYItemRenderer(int type,
                            XYToolTipGenerator labelGenerator)
Creates a new renderer.
Parameters:
type - the renderer type.
labelGenerator - the tooltip generator.

CyclicXYItemRenderer

public CyclicXYItemRenderer(int type,
                            XYToolTipGenerator labelGenerator,
                            XYURLGenerator urlGenerator)
Creates a new renderer.
Parameters:
type - the renderer type.
labelGenerator - the tooltip generator.
urlGenerator - the url generator.

Method Details

drawItem

public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     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. When using cyclic axis, do not draw a line from right to left when cycling as would a standard XY item renderer, but instead draw a line from the previous point to the cycle bound in the last cycle, and a line from the cycle bound to current point in the current cycle.
Specified by:
drawItem in interface XYItemRenderer
Overrides:
drawItem in interface StandardXYItemRenderer
Parameters:
g2 - the graphics device.
state - the renderer state.
dataArea - the data area.
info - the plot rendering info.
plot - the plot.
domainAxis - the domain axis.
rangeAxis - the range axis.
dataset - the dataset.
series - the series index.
item - the item index.
crosshairState - crosshair information for the plot (null permitted).
pass - the current pass index.