com.ijchart.xychart.plot
Class XYPlot

java.lang.Object
  extended by com.ijchart.xychart.plot.AbstractPlot
      extended by com.ijchart.xychart.plot.AbstractAxisPlot
          extended by com.ijchart.xychart.plot.XYPlot
All Implemented Interfaces:
IAxisChangeListener, IDatasetChangeListener, IRenderChangeListener, IZoomable, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
AbstractCombineXYPlot

public class XYPlot
extends AbstractAxisPlot
implements java.lang.Cloneable, java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

Used to display the two coordinate axis are (@Link com.ijchart.xychart.axis.value.AbstractValueAxis) of the plot.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
static XYNumberChartData DEFAULT_QUADRANT_ORIGIN
           The default origin point for the quadrants (if drawn).
static java.awt.Paint[] DEFAULT_QUADRANT_PAINT
           The default paint used for each quadrant.
static boolean DEFAULT_VALUE_ZERO_BASELINE_VISIBLE
           A default flag that controls whether or not the zero baseline against the value axis is visible.
 
Fields inherited from class com.ijchart.xychart.plot.AbstractAxisPlot
DEFAULT_CHART_ORIENTATION, DEFAULT_CROSSHAIR_PAINT, DEFAULT_CROSSHAIR_STROKE, DEFAULT_DOMAIN_CROSSHAIR_LOCKED_ON_DATA, DEFAULT_DOMAIN_CROSSHAIR_VISIBLE, DEFAULT_DOMAIN_GRIDLINE_VISIBLE, DEFAULT_DOMAIN_ZERO_BASELINE_VISIBLE, DEFAULT_GRIDLINE_PAINT, DEFAULT_GRIDLINE_STROKE, DEFAULT_VALUE_CROSSHAIR_LOCKED_ON_DATA, DEFAULT_VALUE_CROSSHAIR_VISIBLE, DEFAULT_VALUE_GRIDLINE_VISIBLE, domainAxes, renderToDomainAxis, renderToValueAxis, valueAxes
 
Fields inherited from class com.ijchart.xychart.plot.AbstractPlot
dataArea, DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_IMAGE_ALIGNMENT, DEFAULT_BACKGROUND_PAINT, DEFAULT_BORDER_PAINT, DEFAULT_BORDER_STROKE, DEFAULT_BORDER_VISIBLE, DEFAULT_DRAW_NO_DATA_MESSAGE, DEFAULT_DRAWINT_SUPPLIER, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_MINIMUM_HEIGHT_TO_DRAW, DEFAULT_MINIMUM_WIDTH_TO_DRAW, DEFAULT_NO_DATA_MESSAGE, DEFAULT_NO_DATA_MESSAGE_FONT, DEFAULT_NO_DATA_MESSAGE_PAINT, DEFAULT_RENDER_CALL_ORDER, drawNoDataMessage, plotShapes, renderingOrder, renderShapesList
 
Constructor Summary
XYPlot()
           Creates a new XYPlot instance with no dataset, no axes and no render.
XYPlot(AbstractValueAxis domainAxis, AbstractValueAxis valueAxis, AbstractXYRender render)
           Creates a new plot with the specified dataset, axes and render.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of the plot.
 void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, ChartShapeCollection chartShapes)
           Draws the plot within the specified area.Subclasses need to provide an implementation of this method, obviously.
protected  java.awt.geom.Rectangle2D drawAxes(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, PlotShapeCollection shapeCollection)
           A utility method for drawing the plot's axes.
protected  void drawQuadrantBackground(java.awt.geom.Rectangle2D dataArea, ChartOrientation orientation, AbstractValueAxis domainAxis, AbstractValueAxis valueAxis, RenderShapeCollection renderShapes)
           Fills the four quadrant area with the quadrant paint.
protected  void drawZeroDomainBaseline(java.awt.geom.Rectangle2D dataArea, PlotShapeCollection plotShapes)
           Draw zero line of domain axis.
