public class

FastScatterPlot

extends Plot
implements Serializable Cloneable Pannable ValueAxisPlot Zoomable
java.lang.Object
   ↳ org.jfree.chart.plot.Plot
     ↳ org.jfree.chart.plot.FastScatterPlot

Class Overview

A fast scatter plot.

Summary

[Expand]
Inherited Constants
From class org.jfree.chart.plot.Plot
Fields
public static final Paint DEFAULT_GRIDLINE_PAINT The default grid line paint.
public static final Stroke DEFAULT_GRIDLINE_STROKE The default grid line stroke.
protected static ResourceBundle localizationResources The resourceBundle for the localization.
[Expand]
Inherited Fields
From class org.jfree.chart.plot.Plot
Public Constructors
FastScatterPlot()
Creates a new instance of FastScatterPlot with default axes.
FastScatterPlot(float[][] data, ValueAxis domainAxis, ValueAxis rangeAxis)
Creates a new fast scatter plot.
Public Methods
Object clone()
Returns a clone of the plot.
void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info)
Draws the fast scatter plot on a Java 2D graphics device (such as the screen or a printer).
boolean equals(Object obj)
Tests an arbitrary object for equality with this plot.
float[][] getData()
Returns the data array used by the plot.
Range getDataRange(ValueAxis axis)
Returns the range of data values to be plotted along the axis, or null if the specified axis isn't the domain axis or the range axis for the plot.
ValueAxis getDomainAxis()
Returns the domain axis for the plot.
Paint getDomainGridlinePaint()
Returns the paint for the grid lines (if any) plotted against the domain axis.
Stroke getDomainGridlineStroke()
Returns the stroke for the grid-lines (if any) plotted against the domain axis.
PlotOrientation getOrientation()
Returns the orientation of the plot.
Paint getPaint()
Returns the paint used to plot data points.
String getPlotType()
Returns a short string describing the plot type.
ValueAxis getRangeAxis()
Returns the range axis for the plot.
Paint getRangeGridlinePaint()
Returns the paint for the grid lines (if any) plotted against the range axis.
Stroke getRangeGridlineStroke()
Returns the stroke for the grid lines (if any) plotted against the range axis.
boolean isDomainGridlinesVisible()
Returns true if the domain gridlines are visible, and false otherwise.
boolean isDomainPannable()
Returns true if panning is enabled for the domain axes, and false otherwise.
boolean isDomainZoomable()
Returns true.
boolean isRangeGridlinesVisible()
Returns true if the range axis grid is visible, and false otherwise.
boolean isRangePannable()
Returns true if panning is enabled for the range axes, and false otherwise.
boolean isRangeZoomable()
Returns true.
void panDomainAxes(double percent, PlotRenderingInfo info, Point2D source)
Pans the domain axes by the specified percentage.
void panRangeAxes(double percent, PlotRenderingInfo info, Point2D source)
Pans the range axes by the specified percentage.
void render(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info, CrosshairState crosshairState)
Draws a representation of the data within the dataArea region.
void setData(float[][] data)
Sets the data array used by the plot and sends a PlotChangeEvent to all registered listeners.
void setDomainAxis(ValueAxis axis)
Sets the domain axis and sends a PlotChangeEvent to all registered listeners.
void setDomainGridlinePaint(Paint paint)
Sets the paint for the grid lines plotted against the domain axis and sends a PlotChangeEvent to all registered listeners.
void setDomainGridlineStroke(Stroke stroke)
Sets the stroke for the grid lines plotted against the domain axis and sends a PlotChangeEvent to all registered listeners.
void setDomainGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the domain grid-lines are visible.
void setDomainPannable(boolean pannable)
Sets the flag that enables or disables panning of the plot along the domain axes.
void setPaint(Paint paint)
Sets the color for the data points and sends a PlotChangeEvent to all registered listeners.
void setRangeAxis(ValueAxis axis)
Sets the range axis and sends a PlotChangeEvent to all registered listeners.
void setRangeGridlinePaint(Paint paint)
Sets the paint for the grid lines plotted against the range axis and sends a PlotChangeEvent to all registered listeners.
void setRangeGridlineStroke(Stroke stroke)
Sets the stroke for the grid lines plotted against the range axis and sends a PlotChangeEvent to all registered listeners.
void setRangeGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the range axis grid lines are visible.
void setRangePannable(boolean pannable)
Sets the flag that enables or disables panning of the plot along the range axes.
void zoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source)
Multiplies the range on the domain axis by the specified factor.
void zoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor)
Multiplies the range on the domain axis by the specified factor.
void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source)
Zooms in on the domain axes.
void zoomRangeAxes(double factor, PlotRenderingInfo info, Point2D source)
Multiplies the range on the range axis/axes by the specified factor.
void zoomRangeAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor)
Multiplies the range on the range axis by the specified factor.
void zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source)
Zooms in on the range axes.
Protected Methods
void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks)
Draws the gridlines for the plot, if they are visible.
void drawRangeGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks)
Draws the gridlines for the plot, if they are visible.
[Expand]
Inherited Methods
From class org.jfree.chart.plot.Plot
From class java.lang.Object
From interface org.jfree.chart.LegendItemSource
From interface org.jfree.chart.event.AxisChangeListener
From interface org.jfree.chart.event.MarkerChangeListener
From interface org.jfree.chart.plot.Pannable
From interface org.jfree.chart.plot.ValueAxisPlot
From interface org.jfree.chart.plot.Zoomable
From interface org.jfree.data.general.DatasetChangeListener

