lt.monarch.chart.chart2D
Class Grid

java.lang.Object
  extended by lt.monarch.chart.engine.AbstractChartObject<GridPaintTags>
      extended by lt.monarch.chart.engine.AbstractGrid
          extended by lt.monarch.chart.chart2D.Grid
All Implemented Interfaces:
java.io.Serializable, ChartObject, StyleEditorEntity

public class Grid
extends AbstractGrid

Draws a grid, based on the axis mapper(s). Grid color is set as a foreground color, fill color is set as background color using PaintStyle object. You can set rendering hints and composite using BrushStyle object. Drawing outline can be enabled if grid is not drawn, but the background is filled with some color.

If spacing between grid lines becomes less than 6 pixels the grid lines won't be drawn. This feature is to prevent grid lines drawing when they are too close.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
 
Fields inherited from class lt.monarch.chart.engine.AbstractGrid
mapper, xDepth, xMapper, yDepth, yMapper
 
Fields inherited from class lt.monarch.chart.engine.AbstractChartObject
AXIS_SORT_POSITION, BREAK_LINE_POSITION, DEFAULT_SORT_POSITION, GRID_SORT_POSITION, MARKER_SERIES_SORT_POSITION, MARKERS_SORT_POSITION, paintStyle, SERIES_SORT_POSITION, sortPosition, style
 
Constructor Summary
Constructor and Description
Grid(AxisMapper xMapper, AxisMapper yMapper)
          Constructs a new Grid with default plane mapper PlaneMapper2D, X and Y axis mappers.
Grid(PlaneMapper mapper, AxisMapper xMapper, AxisMapper yMapper)
          Constructs a new Grid with the specified PlaneMapper, X and Y axis mappers.
 
Method Summary
Modifier and Type Method and Description
 void draw(AbstractGraphics g)
          Renders chart object on the Graphics context.
protected  void drawGrid(AxisMapper axisMapper, int gridDepth, boolean isVerticalGrid, AbstractGraphics g, Projector projector, GeneralPoint ptt)
          Draws the grid for the specified mapper
 
Methods inherited from class lt.monarch.chart.engine.AbstractGrid
copy, getPaintMode, getProjector, getSortPosition, getXDepth, getXMapper, getYDepth, getYMapper, setPaintMode, setXGridDepth, setYGridDepth
 
Methods inherited from class lt.monarch.chart.engine.AbstractChartObject
activate, chart, copy, deactivate, dispose, finalize, getChart, getChartObjectBounds, getPaintStyle, getParent, getStyle, getStyle, invalidate, isVisible, layout, repaint, repaint, setChart, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grid

public Grid(PlaneMapper mapper,
            AxisMapper xMapper,
            AxisMapper yMapper)
Constructs a new Grid with the specified PlaneMapper, X and Y axis mappers.

Parameters:
mapper - the plane mapper. It is used to determine the chart display area.
xMapper - the X axis mapper
yMapper - the Y axis mapper

Grid

public Grid(AxisMapper xMapper,
            AxisMapper yMapper)
Constructs a new Grid with default plane mapper PlaneMapper2D, X and Y axis mappers.

Parameters:
xMapper - the X axis mapper
yMapper - the Y axis mapper
Method Detail

draw

public void draw(AbstractGraphics g)
Description copied from interface: ChartObject
Renders chart object on the Graphics context.

Specified by:
draw in interface ChartObject
Overrides:
draw in class AbstractGrid
Parameters:
g - graphics context

drawGrid

protected void drawGrid(AxisMapper axisMapper,
                        int gridDepth,
                        boolean isVerticalGrid,
                        AbstractGraphics g,
                        Projector projector,
                        GeneralPoint ptt)
Draws the grid for the specified mapper

Specified by:
drawGrid in class AbstractGrid
Parameters:
axisMapper - axis mapper
gridDepth - grid depth
isVerticalGrid - is the grid vertical
g - graphics context
projector - projector
ptt - Normalized point, to avoid point creation