protected  void drawZeroValueBaseline(java.awt.geom.Rectangle2D dataArea, PlotShapeCollection plotShapes)
           Draw zero line of value axis.
 boolean equals(java.lang.Object obj)
          Tests this plot for equality with another object.
 AbstractValueAxis getDomainAxis()
           Returns the domain axis for the plot.
 AbstractValueAxis getDomainAxis(int index)
           Returns a domain axis.
 AbstractValueAxis getDomainAxisByRenderIndex(int renderIndex)
           Returns a domain axis.
 int getDomainAxisCount()
           Returns the number of category axes.
 RectangleEdge getDomainAxisEdge()
           Returns the domain axis edge.
 RectangleEdge getDomainAxisEdge(int index)
           Returns the edge for a domain axis.
 int getDomainAxisIndex(AbstractValueAxis axis)
           Returns the index of the specified axis, or -1 if the axis is not assigned to the plot.
 AxisLocation getDomainAxisLocation()
           Returns the domain axis location for the primary domain axis.
 AxisLocation getDomainAxisLocation(int index)
           Returns the location for a domain axis.
 java.awt.Paint getDomainZeroBaselinePaint()
           Returns the paint for the zero baseline (if any) plotted against the domain axis.
 java.awt.Stroke getDomainZeroBaselineStroke()
           Returns the stroke used for the zero baseline against the domain axis.
 PlotType getPlotType()
           Returns a short string describing the plot type.
 XYNumberChartData getQuadrantOrigin()
           Returns the origin point for the quadrants (if drawn).
 java.awt.Paint getQuadrantPaint(int index)
           Returns the paint used for the specified quadrant.
 AbstractXYRender getRender()
           Returns a reference to the render for the plot.
 AbstractXYRender getRender(int index)
           Returns the render at the given index.
 int getRenderIndex(AbstractXYRender render)
           Returns the index of the specified render, or -1 if the render is not assigned to this plot.
 java.util.Collection getRenders()
           Returns the collection of renders,and this collection is unmodifiable.
 java.awt.Paint getValueZeroBaselinePaint()
           Returns the paint for the zero baseline (if any) plotted against the value axis.
 java.awt.Stroke getValueZeroBaselineStroke()
           Returns the stroke used for the zero baseline against the value axis.
 int hashCode()
           Returns a hash code for this object.
 boolean isDomainZeroBaselineVisible()
           Returns a flag that controls whether or not a zero baseline is displayed for the domain axis.
 boolean isValueZeroBaselineVisible()
           Returns a flag that controls whether or not a zero baseline is displayed for the value axis.
 void setDomainAxes(AbstractValueAxis[] axes)
           Sets the domain axes for this plot and sends a PlotChangeEvent to all registered listeners.
 void setDomainAxes(AbstractValueAxis[] axes, int startIndex)
           Sets the domain axes for this plot and sends a PlotChangeEvent to all registered listeners.
 void setDomainAxis(AbstractValueAxis axis)
           Sets the domain axis for the plot and sends a PlotChangeEvent to all registered listeners.
 void setDomainAxis(int index, AbstractValueAxis axis)
           Sets a domain axis and sends a PlotChangeEvent to all registered listeners.
 void setDomainAxis(int index, AbstractValueAxis axis, boolean notify)
           Sets a domain axis and sends a PlotChangeEvent to all registered listeners.
 void setDomainAxisLocation(AxisLocation location)
           Sets the location of the domain axis and, if requested, sends a PlotChangeEvent to all registered listeners.
 void setDomainAxisLocation(int index, AxisLocation location)
           Sets the location for a domain axis and sends a PlotChangeEvent to all registered listeners.
 void setDomainZeroBaselinePaint(java.awt.Paint paint)
           Sets the paint for the zero baseline plotted against the domain axis and sends a PlotChangeEvent to all registered listeners.
 void setDomainZeroBaselineStroke(java.awt.Stroke stroke)
           Sets the stroke for the zero baseline for the domain axis, and sends a PlotChangeEvent to all registered listeners.
 void setDomainZeroBaselineVisible(boolean visible)
           Sets the flag that controls whether or not the zero baseline is displayed for the domain axis, and sends a PlotChangeEvent to all registered listeners.
 void setQuadrantOrigin(XYNumberChartData origin)
           Sets the quadrant origin and sends a PlotChangeEvent to all registered listeners.
 void setQuadrantPaint(int index, java.awt.Paint paint)
           Sets the paint used for the specified quadrant and sends a PlotChangeEvent to all registered listeners.
 void setRender(AbstractXYRender render)
           Sets the render at index 0 (sometimes referred to as the "primary" render) and sends a PlotChangeEvent to all registered listeners.
 void setRender(AbstractXYRender render, boolean notify)
           Sets the render at index 0 (sometimes referred to as the "primary" render) and, if requested, sends a PlotChangeEvent to all registered listeners.
 void setRender(int index, AbstractXYRender render)
           Sets the render at the specified index and sends a PlotChangeEvent to all registered listeners.
 void setRender(int index, AbstractXYRender render, boolean notify)
           Sets a render.
 void setRenders(AbstractXYRender[] renders, int startIndex)
           Sets the renders for this plot and sends a PlotChangeEvent to all registered listeners.
 void setValueZeroBaselinePaint(java.awt.Paint paint)
           Sets the paint for the zero baseline plotted against the value axis and sends a PlotChangeEvent to all registered listeners.
 void setValueZeroBaselineStroke(java.awt.Stroke stroke)
           Sets the stroke for the zero baseline for the value axis, and sends a PlotChangeEvent to all registered listeners.
 void setValueZeroBaselineVisible(boolean visible)
           Sets the flag that controls whether or not the zero baseline is displayed for the value axis, and sends a PlotChangeEvent to all registered listeners.
 java.lang.String toString()
           Override toString method.
 void zoomDomainAxes(java.awt.geom.Rectangle2D selectArea, java.awt.geom.Rectangle2D dataArea, java.awt.geom.Point2D source)
           Zoom domain axes.
 
