lt.monarch.chart.engine
Class AbstractGrid

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

public abstract class AbstractGrid
extends AbstractChartObject<GridPaintTags>

Grid interface, for accessing basic functions of the grid.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  PlaneMapper mapper
          Plane mapper.
protected  int xDepth
          grid x depth.
protected  AxisMapper xMapper
          X mapper.
protected  int yDepth
          grid y depth.
protected  AxisMapper yMapper
          Y mapper.
 
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
AbstractGrid(PlaneMapper mapper, AxisMapper xMapper, AxisMapper yMapper)
          Abstract grid constructor
 
Method Summary
Modifier and Type Method and Description
 void copy(AbstractGrid src)
          Copies grid settings from source grid (style, depths)
 void draw(AbstractGraphics g)
          Renders chart object on the Graphics context.
protected abstract  void drawGrid(AxisMapper axisMapper, int gridDepth, boolean isVerticalGrid, AbstractGraphics g, Projector projector, GeneralPoint ptt)
          Draws the grid for the specified mapper
 PaintMode getPaintMode()
          Returns the paint mode of the grid
 Projector getProjector()
          Returns modified projector.
 int getSortPosition()
          Returns chart object paint order index.
 int getXDepth()
          Gets the x grid depth
 AxisMapper getXMapper()
          Returns the X mapper that is set
 int getYDepth()
          Gets the y grid depth
 AxisMapper getYMapper()
          Returns the Y mapper that is set
 void setPaintMode(PaintMode paintMode)
          Sets grid painting mode.
 void setXGridDepth(int xDepth)
          Sets the grid depth.
 void setYGridDepth(int yDepth)
          Sets the grid depth.
 
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
 

Field Detail

xMapper

protected final AxisMapper xMapper
X mapper.


yMapper

protected final AxisMapper yMapper
Y mapper.


xDepth

protected int xDepth
grid x depth.

See Also:
setXGridDepth(int)

yDepth

protected int yDepth
grid y depth.

See Also:
setYGridDepth(int)

mapper

protected final PlaneMapper mapper
Plane mapper. It is used to determine the chart display area.

Constructor Detail

AbstractGrid

public AbstractGrid(PlaneMapper mapper,
                    AxisMapper xMapper,
                    AxisMapper yMapper)
Abstract grid constructor

Parameters:
mapper - plane mapper
xMapper - x axis mapper
yMapper - y mapper
Method Detail

draw

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

Parameters:
g - graphics context

drawGrid

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

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

getSortPosition

public int getSortPosition()
Description copied from interface: ChartObject
Returns chart object paint order index.

Specified by:
getSortPosition in interface ChartObject
Overrides:
getSortPosition in class AbstractChartObject<GridPaintTags>
Returns:
object paint order index

setXGridDepth

public void setXGridDepth(int xDepth)
Sets the grid depth. Depth defines how dense the grid should be, if several AxisScale objects are available.

Parameters:
xDepth - grid depth

setYGridDepth

public void setYGridDepth(int yDepth)
Sets the grid depth. Depth defines how dense the grid should be, if several AxisScale objects are available.

Parameters:
yDepth - grid depth

getProjector

public Projector getProjector()
Returns modified projector.

Returns:
projector

getYMapper

public AxisMapper getYMapper()
Returns the Y mapper that is set

Returns:
Returns the Y mapper.

getXMapper

public AxisMapper getXMapper()
Returns the X mapper that is set

Returns:
Returns the X mapper.

getYDepth

public int getYDepth()
Gets the y grid depth

Returns:
Returns the yDepth.

getXDepth

public int getXDepth()
Gets the x grid depth

Returns:
Returns the xDepth.

setPaintMode

public final void setPaintMode(PaintMode paintMode)
Sets grid painting mode. Possible values are: FILL_PAINT, HATCH_PAINT and GRADIENT_PAINT. FILL_PAINT for single color toFill-painting. GRADIENT_PAINT for cyclic (from start color to center color and from center color to start color) or acyclic (from start color to end color) gradient panel painting. By default the paint mode is set to FILL_PAINT.

Parameters:
paintMode - The paintMode to set.

getPaintMode

public final PaintMode getPaintMode()
Returns the paint mode of the grid

Returns:
Returns the paintMode.

copy

public void copy(AbstractGrid src)
Copies grid settings from source grid (style, depths)

Parameters:
src - source grid