org.jfree.chart.plot
Class FastScatterPlot

java.lang.Object
  |
  +--org.jfree.chart.plot.Plot
        |
        +--org.jfree.chart.plot.FastScatterPlot
All Implemented Interfaces:
AxisChangeListener, AxisConstants, DatasetChangeListener, java.util.EventListener, HorizontalValuePlot, java.io.Serializable, VerticalValuePlot

public class FastScatterPlot
extends Plot
implements HorizontalValuePlot, VerticalValuePlot, java.io.Serializable

A fast scatter plot.

Author:
David Gilbert
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jfree.chart.plot.Plot
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, ZERO
 
Fields inherited from interface org.jfree.chart.axis.AxisConstants
BOTTOM, DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_AXIS_VISIBLE, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_LABELS_VISIBLE, DEFAULT_TICK_MARK_INSIDE_LENGTH, DEFAULT_TICK_MARK_OUTSIDE_LENGTH, DEFAULT_TICK_MARK_PAINT, DEFAULT_TICK_MARK_STROKE, DEFAULT_TICK_MARKS_VISIBLE, LEFT, RIGHT, TOP
 
Constructor Summary
FastScatterPlot(float[][] data, ValueAxis domainAxis, ValueAxis rangeAxis)
          Creates a new fast scatter plot.
 
Method Summary
 void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, ChartRenderingInfo info)
          Draws the fast scatter plot on a Java 2D graphics device (such as the screen or a printer).
 ValueAxis getDomainAxis()
          Returns the domain axis for the plot.
 Range getHorizontalDataRange(ValueAxis axis)
          Returns the range of data values to be plotted along the horizontal axis.
 ValueAxis getHorizontalValueAxis()
          Get the value axis.
 java.lang.String getPlotType()
          Returns a short string describing the plot type.
 ValueAxis getRangeAxis()
          Returns the range axis for the plot.
 Range getVerticalDataRange(ValueAxis axis)
          Returns the range for the data to be plotted against the vertical axis.
 ValueAxis getVerticalValueAxis()
          Returns the vertical axis.
 void render(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, ChartRenderingInfo info, CrosshairInfo crosshairInfo)
          Draws a representation of the data within the dataArea region.
 
Methods inherited from class org.jfree.chart.plot.Plot
addChangeListener, axisChanged, datasetChanged, drawBackground, drawNoDataMessage, drawOutline, equals, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundPaint, getDataAreaRatio, getDataset, getDatasetGroup, getForegroundAlpha, getInsets, getLegendItems, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOppositeAxisLocation, getOutlinePaint, getOutlineStroke, getParent, getRectX, getRectY, getRootPlot, getSecondaryDataset, handleClick, isSubplot, notifyListeners, removeChangeListener, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundPaint, setDataAreaRatio, setDataset, setDatasetGroup, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setOutlinePaint, setOutlineStroke, setParent, setSecondaryDataset, zoom
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastScatterPlot

public FastScatterPlot(float[][] data,
                       ValueAxis domainAxis,
                       ValueAxis rangeAxis)
Creates a new fast scatter plot.

The data is an array of x, y values: data[0][i] = x, data[1][i] = y.

Parameters:
data - the data.
domainAxis - the domain (x) axis.
rangeAxis - the range (y) axis.
Method Detail

getDomainAxis

public ValueAxis getDomainAxis()
Returns the domain axis for the plot. If the domain axis for this plot is null, then the method will return the parent plot's domain axis (if there is a parent plot).

Returns:
the domain axis.

getRangeAxis

public ValueAxis getRangeAxis()
Returns the range axis for the plot. If the range axis for this plot is null, then the method will return the parent plot's range axis (if there is a parent plot).

Returns:
the range axis.

draw

public void draw(java.awt.Graphics2D g2,
                 java.awt.geom.Rectangle2D plotArea,
                 ChartRenderingInfo info)
Draws the fast scatter plot on a Java 2D graphics device (such as the screen or a printer).

Specified by:
draw in class Plot
Parameters:
g2 - the graphics device.
plotArea - the area within which the plot (including axis labels) should be drawn.
info - collects chart drawing information (null permitted).

render

public void render(java.awt.Graphics2D g2,
                   java.awt.geom.Rectangle2D dataArea,
                   ChartRenderingInfo info,
                   CrosshairInfo crosshairInfo)
Draws a representation of the data within the dataArea region.

The info and crosshairInfo arguments may be null.

Parameters:
g2 - the graphics device.
dataArea - the region in which the data is to be drawn.
info - an optional object for collection dimension information.
crosshairInfo - an optional object for collecting crosshair info.

getPlotType

public java.lang.String getPlotType()
Returns a short string describing the plot type.

Specified by:
getPlotType in class Plot
Returns:
a short string describing the plot type.

getHorizontalDataRange

public Range getHorizontalDataRange(ValueAxis axis)
Returns the range of data values to be plotted along the horizontal axis.

Specified by:
getHorizontalDataRange in interface HorizontalValuePlot
Parameters:
axis - the axis.
Returns:
the range.

getHorizontalValueAxis

public ValueAxis getHorizontalValueAxis()
Get the value axis.

Specified by:
getHorizontalValueAxis in interface HorizontalValuePlot
Returns:
the value axis.

getVerticalDataRange

public Range getVerticalDataRange(ValueAxis axis)
Returns the range for the data to be plotted against the vertical axis.

Specified by:
getVerticalDataRange in interface VerticalValuePlot
Parameters:
axis - the axis.
Returns:
the range.

getVerticalValueAxis

public ValueAxis getVerticalValueAxis()
Returns the vertical axis.

Specified by:
getVerticalValueAxis in interface VerticalValuePlot
Returns:
the axis.