Methods inherited from class com.ijchart.xychart.plot.AbstractAxisPlot
allocateRenderShapesList, clearDomainAxes, clearValueAxes, drawCrosshair, drawValueGridlines, getAxisOffset, getCrosshairPoint, getDomainCrosshairPaint, getDomainCrosshairStroke, getDomainGridlinePaint, getDomainGridlineStroke, getOrientation, getRenderIndexForValueAxis, getRenderShapeCollection, getValueAxis, getValueAxis, getValueAxisByRenderIndex, getValueAxisCount, getValueAxisEdge, getValueAxisEdge, getValueAxisIndex, getValueAxisLocation, getValueAxisLocation, getValueCrosshairPaint, getValueCrosshairStroke, getValueGridlinePaint, getValueGridlineStroke, isDomainCrosshairLockedOnData, isDomainCrosshairVisible, isDomainGridlineVisible, isValueCrosshairLockedOnData, isValueCrosshairVisible, isValueGridlineVisible, mapRenderToDomainAxis, mapRenderToValueAxis, mapValueAxisToRender, setAxisOffset, setDomainCrosshairLockedOnData, setDomainCrosshairPaint, setDomainCrosshairStroke, setDomainCrosshairVisible, setDomainGridlinePaint, setDomainGridlineStroke, setDomainGridlineVisible, setOrientation, setValueAxes, setValueAxes, setValueAxis, setValueAxis, setValueAxis, setValueAxisLocation, setValueAxisLocation, setValueAxisLocation, setValueAxisLocation, setValueCrosshairLockedOnData, setValueCrosshairPaint, setValueCrosshairStroke, setValueCrosshairVisible, setValueGridlinePaint, setValueGridlineStroke, setValueGridlineVisible, translateMarkerShapes, zoomValueAxes
 
