public class PlotterChartRenderer extends ChartRenderer
Modifier and Type | Field and Description |
---|---|
static int |
BOTTOM
Bottom range on.
|
protected PlotterChart |
chart
The plotter chart object
|
static int |
LEFT
Left range on.
|
static int |
RIGHT
Right range on.
|
static int |
TOP
Top range on.
|
BELOW, BELOW_AND_FLOATING, depth3dPoint, display3dOn, FLOATING, gridRenderer, HORIZONTAL, INSIDE, lastCalculationTime, legend, legendRenderer, OUTSIDE, overlayRenderers, parentRenderer, POINTING, VERTICAL
DEFAULT_CURSOR, DOUBLE_CLICK_TIME, GRID_CURSOR_HORZ, GRID_CURSOR_VERT, HAND_CURSOR, RESIZE_CURSOR, RESIZE_HOR_CURSOR
Constructor and Description |
---|
PlotterChartRenderer(PlotterChart chart)
Creates a chart renderer for the given plotter chart.
|
Modifier and Type | Method and Description |
---|---|
protected void |
calculateChartData(java.awt.Rectangle gridBounds,
java.awt.Rectangle dataBounds)
Calculates the position and size of each sample in the chart.
|
protected void |
calculateGraphBounds(java.awt.Rectangle gridBounds)
Calculates the bounding rectangle of the graph itself,
based on which features are on and how they are configured.
|
protected void |
checkDataIntegrity()
Makes sure the plotter chart specific data has the same number
of series and samples as the chart data has.
|
protected ChartSample |
checkSelection(java.awt.Point point)
This method is called when the user releases the mouse and checks
if the given point is inside a sample.
|
protected java.lang.String |
constructLabel(int series,
int sample,
int style)
Constructs the combination of labels.
|
protected java.awt.Rectangle |
getDataBounds(Grid grid)
This method returns the bounding box for the data to be drawn in.
|
protected java.awt.Point |
getSampleCenter(int sample,
int series)
Calculates the center point of the sample.
|
boolean |
isAnyFloatingLabelsOn(int serie)
Returns true if any floating labels should be painted
for the specified serie.
|
protected void |
paintFloatingLabel(java.awt.Graphics g,
java.lang.String label,
java.awt.Rectangle gridBounds,
int sample,
int series,
java.awt.Font font,
java.awt.FontMetrics fm)
Paints a floating label.
|
protected boolean |
paintFloatingLabels(java.awt.Graphics g,
java.awt.Rectangle bounds)
Paints floating labels.
|
protected void |
paintGrid(java.awt.Graphics g,
Grid grid,
java.awt.Rectangle gridBounds)
Paints the chart gridBounds.
|
protected void |
paintLine(java.awt.Graphics g,
int series,
java.awt.Color color,
java.awt.Rectangle grid)
Paints lines between the plots for the specified series.
|
protected void |
paintPlotPoint(java.awt.Graphics g,
int series,
int index,
int x,
int y,
java.awt.Color color)
Paints a specific plot point.
|
void |
paintSeries(java.awt.Graphics g,
java.awt.Rectangle gridBounds)
Paints the plots.
|
void |
render(java.awt.Graphics g)
Renders the bar chart according to the current chart attributes
and which charts features are turned on or off.
|
protected void |
renderData(java.awt.Graphics g,
java.awt.Rectangle gridBounds,
java.awt.Rectangle dataBounds)
Renders the bars and the value labels.
|
protected void |
renderOffScreen(java.awt.Graphics g)
A subclass should override this method to paint on top of the chart
before it is painted to the AWT component.
|
void |
reset()
Resets the chart state attributes.
|
addOverlayRenderer, calculateOverlayBounds, getLineChartBounds, getOverlayRenderer, isAnyBelowLabelsOn, paintSampleHighlight, removeExternalGraphics, render, setExternalGraphics, setOverlayRenderer
clearBackground, fifo_add, fifo_clear, fifo_remove, getAngledLabelCache, getAngledLabelSize, getBrighter, getDarker, getfifo_count, getfifo_queue, getFont, getFontMetrics, getImageSize, getLabel, getLabelAngle, getLabelSize, getSampleCount, getSeriesCount, hashCode, paintBox, paintLabel, setLabelAngleCacheSize
public static final int BOTTOM
protected PlotterChart chart
public static final int LEFT
public static final int RIGHT
public static final int TOP
public PlotterChartRenderer(PlotterChart chart)
chart
- The bar chart object.protected void calculateChartData(java.awt.Rectangle gridBounds, java.awt.Rectangle dataBounds)
calculateChartData
in class ChartRenderer
gridBounds
- The chart grid bounds.dataBounds
- The data bounds.protected void calculateGraphBounds(java.awt.Rectangle gridBounds)
calculateGraphBounds
in class ChartRenderer
gridBounds
- The Rectangle object where the bounds to be stored.protected void checkDataIntegrity()
checkDataIntegrity
in class ChartRenderer
protected ChartSample checkSelection(java.awt.Point point)
checkSelection
in class ChartRenderer
point
- The point to check for.protected java.lang.String constructLabel(int series, int sample, int style)
series
- The series index.sample
- The sample index.style
- The style of the label: CENTER, OVER, UNDER, FLOATINGprotected java.awt.Rectangle getDataBounds(Grid grid)
grid
- The grid to paint.java.lang.IllegalArgumentException
- if the grid is null.protected java.awt.Point getSampleCenter(int sample, int series)
getSampleCenter
in class ChartRenderer
sample
- Index of the sample.series
- Serie of the sample.public boolean isAnyFloatingLabelsOn(int serie)
isAnyFloatingLabelsOn
in class ChartRenderer
serie
- The serie to check floating labels for.
Should be set to -1 when checking for all series.protected void paintFloatingLabel(java.awt.Graphics g, java.lang.String label, java.awt.Rectangle gridBounds, int sample, int series, java.awt.Font font, java.awt.FontMetrics fm)
paintFloatingLabel
in class ChartRenderer
g
- The graphics context to paint with.label
- The label to paint.gridBounds
- The chart grid bounds.sample
- The index of the sample.series
- The index of the series.font
- The font to use for painting.fm
- The font metrics, used to calculate label position.protected boolean paintFloatingLabels(java.awt.Graphics g, java.awt.Rectangle bounds)
paintFloatingLabels
in class ChartRenderer
g
- The graphics context used to paint with.bounds
- The chart data bounds.protected void paintGrid(java.awt.Graphics g, Grid grid, java.awt.Rectangle gridBounds)
paintGrid
in class ChartRenderer
g
- The graphics context used to paint with.gridBounds
- The chart gridBounds bounds.grid
- The Grid object to be painted.protected void paintLine(java.awt.Graphics g, int series, java.awt.Color color, java.awt.Rectangle grid)
g
- The graphics context used to paint with.series
- The index of the series.color
- The color of the plot.protected void paintPlotPoint(java.awt.Graphics g, int series, int index, int x, int y, java.awt.Color color)
g
- The graphics context used to paint with.series
- The index of the series.index
- The index of the plot inside the series.x
- The x-position of the point.y
- The y-position of the point.color
- The color of the plot.public void paintSeries(java.awt.Graphics g, java.awt.Rectangle gridBounds)
g
- The graphics context used to paint with.gridBounds
- The chart gridBounds bounds.public void render(java.awt.Graphics g)
render
in class ChartRenderer
g
- The graphics context used to paint with.GenericChart.paint(java.awt.Graphics)
protected void renderData(java.awt.Graphics g, java.awt.Rectangle gridBounds, java.awt.Rectangle dataBounds)
renderData
in class ChartRenderer
g
- The graphics context used to paint with.gridBounds
- The grid bounds to paint within.dataBounds
- The scrolled data bounds to calculate the bars from.protected void renderOffScreen(java.awt.Graphics g)
g
- The graphics context used to paint with.public void reset()
reset
in class ChartRenderer