|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.objectplanet.chart.Renderer
com.objectplanet.chart.ChartRenderer
com.objectplanet.chart.ext.PlotterChartRenderer
public class PlotterChartRenderer
This class contains methods to render the plotter chart.
| Field Summary | |
|---|---|
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. |
| Fields inherited from class com.objectplanet.chart.ChartRenderer |
|---|
BELOW, BELOW_AND_FLOATING, depth3dPoint, display3dOn, FLOATING, gridRenderer, HORIZONTAL, INSIDE, lastCalculationTime, legend, legendRenderer, OUTSIDE, overlayRenderers, parentRenderer, POINTING, VERTICAL |
| Fields inherited from class com.objectplanet.chart.Renderer |
|---|
DEFAULT_CURSOR, DOUBLE_CLICK_TIME, GRID_CURSOR_HORZ, GRID_CURSOR_VERT, HAND_CURSOR, RESIZE_CURSOR, RESIZE_HOR_CURSOR |
| Constructor Summary | |
|---|---|
PlotterChartRenderer(PlotterChart chart)
Creates a chart renderer for the given plotter chart. |
|
| Method Summary | |
|---|---|
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. |
protected 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. |
| Methods inherited from class com.objectplanet.chart.ChartRenderer |
|---|
addOverlayRenderer, calculateOverlayBounds, getLineChartBounds, getOverlayRenderer, isAnyBelowLabelsOn, paintSampleHighlight, removeExternalGraphics, render, setExternalGraphics, setOverlayRenderer |
| Methods inherited from class com.objectplanet.chart.Renderer |
|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BOTTOM
protected PlotterChart chart
public static final int LEFT
public static final int RIGHT
public static final int TOP
| Constructor Detail |
|---|
public PlotterChartRenderer(PlotterChart chart)
chart - The bar chart object.| Method Detail |
|---|
protected void calculateChartData(java.awt.Rectangle gridBounds,
java.awt.Rectangle dataBounds)
calculateChartData in class ChartRenderergridBounds - The chart grid bounds.dataBounds - The data bounds.protected void calculateGraphBounds(java.awt.Rectangle gridBounds)
calculateGraphBounds in class ChartRenderergridBounds - The Rectangle object where the bounds to be stored.protected void checkDataIntegrity()
checkDataIntegrity in class ChartRendererprotected ChartSample checkSelection(java.awt.Point point)
checkSelection in class ChartRendererpoint - 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, FLOATING
protected 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 ChartRenderersample - Index of the sample.series - Serie of the sample.
protected boolean isAnyFloatingLabelsOn(int serie)
isAnyFloatingLabelsOn in class ChartRendererserie - 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 ChartRendererg - 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 ChartRendererg - 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 ChartRendererg - 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 ChartRendererg - 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 ChartRendererg - 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
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||