org.jfree.chart.renderer.xy
public class XYShapeRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, Serializable
XYShapeRendererDemo1.java
program included in the JFreeChart
demo collection:
Since: 1.0.11
Constructor Summary | |
---|---|
XYShapeRenderer()
Creates a new XYShapeRenderer instance with default
attributes. |
Method Summary | |
---|---|
Object | clone()
Returns a clone of this renderer.
|
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 block representing the specified item.
|
boolean | equals(Object obj)
Tests this instance for equality with an arbitrary object. |
Range | findDomainBounds(XYDataset dataset)
Returns the lower and upper bounds (range) of the x-values in the
specified dataset.
|
Range | findRangeBounds(XYDataset dataset)
Returns the range of values the renderer requires to display all the
items from the specified dataset.
|
boolean | getDrawOutlines()
Returns true if outlines should be drawn for shapes, and
false otherwise.
|
Paint | getGuideLinePaint()
Returns the paint used to draw the guide lines.
|
Stroke | getGuideLineStroke()
Returns the stroke used to draw the guide lines.
|
protected Paint | getPaint(XYDataset dataset, int series, int item)
Get the paint for a given series and item from a dataset.
|
PaintScale | getPaintScale()
Returns the paint scale used by the renderer.
|
int | getPassCount()
Returns the number of passes required by this renderer.
|
boolean | getUseFillPaint()
Returns true if the renderer should use the fill paint
setting to fill shapes, and false if it should just
use the regular paint.
|
boolean | getUseOutlinePaint()
Returns the flag that controls whether the outline paint is used for
shape outlines. |
boolean | isGuideLinesVisible()
Returns a flag that controls whether or not guide lines are drawn for
each data item (the lines are horizontal and vertical "crosshairs"
linking the data point to the axes).
|
void | setDrawOutlines(boolean flag)
Sets the flag that controls whether outlines are drawn for
shapes, and sends a RendererChangeEvent to all registered
listeners.
|
void | setGuideLinePaint(Paint paint)
Sets the paint used to draw the guide lines and sends a
RendererChangeEvent to all registered listeners.
|
void | setGuideLinesVisible(boolean visible)
Sets the flag that controls whether or not guide lines are drawn for
each data item and sends a RendererChangeEvent to all registered
listeners.
|
void | setGuideLineStroke(Stroke stroke)
Sets the stroke used to draw the guide lines and sends a
RendererChangeEvent to all registered listeners.
|
void | setPaintScale(PaintScale scale)
Sets the paint scale used by the renderer and sends a
RendererChangeEvent to all registered listeners.
|
void | setUseFillPaint(boolean flag)
Sets the flag that controls whether the fill paint is used to fill
shapes, and sends a RendererChangeEvent to all
registered listeners.
|
void | setUseOutlinePaint(boolean use)
Sets the flag that controls whether the outline paint is used for shape
outlines, and sends a RendererChangeEvent to all registered
listeners.
|
XYShapeRenderer
instance with default
attributes.Returns: A clone of this renderer.
Throws: CloneNotSupportedException if there is a problem creating the clone.
Parameters: g2 the graphics device. state the state. dataArea the data area. info the plot rendering info. plot the plot. domainAxis the x-axis. rangeAxis the y-axis. dataset the dataset. series the series index. item the item index. crosshairState the crosshair state. pass the pass index.
true
if and only if:
obj
is an instance of XYShapeRenderer
(not
null
);obj
has the same field values as this
XYShapeRenderer
;Parameters: obj the object (null
permitted).
Returns: A boolean.
Parameters: dataset the dataset (null
permitted).
Returns: The range (null
if the dataset is null
or empty).
Parameters: dataset the dataset (null
permitted).
Returns: The range (null
if the dataset is null
or empty).
true
if outlines should be drawn for shapes, and
false
otherwise.
Returns: A boolean.
See Also: XYShapeRenderer
Returns: The paint (never null
).
See Also: setGuideLinePaint
Returns: The stroke.
See Also: setGuideLineStroke
Parameters: dataset the dataset.. series the series index. item the item index.
Returns: The paint.
Returns: The paint scale (never null
).
See Also: setPaintScale
Returns: 2
.
true
if the renderer should use the fill paint
setting to fill shapes, and false
if it should just
use the regular paint.
Refer to XYLineAndShapeRendererDemo2.java
to see the
effect of this flag.
Returns: A boolean.
See Also: XYShapeRenderer getUseOutlinePaint
Returns: A boolean.
See Also: XYShapeRenderer
Returns: A boolean.
See Also: XYShapeRenderer
In some cases, shapes look better if they do NOT have an outline, but this flag allows you to set your own preference.
Parameters: flag the flag.
See Also: getDrawOutlines
Parameters: paint the paint (null
not permitted).
See Also: getGuideLinePaint
Parameters: visible the new flag value.
See Also: isGuideLinesVisible
Parameters: stroke the stroke (null
not permitted).
See Also: getGuideLineStroke
Parameters: scale the scale (null
not permitted).
See Also: getPaintScale
Parameters: flag the flag.
See Also: getUseFillPaint
Parameters: use the flag.
See Also: getUseOutlinePaint