Methods inherited from class com.ijchart.xychart.plot.AbstractPlot
addChangeListener, axisChanged, datasetChanged, drawBackground, drawBackgroundImage, drawBorder, drawNoDataMessage, firePlotChanged, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundImageAlpha, getBackgroundPaint, getBorderPaint, getBorderStroke, getDataArea, getDrawingSupplier, getForegroundAlpha, getInsets, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getRenderDrawOrder, getRenderShapesList, getSubPlots, handleClick, isBorderVisible, isDomainZoomable, isDrawNoDataMessage, isValueZoomable, notifyListeners, removeChangeListener, renderChanged, resolveDomainAxisLocation, resolveValueAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setBorderPaint, setBorderStroke, setBorderVisible, setDrawingSupplier, setDrawNoDataMessage, setForegroundAlpha, setInsets, setListObject, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setRenderDrawOrder
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ijchart.xychart.listener.IRenderChangeListener
renderChanged
 

Field Detail

DEFAULT_VALUE_ZERO_BASELINE_VISIBLE

public static final boolean DEFAULT_VALUE_ZERO_BASELINE_VISIBLE
A default flag that controls whether or not the zero baseline against the value axis is visible.

See Also:
Constant Field Values

DEFAULT_QUADRANT_ORIGIN

public static final XYNumberChartData DEFAULT_QUADRANT_ORIGIN
The default origin point for the quadrants (if drawn).


DEFAULT_QUADRANT_PAINT

public static final java.awt.Paint[] DEFAULT_QUADRANT_PAINT
The default paint used for each quadrant.

Constructor Detail

XYPlot

public XYPlot()
Creates a new XYPlot instance with no dataset, no axes and no render. You should specify these items before using the plot.


XYPlot

public XYPlot(AbstractValueAxis domainAxis,
              AbstractValueAxis valueAxis,
              AbstractXYRender render)
Creates a new plot with the specified dataset, axes and render. Any of the arguments can be null, but in that case you should take care to specify the value before using the plot (otherwise a NullPointerException maybe thrown).

Parameters:
domainAxis - AbstractValueAxis The domain axis (null permitted).
valueAxis - AbstractValueAxis The value axis (null permitted).
render - AbstractXYRender The item render (null permitted).
Method Detail

getDomainAxisLocation

public AxisLocation getDomainAxisLocation()
Returns the domain axis location for the primary domain axis.

Returns:
The location (never null).

getDomainAxisLocation

public AxisLocation getDomainAxisLocation(int index)
Returns the location for a domain axis.

Parameters:
index - The axis index,must be greater than or equal to 0.
Returns:
The location.

setDomainAxisLocation

public void setDomainAxisLocation(AxisLocation location)
Sets the location of the domain axis and, if requested, sends a PlotChangeEvent to all registered listeners.

Parameters:
location - The axis location (null not permitted).

setDomainAxisLocation

public void setDomainAxisLocation(int index,
                                  AxisLocation location)
Sets the location for a domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters:
index - The axis index,must be greater than or equal to 0.
location - The location (null not permitted).

getDomainAxisEdge

public RectangleEdge getDomainAxisEdge()
Returns the domain axis edge. This is derived from the axis location and the chart orientation.

Returns:
The edge (never null).

getDomainAxisEdge

public RectangleEdge getDomainAxisEdge(int index)
Returns the edge for a domain axis.

Parameters:
index - The axis index,must be greater than or equal to 0.
Returns:
The edge (never null).

getDomainAxis

public AbstractValueAxis getDomainAxis()
Returns the domain axis for the plot.

Returns:
The domain axis (null permitted).

getDomainAxis

public AbstractValueAxis getDomainAxis(int index)
Returns a domain axis.

Parameters:
index - The axis index.
Returns:
The axis (null possible).

getDomainAxisByRenderIndex

public AbstractValueAxis getDomainAxisByRenderIndex(int renderIndex)
Returns a domain axis.

Parameters:
renderIndex - The index of render.
Returns:
The axis (null possible).

setDomainAxis

public void setDomainAxis(AbstractValueAxis axis)
Sets the domain axis for the plot and sends a PlotChangeEvent to all registered listeners.

Parameters:
axis - AbstractValueAxis The axis (null not permitted).

setDomainAxis

public void setDomainAxis(int index,
                          AbstractValueAxis axis)
Sets a domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters:
index - int The axis index,must be greater than or equal to 0.
axis - AbstractValueAxis The axis (null not permitted).

setDomainAxis

public void setDomainAxis(int index,
                          AbstractValueAxis axis,
                          boolean notify)
Sets a domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters:
index - int The axis index,must be greater than or equal to 0.
axis - AbstractValueAxis The axis (null not permitted).
notify - boolean Whether or not notify listener.

setDomainAxes

public void setDomainAxes(AbstractValueAxis[] axes)
Sets the domain axes for this plot and sends a PlotChangeEvent to all registered listeners.

Parameters:
axes - AbstractValueAxis[] The axes (null not permitted).

setDomainAxes

public void setDomainAxes(AbstractValueAxis[] axes,
                          int startIndex)
Sets the domain axes for this plot and sends a PlotChangeEvent to all registered listeners.

Parameters:
axes - AbstractValueAxis[] The axes (null not permitted).
startIndex - int The beginning of the index value, startIndex before the target will not be covered. must be greater than or equal to 0.

getDomainAxisCount

public int getDomainAxisCount()
Returns the number of category axes.

Returns:
The axis count.

getDomainAxisIndex

public int getDomainAxisIndex(AbstractValueAxis axis)
Returns the index of the specified axis, or -1 if the axis is not assigned to the plot.

Parameters:
axis - The axis (null not permitted).
Returns:
The axis index.

isDomainZeroBaselineVisible

public boolean isDomainZeroBaselineVisible()
Returns a flag that controls whether or not a zero baseline is displayed for the domain axis.

Returns:
boolean A boolean.

setDomainZeroBaselineVisible

public void setDomainZeroBaselineVisible(boolean visible)
Sets the flag that controls whether or not the zero baseline is displayed for the domain axis, and sends a PlotChangeEvent to all registered listeners.

Parameters:
visible - boolean The flag.

getDomainZeroBaselineStroke

public java.awt.Stroke getDomainZeroBaselineStroke()
Returns the stroke used for the zero baseline against the domain axis.

Returns:
Stroke The stroke (never null).

setDomainZeroBaselineStroke

public void setDomainZeroBaselineStroke(java.awt.Stroke stroke)
Sets the stroke for the zero baseline for the domain axis, and sends a PlotChangeEvent to all registered listeners.

Parameters:
stroke - Stroke The stroke (null not permitted).

getDomainZeroBaselinePaint

public java.awt.Paint getDomainZeroBaselinePaint()
Returns the paint for the zero baseline (if any) plotted against the domain axis.

Returns:
Paint The paint (never null).

setDomainZeroBaselinePaint

public void setDomainZeroBaselinePaint(java.awt.Paint paint)
Sets the paint for the zero baseline plotted against the domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters:
paint - Paint The paint (null not permitted).

isValueZeroBaselineVisible

public boolean isValueZeroBaselineVisible()
Returns a flag that controls whether or not a zero baseline is displayed for the value axis.

Returns:
boolean A boolean.

setValueZeroBaselineVisible

public void setValueZeroBaselineVisible(boolean visible)
Sets the flag that controls whether or not the zero baseline is displayed for the value axis, and sends a PlotChangeEvent to all registered listeners.

Parameters:
visible - boolean The flag.

getValueZeroBaselineStroke

public java.awt.Stroke getValueZeroBaselineStroke()
Returns the stroke used for the zero baseline against the value axis.