Fields

public static final Paint DEFAULT_GRIDLINE_PAINT

The default grid line paint.

public static final Stroke DEFAULT_GRIDLINE_STROKE

The default grid line stroke.

protected static ResourceBundle localizationResources

The resourceBundle for the localization.

Public Constructors

public FastScatterPlot ()

Creates a new instance of FastScatterPlot with default axes.

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 (null permitted).
domainAxis the domain (x) axis (null not permitted).
rangeAxis the range (y) axis (null not permitted).

Public Methods

public Object clone ()

Returns a clone of the plot.

Returns
  • A clone.
Throws
CloneNotSupportedException if some component of the plot does not support cloning.

public void draw (Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info)

Draws the fast scatter plot on a Java 2D graphics device (such as the screen or a printer).

Parameters
g2 the graphics device.
area the area within which the plot (including axis labels) should be drawn.
anchor the anchor point (null permitted).
parentState the state from the parent plot (ignored).
info collects chart drawing information (null permitted).

public boolean equals (Object obj)

Tests an arbitrary object for equality with this plot. Note that FastScatterPlot carries its data around with it (rather than referencing a dataset), and the data is included in the equality test.

Parameters
obj the object (null permitted).
Returns
  • A boolean.

public float[][] getData ()

Returns the data array used by the plot.

Returns
  • The data array (possibly null).

public Range getDataRange (ValueAxis axis)

Returns the range of data values to be plotted along the axis, or null if the specified axis isn't the domain axis or the range axis for the plot.

Parameters
axis the axis (null permitted).
Returns
  • The range (possibly null).

public ValueAxis getDomainAxis ()

Returns the domain axis for the plot.

Returns
  • The domain axis (never null).

public Paint getDomainGridlinePaint ()

Returns the paint for the grid lines (if any) plotted against the domain axis.

Returns
  • The paint (never null).

public Stroke getDomainGridlineStroke ()

Returns the stroke for the grid-lines (if any) plotted against the domain axis.

Returns
  • The stroke (never null).

public PlotOrientation getOrientation ()

Returns the orientation of the plot.

Returns

public Paint getPaint ()

Returns the paint used to plot data points. The default is Color.red.

Returns
  • The paint.
See Also

public String getPlotType ()

Returns a short string describing the plot type.

Returns
  • A short string describing the plot type.

public ValueAxis getRangeAxis ()

Returns the range axis for the plot.

Returns
  • The range axis (never null).

public Paint getRangeGridlinePaint ()

Returns the paint for the grid lines (if any) plotted against the range axis.

Returns
  • The paint (never null).

public Stroke getRangeGridlineStroke ()

Returns the stroke for the grid lines (if any) plotted against the range axis.

Returns
  • The stroke (never null).

public boolean isDomainGridlinesVisible ()

Returns true if the domain gridlines are visible, and false otherwise.

Returns
  • true or false.

public boolean isDomainPannable ()

Returns true if panning is enabled for the domain axes, and false otherwise.

Returns
  • A boolean.

public boolean isDomainZoomable ()

Returns true.

Returns
  • A boolean.

public boolean isRangeGridlinesVisible ()

Returns true if the range axis grid is visible, and false otherwise.

Returns
  • true or false.

public boolean isRangePannable ()

Returns true if panning is enabled for the range axes, and false otherwise.

Returns
  • A boolean.

public boolean isRangeZoomable ()

Returns true.

Returns
  • A boolean.

public void panDomainAxes (double percent, PlotRenderingInfo info, Point2D source)

Pans the domain axes by the specified percentage.

Parameters
percent the distance to pan (as a percentage of the axis length).
info the plot info
source the source point where the pan action started.

public void panRangeAxes (double percent, PlotRenderingInfo info, Point2D source)

Pans the range axes by the specified percentage.

Parameters
percent the distance to pan (as a percentage of the axis length).
info the plot info
source the source point where the pan action started.

public void render (Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info, CrosshairState crosshairState)

Draws a representation of the data within the dataArea region. The info and crosshairState 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.
crosshairState collects crosshair information (null permitted).

public void setData (float[][] data)

Sets the data array used by the plot and sends a PlotChangeEvent to all registered listeners.

Parameters
data the data array (null permitted).
See Also

public void setDomainAxis (ValueAxis axis)

Sets the domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters
axis the axis (null not permitted).
See Also

public void setDomainGridlinePaint (Paint paint)

Sets the paint for the grid lines plotted against the domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters
paint the paint (null not permitted).

public void setDomainGridlineStroke (Stroke stroke)

Sets the stroke for the grid lines plotted against the domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters
stroke the stroke (null not permitted).

public void setDomainGridlinesVisible (boolean visible)

Sets the flag that controls whether or not the domain grid-lines are visible. If the flag value is changed, a PlotChangeEvent is sent to all registered listeners.

Parameters
visible the new value of the flag.

public void setDomainPannable (boolean pannable)

Sets the flag that enables or disables panning of the plot along the domain axes.

Parameters
pannable the new flag value.

public void setPaint (Paint paint)

Sets the color for the data points and sends a PlotChangeEvent to all registered listeners.

Parameters
paint the paint (null not permitted).
See Also

public void setRangeAxis (ValueAxis axis)

Sets the range axis and sends a PlotChangeEvent to all registered listeners.

Parameters
axis the axis (null not permitted).
See Also

public void setRangeGridlinePaint (Paint paint)

Sets the paint for the grid lines plotted against the range axis and sends a PlotChangeEvent to all registered listeners.

Parameters
paint the paint (null not permitted).

public void setRangeGridlineStroke (Stroke stroke)

Sets the stroke for the grid lines plotted against the range axis and sends a PlotChangeEvent to all registered listeners.

Parameters
stroke the stroke (null permitted).

public void setRangeGridlinesVisible (boolean visible)

Sets the flag that controls whether or not the range axis grid lines are visible. If the flag value is changed, a PlotChangeEvent is sent to all registered listeners.

Parameters
visible the new value of the flag.

public void setRangePannable (boolean pannable)

Sets the flag that enables or disables panning of the plot along the range axes.

Parameters
pannable the new flag value.

public void zoomDomainAxes (double factor, PlotRenderingInfo info, Point2D source)

Multiplies the range on the domain axis by the specified factor.

Parameters
factor the zoom factor.
info the plot rendering info.
source the source point.

public void zoomDomainAxes (double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor)

Multiplies the range on the domain axis by the specified factor.

Parameters
factor the zoom factor.
info the plot rendering info.
source the source point (in Java2D space).
useAnchor use source point as zoom anchor?

public void zoomDomainAxes (double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source)

Zooms in on the domain axes.

Parameters
lowerPercent the new lower bound as a percentage of the current range.
upperPercent the new upper bound as a percentage of the current range.
info the plot rendering info.
source the source point.

public void zoomRangeAxes (double factor, PlotRenderingInfo info, Point2D source)

Multiplies the range on the range axis/axes by the specified factor.

Parameters
factor the zoom factor.
info the plot rendering info.
source the source point.

public void zoomRangeAxes (double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor)

Multiplies the range on the range axis by the specified factor.

Parameters
factor the zoom factor.
info the plot rendering info.
source the source point (in Java2D space).
useAnchor use source point as zoom anchor?

public void zoomRangeAxes (double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source)

Zooms in on the range axes.

Parameters
lowerPercent the new lower bound as a percentage of the current range.
upperPercent the new upper bound as a percentage of the current range.
info the plot rendering info.
source the source point.

Protected Methods

protected void drawDomainGridlines (Graphics2D g2, Rectangle2D dataArea, List ticks)

Draws the gridlines for the plot, if they are visible.

Parameters
g2 the graphics device.
dataArea the data area.
ticks the ticks.

protected void drawRangeGridlines (Graphics2D g2, Rectangle2D dataArea, List ticks)

Draws the gridlines for the plot, if they are visible.

Parameters
g2 the graphics device.
dataArea the data area.
ticks the ticks.