|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.chart.AbstractRenderer | +--com.jrefinery.chart.AbstractXYItemRenderer | +--com.jrefinery.chart.StandardXYItemRenderer
Standard item renderer for an XYPlot. This class can draw (a) shapes at each point, or (b) lines between points, or (c) both shapes and lines.
Field Summary | |
static int |
DISCONTINUOUS
Constant for the type of rendering (discontinuous lines). |
static int |
DISCONTINUOUS_LINES
Constant for the type of rendering (discontinuous lines). |
static int |
IMAGES
Constant for the type of rendering (images only). |
static int |
LINES
Constant for the type of rendering (lines only). |
static int |
SHAPES
Cconstant for the type of rendering (shapes only). |
static int |
SHAPES_AND_LINES
Constant for the type of rendering (shapes and lines). |
Constructor Summary | |
StandardXYItemRenderer()
Constructs a new renderer. |
|
StandardXYItemRenderer(int type)
Constructs a new renderer. |
|
StandardXYItemRenderer(int type,
XYToolTipGenerator toolTipGenerator)
Constructs a new renderer. |
|
StandardXYItemRenderer(int type,
XYToolTipGenerator toolTipGenerator,
XYURLGenerator urlGenerator)
Constructs a new renderer. |
Method Summary | |
void |
drawItem(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
ChartRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset data,
int series,
int item,
CrosshairInfo crosshairInfo)
Draws the visual representation of a single data item. |
boolean |
getDefaultShapeFilled()
Returns the default value returned by the isShapeFilled(...) method. |
double |
getDefaultShapeScale()
Returns the default shape scale. |
double |
getGapThreshold()
Returns the gap threshold for discontinuous lines. |
protected java.awt.Image |
getImage(Plot plot,
int series,
int item,
double x,
double y)
Returns the image used to draw a single data item. |
protected java.awt.Point |
getImageHotspot(Plot plot,
int series,
int item,
double x,
double y,
java.awt.Image image)
Returns the hotspot of the image used to draw a single data item. |
protected java.awt.Paint |
getPaint(Plot plot,
int series,
int item,
double x,
double y)
Returns the paint used to draw a single data item. |
boolean |
getPlotImages()
Returns true if images are being plotted by the renderer. |
boolean |
getPlotLines()
Returns true if lines are being plotted by the renderer. |
boolean |
getPlotShapes()
Returns true if shapes are being plotted by the renderer. |
protected java.awt.Shape |
getShape(Plot plot,
int series,
int item,
double x,
double y,
double scale)
Returns the shape used to draw a single data item. |
protected double |
getShapeScale(Plot plot,
int series,
int item,
double x,
double y)
Returns the shape scale of a single data item. |
protected boolean |
isShapeFilled(Plot plot,
int series,
int item,
double x,
double y)
Is used to determine if a shape is filled when drawn or not |
void |
setDefaultShapeFilled(boolean flag)
Sets the default shape filled flag. |
void |
setDefaultShapeScale(double scale)
Sets the default shape scale. |
void |
setGapThreshold(double t)
Sets the gap threshold for discontinuous lines. |
void |
setPlotImages(boolean flag)
Sets the flag that controls whether or not an image is drawn at each data point. |
void |
setPlotLines(boolean flag)
Sets the flag that controls whether or not a line is plotted between each data point. |
void |
setPlotShapes(boolean flag)
Sets the flag that controls whether or not a shape is plotted at each data point. |
Methods inherited from class com.jrefinery.chart.AbstractXYItemRenderer |
drawDomainMarker, drawRangeMarker, getLegendItem, getPlot, getToolTipGenerator, getURLGenerator, initialise, setPlot, setToolTipGenerator, setURLGenerator |
Methods inherited from class com.jrefinery.chart.AbstractRenderer |
addPropertyChangeListener, firePropertyChanged, getInfo, removePropertyChangeListener, setInfo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jrefinery.chart.XYItemRenderer |
addPropertyChangeListener, drawDomainMarker, drawRangeMarker, getLegendItem, getPlot, getToolTipGenerator, getURLGenerator, initialise, removePropertyChangeListener, setPlot, setToolTipGenerator, setURLGenerator |
Field Detail |
public static final int SHAPES
public static final int LINES
public static final int SHAPES_AND_LINES
public static final int IMAGES
public static final int DISCONTINUOUS
public static final int DISCONTINUOUS_LINES
Constructor Detail |
public StandardXYItemRenderer()
public StandardXYItemRenderer(int type)
To specify the type of renderer, use one of the constants: SHAPES, LINES or SHAPES_AND_LINES.
type
- the type.public StandardXYItemRenderer(int type, XYToolTipGenerator toolTipGenerator)
To specify the type of renderer, use one of the constants: SHAPES, LINES or SHAPES_AND_LINES.
type
- the type of renderer.toolTipGenerator
- the tooltip generator.public StandardXYItemRenderer(int type, XYToolTipGenerator toolTipGenerator, XYURLGenerator urlGenerator)
To specify the type of renderer, use one of the constants: SHAPES, LINES or SHAPES_AND_LINES.
type
- the type of renderer.toolTipGenerator
- the tooltip generator.urlGenerator
- the URL generator.Method Detail |
public boolean getPlotShapes()
true
if shapes are being plotted by the renderer.public void setPlotShapes(boolean flag)
flag
- the flag.public double getDefaultShapeScale()
The renderer will call getShapeScale(...) to determine the scaling factor to use for shapes. Unless overridden, the getShapeScale(...) method just returns the default shape scale.
public void setDefaultShapeScale(double scale)
scale
- the shape scale.public boolean getDefaultShapeFilled()
The renderer will call isShapeFilled(...) to determine whether or not to fill a shape. Unless overridden, the isShapeFilled(...) method just returns the default shape filled flag.
public void setDefaultShapeFilled(boolean flag)
flag
- the flag.public boolean getPlotLines()
true
if lines are being plotted by the renderer.public void setPlotLines(boolean flag)
flag
- the flag.public double getGapThreshold()
public void setGapThreshold(double t)
t
- the threshold.public boolean getPlotImages()
true
if images are being plotted by the renderer.public void setPlotImages(boolean flag)
flag
- the flag.public void drawItem(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, ChartRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset data, int series, int item, CrosshairInfo crosshairInfo)
drawItem
in interface XYItemRenderer
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.data
- the dataset.series
- the series index.item
- the item index.crosshairInfo
- information about crosshairs on a plot.protected java.awt.Shape getShape(Plot plot, int series, int item, double x, double y, double scale)
plot
- the plot (can be used to obtain standard color information etc).series
- the series indexitem
- the item indexx
- the x value of the itemy
- the y value of the itemscale
- the scale used to draw the shapeprotected double getShapeScale(Plot plot, int series, int item, double x, double y)
Unless overridden, this method just returns the default shape scale.
plot
- the plot (can be used to obtain standard color information etc).series
- the series indexitem
- the item indexx
- the x value of the itemy
- the y value of the itemprotected boolean isShapeFilled(Plot plot, int series, int item, double x, double y)
plot
- the plot (can be used to obtain standard color information etc).series
- the series index.item
- the item index.x
- the x value of the item.y
- the y value of the item.true
if the shape used to draw the data item should be filled.protected java.awt.Paint getPaint(Plot plot, int series, int item, double x, double y)
If null is returned, the renderer defaults to the paint for the current series.
plot
- the plot (can be used to obtain standard color information etc).series
- the series index.item
- the item index.x
- the x value of the item.y
- the y value of the item.protected java.awt.Image getImage(Plot plot, int series, int item, double x, double y)
plot
- the plot (can be used to obtain standard color information etc).series
- the series index.item
- the item index.x
- the x value of the item.y
- the y value of the item.protected java.awt.Point getImageHotspot(Plot plot, int series, int item, double x, double y, java.awt.Image image)
plot
- the plot (can be used to obtain standard color information etc).image
- the image (can be used to get size information about the image)series
- the series indexitem
- the item indexx
- the x value of the itemy
- the y value of the item
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |