Package org.jfree.chart.plot
Class FastScatterPlot
java.lang.Object
org.jfree.chart.plot.Plot
org.jfree.chart.plot.FastScatterPlot
- All Implemented Interfaces:
Serializable,Cloneable,EventListener,AxisChangeListener,ValueAxisPlot,DatasetChangeListener
public class FastScatterPlot extends Plot implements ValueAxisPlot, Cloneable, Serializable
A fast scatter plot.
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static PaintDEFAULT_GRIDLINE_PAINTThe default grid line paint.static StrokeDEFAULT_GRIDLINE_STROKEThe default grid line stroke.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 -
Constructor Summary
Constructors Constructor Description FastScatterPlot()Creates an empty plot.FastScatterPlot(float[][] data, ValueAxis domainAxis, ValueAxis rangeAxis)Creates a new fast scatter plot. -
Method Summary
Modifier and Type Method Description Objectclone()Returns a clone of the plot.voiddraw(Graphics2D g2, Rectangle2D plotArea, PlotState parentState, PlotRenderingInfo info)Draws the fast scatter plot on a Java 2D graphics device (such as the screen or a printer).booleanequals(Object object)Tests an object for equality with this instance.RangegetDataRange(ValueAxis axis)Returns the range of data values to be plotted along the axis.ValueAxisgetDomainAxis()Returns the domain axis for the plot.PaintgetDomainGridlinePaint()Returns the paint for the grid lines (if any) plotted against the domain axis.StrokegetDomainGridlineStroke()Returns the stroke for the grid-lines (if any) plotted against the domain axis.PaintgetPaint()Returns the paint used to plot data points.StringgetPlotType()Returns a short string describing the plot type.ValueAxisgetRangeAxis()Returns the range axis for the plot.PaintgetRangeGridlinePaint()Returns the paint for the grid lines (if any) plotted against the range axis.StrokegetRangeGridlineStroke()Returns the stroke for the grid lines (if any) plotted against the range axis.booleanisDomainGridlinesVisible()Returnstrueif the domain gridlines are visible, andfalseotherwise.booleanisRangeGridlinesVisible()Returnstrueif the range axis grid is visible, andfalseotherwise.voidrender(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info, CrosshairState crosshairState)Draws a representation of the data within the dataArea region.voidsetDomainGridlinePaint(Paint paint)Sets the paint for the grid lines plotted against the domain axis.voidsetDomainGridlineStroke(Stroke stroke)Sets the stroke for the grid lines plotted against the domain axis.voidsetDomainGridlinesVisible(boolean visible)Sets the flag that controls whether or not the domain grid-lines are visible.voidsetPaint(Paint paint)Sets the color for the data points and sends aPlotChangeEventto all registered listeners.voidsetRangeGridlinePaint(Paint paint)Sets the paint for the grid lines plotted against the range axis.voidsetRangeGridlineStroke(Stroke stroke)Sets the stroke for the grid lines plotted against the range axis.voidsetRangeGridlinesVisible(boolean visible)Sets the flag that controls whether or not the range axis grid lines are visible.voidzoomHorizontalAxes(double factor)Multiplies the range on the horizontal axis/axes by the specified factor (not yet implemented).voidzoomHorizontalAxes(double lowerPercent, double upperPercent)Zooms in on the horizontal axes (not yet implemented).voidzoomVerticalAxes(double factor)Multiplies the range on the vertical axis/axes by the specified factor (not yet implemented).voidzoomVerticalAxes(double lowerPercent, double upperPercent)Zooms in on the vertical axes (not yet implemented).Methods inherited from class org.jfree.chart.plot.Plot
addChangeListener, axisChanged, datasetChanged, draw, drawBackground, drawOutline, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundPaint, getDataAreaRatio, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getLegendItems, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getRootPlot, handleClick, isPlotShowing, isSubplot, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundPaint, setDataAreaRatio, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setOutlinePaint, setOutlineStroke, setParent, setPlotShowing, zoom
-
Field Details
-
DEFAULT_GRIDLINE_STROKE
The default grid line stroke. -
DEFAULT_GRIDLINE_PAINT
The default grid line paint.
-
-
Constructor Details
-
FastScatterPlot
public FastScatterPlot()Creates an empty plot. -
FastScatterPlot
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 Details
-
getPlotType
Returns a short string describing the plot type.- Specified by:
getPlotTypein classPlot- Returns:
- a short string describing the plot type.
-
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
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.
-
getPaint
Returns the paint used to plot data points.- Returns:
- The paint.
-
setPaint
Sets the color for the data points and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint.
-
isDomainGridlinesVisible
public boolean isDomainGridlinesVisible()Returnstrueif the domain gridlines are visible, andfalseotherwise. @returntrueorfalse. -
setDomainGridlinesVisible
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
PlotChangeEventis sent to all registered listeners.- Parameters:
visible- the new value of the flag.
-
getDomainGridlineStroke
Returns the stroke for the grid-lines (if any) plotted against the domain axis.- Returns:
- the stroke.
-
setDomainGridlineStroke
Sets the stroke for the grid lines plotted against the domain axis.If you set this to
null, no grid lines will be drawn.- Parameters:
stroke- the stroke (nullpermitted).
-
getDomainGridlinePaint
Returns the paint for the grid lines (if any) plotted against the domain axis.- Returns:
- the paint.
-
setDomainGridlinePaint
Sets the paint for the grid lines plotted against the domain axis.If you set this to
null, no grid lines will be drawn.- Parameters:
paint- the paint (nullpermitted).
-
isRangeGridlinesVisible
public boolean isRangeGridlinesVisible()Returnstrueif the range axis grid is visible, andfalseotherwise. @returntrueorfalse. -
setRangeGridlinesVisible
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
PlotChangeEventis sent to all registered listeners.- Parameters:
visible- the new value of the flag.
-
getRangeGridlineStroke
Returns the stroke for the grid lines (if any) plotted against the range axis.- Returns:
- the stroke.
-
setRangeGridlineStroke
Sets the stroke for the grid lines plotted against the range axis.If you set this to
null, no grid lines will be drawn.- Parameters:
stroke- the stroke (nullpermitted).
-
getRangeGridlinePaint
Returns the paint for the grid lines (if any) plotted against the range axis.- Returns:
- the paint.
-
setRangeGridlinePaint
Sets the paint for the grid lines plotted against the range axis.If you set this to
null, no grid lines will be drawn.- Parameters:
paint- the paint (nullpermitted).
-
draw
public void draw(Graphics2D g2, Rectangle2D plotArea, PlotState parentState, PlotRenderingInfo info)Draws the fast scatter plot on a Java 2D graphics device (such as the screen or a printer). -
render
public void render(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info, CrosshairState crosshairState)Draws a representation of the data within the dataArea region.The
infoandcrosshairStatearguments may benull.- 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 (nullpermitted).
-
getDataRange
Returns the range of data values to be plotted along the axis.- Specified by:
getDataRangein interfaceValueAxisPlot- Parameters:
axis- the axis.- Returns:
- the range.
-
zoomHorizontalAxes
public void zoomHorizontalAxes(double factor)Multiplies the range on the horizontal axis/axes by the specified factor (not yet implemented).- Specified by:
zoomHorizontalAxesin interfaceValueAxisPlot- Parameters:
factor- the zoom factor.
-
zoomHorizontalAxes
public void zoomHorizontalAxes(double lowerPercent, double upperPercent)Zooms in on the horizontal axes (not yet implemented).- Specified by:
zoomHorizontalAxesin interfaceValueAxisPlot- 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.
-
zoomVerticalAxes
public void zoomVerticalAxes(double factor)Multiplies the range on the vertical axis/axes by the specified factor (not yet implemented).- Specified by:
zoomVerticalAxesin interfaceValueAxisPlot- Parameters:
factor- the zoom factor.
-
zoomVerticalAxes
public void zoomVerticalAxes(double lowerPercent, double upperPercent)Zooms in on the vertical axes (not yet implemented).- Specified by:
zoomVerticalAxesin interfaceValueAxisPlot- 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.
-
equals
Tests an object for equality with this instance. -
clone
Returns a clone of the plot.- Overrides:
clonein classPlot- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if some component of the plot does not support cloning.
-