Returns:
Stroke The stroke (never null).

setValueZeroBaselineStroke

public void setValueZeroBaselineStroke(java.awt.Stroke stroke)
Sets the stroke for the zero baseline for the value axis, and sends a PlotChangeEvent to all registered listeners.

Parameters:
stroke - Stroke The stroke (null not permitted).

getValueZeroBaselinePaint

public java.awt.Paint getValueZeroBaselinePaint()
Returns the paint for the zero baseline (if any) plotted against the value axis.

Returns:
Paint The paint (never null).

setValueZeroBaselinePaint

public void setValueZeroBaselinePaint(java.awt.Paint paint)
Sets the paint for the zero baseline plotted against the value axis and sends a PlotChangeEvent to all registered listeners.

Parameters:
paint - Paint The paint (null not permitted).

getQuadrantOrigin

public XYNumberChartData getQuadrantOrigin()
Returns the origin point for the quadrants (if drawn).

Returns:
Point2D The origin point (never null).

setQuadrantOrigin

public void setQuadrantOrigin(XYNumberChartData origin)
Sets the quadrant origin and sends a PlotChangeEvent to all registered listeners.

Parameters:
origin - XYNumberChartData The origin point (null not permitted).

getQuadrantPaint

public java.awt.Paint getQuadrantPaint(int index)
Returns the paint used for the specified quadrant.

Parameters:
index - int The quadrant index (0-3).
Returns:
Paint The paint (maybe null).

setQuadrantPaint

public void setQuadrantPaint(int index,
                             java.awt.Paint paint)
Sets the paint used for the specified quadrant and sends a PlotChangeEvent to all registered listeners.

Parameters:
index - int The quadrant index (0-3).
paint - Paint The paint (null permitted).

zoomDomainAxes

public void zoomDomainAxes(java.awt.geom.Rectangle2D selectArea,
                           java.awt.geom.Rectangle2D dataArea,
                           java.awt.geom.Point2D source)
Zoom domain axes.

Specified by:
zoomDomainAxes in interface IZoomable
Overrides:
zoomDomainAxes in class AbstractPlot
Parameters:
selectArea - Rectangle2D The selected area,null to restore chart.
dataArea - Rectangle2D The data area,null to restore chart.
source - Point2D The source mouse point (null not permitted).

draw

public void draw(java.awt.Graphics2D g2,
                 java.awt.geom.Rectangle2D plotArea,
                 ChartShapeCollection chartShapes)
Draws the plot within the specified area.Subclasses need to provide an implementation of this method, obviously.

Specified by:
draw in class AbstractPlot
Parameters:
g2 - Graphics2D The graphics device (null not permitted).
plotArea - Rectangle2D The plot area (null not permitted).
chartShapes - ChartShapeCollection Collects information about the chart (null not permitted).

drawAxes

protected java.awt.geom.Rectangle2D drawAxes(java.awt.Graphics2D g2,
                                             java.awt.geom.Rectangle2D plotArea,
                                             PlotShapeCollection shapeCollection)
A utility method for drawing the plot's axes.

Parameters:
g2 - Graphics2D The graphics device (null not permitted).
plotArea - Rectangle2D The plot draw area (null not permitted).
shapeCollection - PlotShapeCollection Collects information about the plot (null not permitted).
Returns:
Rectangle2D The data area.

drawQuadrantBackground

protected void drawQuadrantBackground(java.awt.geom.Rectangle2D dataArea,
                                      ChartOrientation orientation,
                                      AbstractValueAxis domainAxis,
                                      AbstractValueAxis valueAxis,
                                      RenderShapeCollection renderShapes)
Fills the four quadrant area with the quadrant paint.

Parameters:
dataArea - Rectangle2D The chart data area (null not permitted).
orientation - ChartOrientation The chart draw orientation.
domainAxis - AbstractValueAxis Returns the domain axis for the plot.
valueAxis - AbstractValueAxis Returns the domain axis for the plot.
renderShapes - RenderShapeCollection Collects information about the render (null not permitted).

