com.objectplanet.chart
Class GridRenderer

java.lang.Object
  extended by com.objectplanet.chart.Renderer
      extended by com.objectplanet.chart.GridRenderer
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable

public class GridRenderer
extends Renderer
implements java.lang.Runnable

This class contains methods to render the chart grid.

Author:
Bjorn J. Kvande., Philipp Kolibaba.
See Also:
Serialized Form

Field Summary
static int BOTTOM
          Bottom grid adjustment.
static int HORIZONTAL
          Horizontal bar alignment.
protected  long lastClickTime
           
static int LEFT
          Left grid adjustment.
static int RIGHT
          Right grid adjustment.
static int TOP
          Top grid adjustment.
static int VERTICAL
          Vertical bar alignment.
 
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
GridRenderer()
          Creates a grid renderer.
GridRenderer(Chart chart)
          Creates a grid renderer fo the given chart.
 
Method Summary
protected  java.awt.Rectangle getDataBounds(Grid grid)
          This method returns the bounding box for the data to be drawn in.
protected  java.awt.Rectangle getGraphBounds()
          This method returns the bounding box around the chart itself.
protected  java.awt.Rectangle getTotalGraphBounds()
          Gets the bounds of the graph including all ranges and labels but without legend.
protected  void paintMouseBox(java.awt.Graphics g)
          Paints the mouse box used to zoom the chart.
protected  void paintZoomOutButton(java.awt.Graphics g, Grid grid, java.awt.Rectangle bounds)
          Paints the button used to zoom out the chart
 void run()
          Internal do not call.
 
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

BOTTOM

public static final int BOTTOM
Bottom grid adjustment.

See Also:
Constant Field Values

HORIZONTAL

public static final int HORIZONTAL
Horizontal bar alignment.

See Also:
Constant Field Values

lastClickTime

protected long lastClickTime

LEFT

public static final int LEFT
Left grid adjustment.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Right grid adjustment.

See Also:
Constant Field Values

TOP

public static final int TOP
Top grid adjustment.

See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
Vertical bar alignment.

See Also:
Constant Field Values
Constructor Detail

GridRenderer

public GridRenderer()
Creates a grid renderer.


GridRenderer

public GridRenderer(Chart chart)
Creates a grid renderer fo the given chart.

Parameters:
chart - The chart object.
Method Detail

getDataBounds

protected java.awt.Rectangle getDataBounds(Grid grid)
This method returns the bounding box for the data to be drawn in.

Parameters:
grid - The grid to paint.
Returns:
A rectangle with the bounds.
Throws:
java.lang.IllegalArgumentException - if the grid is null.

getGraphBounds

protected java.awt.Rectangle getGraphBounds()
This method returns the bounding box around the chart itself.

Returns:
The bounding rectangle for the chart itself.
Throws:
java.lang.IllegalArgumentException - If labels is null.

getTotalGraphBounds

protected java.awt.Rectangle getTotalGraphBounds()
Gets the bounds of the graph including all ranges and labels but without legend.

Returns:
Bounds of the graph with ranges.

paintMouseBox

protected void paintMouseBox(java.awt.Graphics g)
Paints the mouse box used to zoom the chart.

Parameters:
g - The graphics context used to paint with.

paintZoomOutButton

protected void paintZoomOutButton(java.awt.Graphics g,
                                  Grid grid,
                                  java.awt.Rectangle bounds)
Paints the button used to zoom out the chart

Parameters:
g - The graphics context used to paint with.
grid - The chart grid to paint.
bounds - The chart grid bounds.

run

public void run()
Internal do not call.

Specified by:
run in interface java.lang.Runnable