public class FastScatterPlot extends Plot implements ValueAxisPlot, Pannable, Zoomable, Cloneable, Serializable
Modifier and Type | Field and Description |
---|---|
static Paint |
DEFAULT_GRIDLINE_PAINT
The default grid line paint.
|
static Stroke |
DEFAULT_GRIDLINE_STROKE
The default grid line stroke.
|
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_LEGEND_ITEM_BOX, DEFAULT_LEGEND_ITEM_CIRCLE, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, ZERO
Constructor and Description |
---|
FastScatterPlot()
Creates a new instance of
FastScatterPlot with default
axes. |
FastScatterPlot(float[][] data,
ValueAxis domainAxis,
ValueAxis rangeAxis)
Creates a new fast scatter plot.
|
Modifier and Type | Method and Description |
---|---|
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 lowerPercent,
double upperPercent,
PlotRenderingInfo info,
Point2D source)
Zooms in on the domain 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 |
zoomRangeAxes(double lowerPercent,
double upperPercent,
PlotRenderingInfo info,
Point2D source)
Zooms in on the range 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.
|
addChangeListener, annotationChanged, axisChanged, datasetChanged, drawBackground, drawBackgroundImage, drawOutline, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundImageAlpha, getBackgroundPaint, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getLegendItems, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getRootPlot, handleClick, isNotify, isOutlineVisible, isSubplot, markerChanged, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setDrawingSupplier, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setNotify, setOutlinePaint, setOutlineStroke, setOutlineVisible, setParent, zoom
public static final Stroke DEFAULT_GRIDLINE_STROKE
public static final Paint DEFAULT_GRIDLINE_PAINT
public FastScatterPlot()
FastScatterPlot
with default
axes.public FastScatterPlot(float[][] data, ValueAxis domainAxis, ValueAxis rangeAxis)
The data is an array of x, y values: data[0][i] = x, data[1][i] = y.
data
- the data (null
permitted).domainAxis
- the domain (x) axis (null
not permitted).rangeAxis
- the range (y) axis (null
not permitted).public String getPlotType()
getPlotType
in class Plot
public float[][] getData()
null
).setData(float[][])
public void setData(float[][] data)
PlotChangeEvent
to all registered listeners.data
- the data array (null
permitted).getData()
public PlotOrientation getOrientation()
getOrientation
in interface Pannable
getOrientation
in interface Zoomable
PlotOrientation.VERTICAL
).public ValueAxis getDomainAxis()
null
).setDomainAxis(ValueAxis)
public void setDomainAxis(ValueAxis axis)
PlotChangeEvent
to all
registered listeners.axis
- the axis (null
not permitted).getDomainAxis()
public ValueAxis getRangeAxis()
null
).setRangeAxis(ValueAxis)
public void setRangeAxis(ValueAxis axis)
PlotChangeEvent
to all
registered listeners.axis
- the axis (null
not permitted).getRangeAxis()
public Paint getPaint()
Color.red
.setPaint(Paint)
public void setPaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getPaint()
public boolean isDomainGridlinesVisible()
true
if the domain gridlines are visible, and
false
otherwise.true
or false
.setDomainGridlinesVisible(boolean)
,
setDomainGridlinePaint(Paint)
public void setDomainGridlinesVisible(boolean visible)
PlotChangeEvent
is
sent to all registered listeners.visible
- the new value of the flag.getDomainGridlinePaint()
public Stroke getDomainGridlineStroke()
null
).setDomainGridlineStroke(Stroke)
public void setDomainGridlineStroke(Stroke stroke)
PlotChangeEvent
to all registered listeners.stroke
- the stroke (null
not permitted).getDomainGridlineStroke()
public Paint getDomainGridlinePaint()
null
).setDomainGridlinePaint(Paint)
public void setDomainGridlinePaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getDomainGridlinePaint()
public boolean isRangeGridlinesVisible()
true
if the range axis grid is visible, and
false
otherwise.true
or false
.setRangeGridlinesVisible(boolean)
public void setRangeGridlinesVisible(boolean visible)
PlotChangeEvent
is
sent to all registered listeners.visible
- the new value of the flag.isRangeGridlinesVisible()
public Stroke getRangeGridlineStroke()
null
).setRangeGridlineStroke(Stroke)
public void setRangeGridlineStroke(Stroke stroke)
PlotChangeEvent
to all registered listeners.stroke
- the stroke (null
permitted).getRangeGridlineStroke()
public Paint getRangeGridlinePaint()
null
).setRangeGridlinePaint(Paint)
public void setRangeGridlinePaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getRangeGridlinePaint()
public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info)
draw
in class Plot
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 void render(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info, CrosshairState crosshairState)
info
and crosshairState
arguments may be
null
.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 Range getDataRange(ValueAxis axis)
null
if the specified axis isn't the domain axis or the
range axis for the plot.getDataRange
in interface ValueAxisPlot
axis
- the axis (null
permitted).null
).public void zoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source)
zoomDomainAxes
in interface Zoomable
factor
- the zoom factor.info
- the plot rendering info.source
- the source point.Zoomable.zoomRangeAxes(double, PlotRenderingInfo, Point2D)
public void zoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor)
zoomDomainAxes
in interface Zoomable
factor
- the zoom factor.info
- the plot rendering info.source
- the source point (in Java2D space).useAnchor
- use source point as zoom anchor?zoomRangeAxes(double, PlotRenderingInfo, Point2D, boolean)
public void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source)
zoomDomainAxes
in interface Zoomable
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.Zoomable.zoomRangeAxes(double, double, PlotRenderingInfo, Point2D)
public void zoomRangeAxes(double factor, PlotRenderingInfo info, Point2D source)
zoomRangeAxes
in interface Zoomable
factor
- the zoom factor.info
- the plot rendering info.source
- the source point.Zoomable.zoomDomainAxes(double, PlotRenderingInfo, Point2D)
public void zoomRangeAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor)
zoomRangeAxes
in interface Zoomable
factor
- the zoom factor.info
- the plot rendering info.source
- the source point (in Java2D space).useAnchor
- use source point as zoom anchor?zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
public void zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source)
zoomRangeAxes
in interface Zoomable
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.Zoomable.zoomDomainAxes(double, double, PlotRenderingInfo, Point2D)
public boolean isDomainZoomable()
true
.isDomainZoomable
in interface Zoomable
Zoomable.isRangeZoomable()
public boolean isRangeZoomable()
true
.isRangeZoomable
in interface Zoomable
Zoomable.isDomainZoomable()
public boolean isDomainPannable()
true
if panning is enabled for the domain axes,
and false
otherwise.isDomainPannable
in interface Pannable
public void setDomainPannable(boolean pannable)
pannable
- the new flag value.public boolean isRangePannable()
true
if panning is enabled for the range axes,
and false
otherwise.isRangePannable
in interface Pannable
public void setRangePannable(boolean pannable)
pannable
- the new flag value.public void panDomainAxes(double percent, PlotRenderingInfo info, Point2D source)
panDomainAxes
in interface Pannable
percent
- the distance to pan (as a percentage of the axis length).info
- the plot infosource
- the source point where the pan action started.public void panRangeAxes(double percent, PlotRenderingInfo info, Point2D source)
panRangeAxes
in interface Pannable
percent
- the distance to pan (as a percentage of the axis length).info
- the plot infosource
- the source point where the pan action started.public boolean equals(Object obj)
FastScatterPlot
carries its data around with it (rather
than referencing a dataset), and the data is included in the
equality test.public Object clone() throws CloneNotSupportedException
clone
in interface org.jfree.util.PublicCloneable
clone
in class Plot
CloneNotSupportedException
- if some component of the plot does
not support cloning.Jas4pp 1.5 © Java Analysis Studio for Particle Physics