public class Renderer2D extends SeriesRenderer
Modifier and Type | Class and Description |
---|---|
protected static interface |
Renderer2D.ProcessPoint
Defines the signature of lambdas called to process a data point one element at a time.
|
protected static interface |
Renderer2D.ProcessRange
Defines the signature of lambdas called to process all points from current data range at once.
|
Constructor and Description |
---|
Renderer2D(com.mindfusion.common.ObservableList<Series> series)
Initializes a new instance of the
Renderer2D class. |
Modifier and Type | Method and Description |
---|---|
protected Axis |
domainAxis(RenderContext context) |
protected double |
domainData(int seriesIndex,
int dataIndex)
Gets the domain axis coordinate (input value) of specified data item.
|
protected boolean |
domainSorted(int seriesIndex) |
protected void |
drawHighlight(RenderContext context,
HitResult hitResult)
SeriesRenderer.drawHighlight override.
|
java.util.stream.Stream<Series> |
enumSeries()
Implements the SeriesContainer interface.
|
protected void |
enumVisiblePointPairs(RenderContext context,
com.mindfusion.charting.Renderer2D.ProcessPoints process)
Enumerates the data values of rendered series mapped to plot 2D coordinates.
|
protected void |
enumVisiblePoints(RenderContext context,
boolean frontToBack,
Renderer2D.ProcessPoint process)
Enumerates the data values of rendered series mapped to plot 2D coordinates.
|
protected void |
enumVisibleRanges(RenderContext context,
Renderer2D.ProcessRange process)
Enumerates each series once providing a list of all visible points at each iteration.
|
protected int |
getFirstInRange(int s,
Axis axis)
Gets the index of first data item in specified range.
|
protected int |
getFirstInRange(int s,
RenderContext context)
Gets the index of first data item in currently visible plot range.
|
protected int |
getLastInRange(int s,
Axis axis)
Gets the index of last data item in specified range.
|
protected int |
getLastInRange(int s,
RenderContext context)
Gets the index of last data item in currently visible plot range.
|
protected double |
getMaxXSum()
Gets the maximum sum of X data values locates at same index in all series.
|
protected double |
getMaxXSumPositive(double origin) |
protected double |
getMaxYSum()
Gets the maximum sum of Y data values locates at same index in all series.
|
protected double |
getMaxYSumPositive(double origin) |
protected double |
getMinXSumNegative(double origin) |
protected double |
getMinYSumNegative(double origin) |
protected java.awt.geom.Point2D |
getPixel(double valueX,
Axis xAxis,
double valueY,
Axis yAxis,
com.mindfusion.charting.components.Component component)
Gets the coordinates of specified data item when mapped to a Plot2D pixel.
|
protected java.awt.geom.Point2D |
getPixel(int seriesIndex,
int dataIndex,
Axis xAxis,
Axis yAxis,
com.mindfusion.charting.components.Component component)
Gets the coordinates of specified data item when mapped to a Plot2D pixel.
|
com.mindfusion.common.ObservableList<Series> |
getSeries()
Gets a list of Series drawn by this Renderer2D.
|
Axis |
getXAxis()
Gets the X axis associated with this Renderer2D.
|
Axis |
getYAxis()
Gets the Y axis associated with this Renderer2D.
|
HitResult |
hitTest(RenderContext context,
java.awt.geom.Point2D location)
SeriesRenderer.hitTest override.
|
protected double |
imageData(int seriesIndex,
int dataIndex)
Gets the image axis coordinate (output value) of specified data item.
|
protected void |
measureDataRange(RenderContext context)
SeriesRenderer.measureDataRange override.
|
void |
setSeries(com.mindfusion.common.ObservableList<Series> value)
Sets a list of Series drawn by this Renderer2D.
|
void |
setXAxis(Axis value)
Sets the X axis associated with this Renderer2D.
|
void |
setYAxis(Axis value)
Sets the Y axis associated with this Renderer2D.
|
void |
startMeasureData(RenderContext context)
SeriesRenderer.startMeasureData override.
|
protected double |
xData(int seriesIndex,
int dataIndex)
Gets the X value of specified data item.
|
protected boolean |
xSorted(int seriesIndex)
Gets a value indicating whether values of specified series increase monotonously in X dimension.
|
protected double |
yData(int seriesIndex,
int dataIndex)
Gets the Y value of specified data item.
|
protected boolean |
ySorted(int seriesIndex)
Gets a value indicating whether values of specified series increase monotonously in Y dimension.
|
addPropertyChangeListener, createTextRenderer, dataChanged, domainDimension, effectiveFill, effectiveLabelBackground, effectiveLabelBorderPen, effectiveStroke, getLabelBrush, getLabelFontName, getLabelFontSize, getLabelFontStyle, getSeriesStyle, getShowDataLabels, getShowHighlight, getShowToolTips, onPropertyChanged, onSeriesDataChanged, removePropertyChangeListener, searchStyle, setLabelBrush, setLabelFontName, setLabelFontSize, setLabelFontStyle, setSeriesStyle, setShowDataLabels, setShowHighlight, setShowToolTips, setToolTip
public Renderer2D(com.mindfusion.common.ObservableList<Series> series)
Renderer2D
class.series
- A list of Series
that should be rendered by this object.public com.mindfusion.common.ObservableList<Series> getSeries()
public void setSeries(com.mindfusion.common.ObservableList<Series> value)
protected Axis domainAxis(RenderContext context)
protected boolean domainSorted(int seriesIndex)
protected double getMaxXSumPositive(double origin)
protected double getMinXSumNegative(double origin)
protected double getMaxYSumPositive(double origin)
protected double getMinYSumNegative(double origin)
protected double domainData(int seriesIndex, int dataIndex)
seriesIndex
- An integer index of a Series within the list of series rendered by this Renderer2D.dataIndex
- An integer index of the data item in specified series.protected double imageData(int seriesIndex, int dataIndex)
seriesIndex
- An integer index of a Series within the list of series rendered by this Renderer2D.dataIndex
- An integer index of the data item in specified series.protected void enumVisiblePoints(RenderContext context, boolean frontToBack, Renderer2D.ProcessPoint process)
context
- A RenderContext instance.frontToBack
- true if the series list should be enumerated from front to back, or false otherwise.process
- A ProcessPoint callback.protected void enumVisiblePointPairs(RenderContext context, com.mindfusion.charting.Renderer2D.ProcessPoints process)
context
- A RenderContext instance.process
- A ProcessPoints callback.protected void enumVisibleRanges(RenderContext context, Renderer2D.ProcessRange process)
context
- A RenderContext instance.process
- A ProcessRange callback.public void startMeasureData(RenderContext context)
startMeasureData
in class SeriesRenderer
context
- A RenderContext instance.public java.util.stream.Stream<Series> enumSeries()
enumSeries
in interface SeriesContainer
enumSeries
in class SeriesRenderer
public Axis getXAxis()
public void setXAxis(Axis value)
public Axis getYAxis()
public void setYAxis(Axis value)
protected void measureDataRange(RenderContext context)
context
- A RenderContext instance.protected double xData(int seriesIndex, int dataIndex)
seriesIndex
- An integer index of a Series within the list of series rendered by this Renderer2D.dataIndex
- An integer index of the data item in specified series.protected double yData(int seriesIndex, int dataIndex)
seriesIndex
- An integer index of a Series within the list of series rendered by this Renderer2D.dataIndex
- An integer index of the data item in specified series.protected boolean xSorted(int seriesIndex)
seriesIndex
- An integer index of a Series within the list of series rendered by this Renderer2D.protected boolean ySorted(int seriesIndex)
seriesIndex
- An integer index of a Series within the list of series rendered by this Renderer2D.protected java.awt.geom.Point2D getPixel(int seriesIndex, int dataIndex, Axis xAxis, Axis yAxis, com.mindfusion.charting.components.Component component)
seriesIndex
- An integer index of a Series within the list of series rendered by this Renderer2D.dataIndex
- An integer index of the data item in specified series.xAxis
- An Axis reference specifying the X axis.yAxis
- An Axis reference specifying the Y axis.component
- An instance of Plot2D or derived class.protected java.awt.geom.Point2D getPixel(double valueX, Axis xAxis, double valueY, Axis yAxis, com.mindfusion.charting.components.Component component)
valueX
- The X value of data item in logical coordinate system.xAxis
- The X Axis from which logical value is mapped to plot's actual width.valueY
- The Y value of data item in logical coordinate system.yAxis
- The Y Axis from which logical value is mapped to plot's actual height.component
- An instance of Plot2D or derived class.protected double getMaxXSum()
protected double getMaxYSum()
protected int getFirstInRange(int s, RenderContext context)
s
- An integer value specifying index in Series list.context
- A RenderContext instance.protected int getLastInRange(int s, RenderContext context)
s
- An integer value specifying index in Series list.context
- A RenderContext instance.protected int getFirstInRange(int s, Axis axis)
s
- An integer value specifying index in Series list.axis
- An Axis instance identifying the data range.protected int getLastInRange(int s, Axis axis)
s
- An integer value specifying index in Series list.axis
- An Axis instance identifying the data range.public HitResult hitTest(RenderContext context, java.awt.geom.Point2D location)
hitTest
in class SeriesRenderer
context
- A RenderContext instance.location
- A PointD specifying where to look for data items.protected void drawHighlight(RenderContext context, HitResult hitResult)
context
- A RenderContext instance.hitResult
- A HitResult instance identifying highlighted data item.