drawZeroDomainBaseline

protected void drawZeroDomainBaseline(java.awt.geom.Rectangle2D dataArea,
                                      PlotShapeCollection plotShapes)
Draw zero line of domain axis.

Parameters:
dataArea - Rectangle2D The data area (null not permitted).
plotShapes - PlotShapeCollection Collects information about the plot (null not permitted).

drawZeroValueBaseline

protected void drawZeroValueBaseline(java.awt.geom.Rectangle2D dataArea,
                                     PlotShapeCollection plotShapes)
Draw zero line of value axis.

Parameters:
dataArea - Rectangle2D The data area (null not permitted).
plotShapes - PlotShapeCollection Collects information about the plot (null not permitted).

getRender

public AbstractXYRender getRender()
Returns a reference to the render for the plot.

Returns:
AbstractXYRender The render.

getRender

public AbstractXYRender getRender(int index)
Returns the render at the given index.

Parameters:
index - The render index (zero-based).
Returns:
AbstractXYRender The render (possibly null).

getRenders

public java.util.Collection getRenders()
Returns the collection of renders,and this collection is unmodifiable.

Specified by:
getRenders in class AbstractPlot
Returns:
Collection The collection of renders.

setRender

public void setRender(AbstractXYRender render)
Sets the render at index 0 (sometimes referred to as the "primary" render) and sends a PlotChangeEvent to all registered listeners.

Parameters:
render - AbstractXYRender The render (null not permitted.

setRender

public void setRender(AbstractXYRender render,
                      boolean notify)
Sets the render at index 0 (sometimes referred to as the "primary" render) and, if requested, sends a PlotChangeEvent to all registered listeners.

Parameters:
render - AbstractXYRender The render (null not permitted).
notify - boolean Whether or not notify listeners.

setRender

public void setRender(int index,
                      AbstractXYRender render)
Sets the render at the specified index and sends a PlotChangeEvent to all registered listeners.

Parameters:
index - int The index (zero-based).
render - AbstractXYRender The render (null not permitted).

setRender

public void setRender(int index,
                      AbstractXYRender render,
                      boolean notify)
Sets a render. A PlotChangeEvent is sent to all registered listeners.

Parameters:
index - int The dataset index (zero-based).
render - AbstractXYRender The render (null not permitted).
notify - boolean Whether or not notify listeners.

setRenders

public void setRenders(AbstractXYRender[] renders,
                       int startIndex)
Sets the renders for this plot and sends a PlotChangeEvent to all registered listeners.

Parameters:
renders - AbstractXYRender[] The renders (null not permitted).
startIndex - int The beginning of the index value, startIndex before the target will not be covered. must be greater than or equal to 0.

getRenderIndex

public int getRenderIndex(AbstractXYRender render)
Returns the index of the specified render, or -1 if the render is not assigned to this plot.

Parameters:
render - AbstractXYRender The render (null permitted).
Returns:
int The render index.

getPlotType

public PlotType getPlotType()
Returns a short string describing the plot type.

Specified by:
getPlotType in class AbstractPlot
Returns:
The plot type.

hashCode

public int hashCode()
Returns a hash code for this object.

Overrides:
hashCode in class AbstractAxisPlot
Returns:
A hash code.

equals

public boolean equals(java.lang.Object obj)
Tests this plot for equality with another object.

Overrides:
equals in class AbstractAxisPlot
Parameters:
obj - the object (null permitted).
Returns:
true or false.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of the plot.

Overrides:
clone in class AbstractAxisPlot
Returns:
A clone.
Throws:
java.lang.CloneNotSupportedException - this can occur if some component of the plot cannot be cloned.

toString

public java.lang.String toString()
Override toString method.

Overrides:
toString in class AbstractAxisPlot
Returns:
String