|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.objectplanet.chart.Renderer com.objectplanet.chart.LegendRenderer
public class LegendRenderer
This class contains methods to render the chart legend.
Field Summary |
---|
Fields inherited from class com.objectplanet.chart.Renderer |
---|
chart, DEFAULT_CURSOR, DOUBLE_CLICK_TIME, GRID_CURSOR_HORZ, GRID_CURSOR_VERT, HAND_CURSOR, RESIZE_CURSOR, RESIZE_HOR_CURSOR |
Constructor Summary | |
---|---|
LegendRenderer(GenericChart chart)
Creates a legend renderer. |
Method Summary | |
---|---|
void |
calculateGraphBounds(Legend legend,
java.awt.Rectangle gridBounds)
This method adjusts the chart grid for the legend. |
int |
getSelectedElement(java.awt.Point point,
Legend legend)
This method is called when the user releases the mouse and checks if the given point is inside a sample. |
void |
handleLegendScrollers(java.awt.AWTEvent event)
Handles the range adjuster and sample scroller. |
protected void |
paintLegend(java.awt.Graphics g,
Legend legend,
java.awt.Rectangle bounds,
java.lang.String[] labels)
Paints the legend. |
protected void |
paintLegendElement(java.awt.Graphics g,
Legend legend,
int index,
int xpos,
int ypos,
int height,
java.lang.String label,
java.awt.FontMetrics fm)
Paints the particular legend element. |
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 |
Constructor Detail |
---|
public LegendRenderer(GenericChart chart)
chart
- A chart object the legend is set for.Method Detail |
---|
public void calculateGraphBounds(Legend legend, java.awt.Rectangle gridBounds)
gridBounds
- The Rectangle object where the bounds to be stored.public int getSelectedElement(java.awt.Point point, Legend legend)
point
- The point to check for.legend
- The legend to paint.
public void handleLegendScrollers(java.awt.AWTEvent event)
protected void paintLegend(java.awt.Graphics g, Legend legend, java.awt.Rectangle bounds, java.lang.String[] labels)
g
- The graphics context used to paint with.legend
- The legend to paint.bounds
- The chart grid bounds.labels
- The labels of the legend.protected void paintLegendElement(java.awt.Graphics g, Legend legend, int index, int xpos, int ypos, int height, java.lang.String label, java.awt.FontMetrics fm)
g
- The graphics context used to paint with.legend
- The legend to paint.index
- The index of element inside the legend.xpos
- The x position if the element.ypos
- The y position if the element.label
- The legend label.fm
- The font metrics used to paint label with.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |