lt.monarch.chart.chart2D.series
Class SurfaceSeries

java.lang.Object
  extended by lt.monarch.chart.engine.AbstractChartObject<Tags>
      extended by lt.monarch.chart.AbstractChartSeries<SurfacePaintTags,Projector2D>
          extended by lt.monarch.chart.chart2D.series.SurfaceSeries
All Implemented Interfaces:
java.io.Serializable, ChartEntity, ChartObject, ChartSeries, StyleEditorEntity

public class SurfaceSeries
extends AbstractChartSeries<SurfacePaintTags,Projector2D>

Displays data a 2D image, where each pixel color depends on a corresponding cell in a 2D matrix of double values. The null values in the data model won't be interpolated, but regarded as empty points. However, if some data values are missing and you wish to interpolate them, set Double.NaN to data model and enable interpolation.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
 LegendEntry[] entries
           
protected  PlaneMapper mapper
          mapper, used to map output to a plane in a n-dimensional space
protected  MatrixDataModel model
          Chart data model
protected  java.awt.Color[] palette
          Color fill palette
 
Fields inherited from class lt.monarch.chart.AbstractChartSeries
metaModel, modelValidator, seriesName, seriesTransform, showLegend, showNullValues, symbol, xMapper, yMapper, zMapper
 
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
SurfaceSeries(MatrixDataModel model, PlaneMapper mapper)
          Constructs a new DensityMap object
SurfaceSeries(MatrixDataModel model, PlaneMapper mapper, AxisMapper zMapper)
          Constructs a new DensityMap object.
SurfaceSeries(MatrixDataModel model, PlaneMapper mapper, AxisMapper zMapper, boolean fixedColorPalette)
          Constructs a new DensityMap object.
SurfaceSeries(MatrixDataModel model, PlaneMapper mapper, boolean fixedColorPalette)
          Constructs a new DensityMap object
 
Method Summary
Modifier and Type Method and Description
 LegendEntry[] createLegendEntries()
          Creates an array of legend entries with symbols corresponding the palette.
 LegendEntry[] createLegendEntries(int legendEntriesCount)
          Creates an array of legend entries with symbols corresponding the palette.
 LegendEntry[] createLegendEntries(int legendEntriesCount, java.lang.String pattern)
          Creates an array of legend entries with symbols corresponding the palette.
 LegendEntry[] createLegendEntries(java.lang.String pattern)
          Creates an array of legend entries with symbols corresponding the palette.
 void draw(AbstractGraphics g)
          Paints the density map in the specified Graphics context.
 java.awt.Color[] getColorPalette()
          Return series fill palette
 java.lang.Object getMaxValue(DataColumnType valType)
          Note: internal use only! Gets maximum value that is used by series to fit into the chart
 java.lang.Object getMinValue(DataColumnType valType)
          Note: internal use only! Gets minimum value that is used by series to fit into the chart
 java.awt.Color[] getPaletteCopy()
           
 SurfacePaintMode getSurfacePaintMode()
          Returns surface drawing mode.
protected  void handleDataModelChangeEvent(DataModelChangeEvent ev)
          Handles data model change event.
 boolean isFixedColorPalette()
          Gets if the color palette is according to the axis (true) or to the data (false-meaning not fixed)
 boolean isInterpolationEnabled()
          Is interpolation enabled
 void setAxis(Axis xAxis, Axis yAxis)
          Sets axis for the DensityMap.
 void setAxis(AxisMapper xMapper, AxisMapper yMapper)
          Sets axis mappers for the SurfaceSeries.
 void setColorPalette(java.awt.Color[] palette)
          Sets a image palette.
 void setColorPalette(ColorPalette palette, int levelCount)
          Sets a image palette.
 void setInterpolationEnabled(boolean enable)
          Sets matrix interpolation for null values
 void setSurfacePaintMode(SurfacePaintMode mode)
          Sets surface drawing mode (DRAW_DEFAULT or DRAW_POLYGON_MAP).
protected  void updateLegendStyle()
          Update legend style
 
Methods inherited from class lt.monarch.chart.AbstractChartSeries
activate, checkDataModelRequirements, createLegendEntry, createLegendSymbol, deactivate, fillEntitySheet, getChartObjectBounds, getDataModel, getDescription, getMetaDataModel, getModelValidator, getName, getNearestChildEntity, getParentEntity, getProjector, getSeriesColor, getShortDescription, getShowNullValues, getSortPosition, getXMapper, getYMapper, getZMapper, setLegendSymbol, setName, setShowNullValues, setValidateData, showLegend, updateClippingToProjector
 
Methods inherited from class lt.monarch.chart.engine.AbstractChartObject
chart, copy, dispose, finalize, getChart, 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
 
Methods inherited from interface lt.monarch.chart.engine.ChartObject
dispose, getChart, getStyle, getStyle, invalidate, isVisible, layout, repaint, repaint, setChart
 
Methods inherited from interface lt.monarch.chart.engine.StyleEditorEntity
getParent, getStyle
 

Field Detail

mapper

protected final PlaneMapper mapper
mapper, used to map output to a plane in a n-dimensional space


model

protected MatrixDataModel model
Chart data model


palette

protected java.awt.Color[] palette
Color fill palette


entries

public LegendEntry[] entries
Constructor Detail

SurfaceSeries

public SurfaceSeries(MatrixDataModel model,
                     PlaneMapper mapper,
                     AxisMapper zMapper,
                     boolean fixedColorPalette)
Constructs a new DensityMap object.

Parameters:
model - data model
mapper - mapper, used to map output to a plane in a n-dimensional space
zMapper - axis mapper for z values
fixedColorPalette - is the color palette fixed to z axis (true), or to the data (false) If you set it to true, the z axis will be considered as from 0 to 1.

SurfaceSeries

public SurfaceSeries(MatrixDataModel model,
                     PlaneMapper mapper,
                     boolean fixedColorPalette)
Constructs a new DensityMap object

Parameters:
model - matrix data model
mapper - mapper, used to map output to a plane in a n-dimensional space
fixedColorPalette - is the color palette fixed to z axis (true), or to the data (false). If you set it to true, the z axis will be considered as from 0 to 1.

SurfaceSeries

public SurfaceSeries(MatrixDataModel model,
                     PlaneMapper mapper,
                     AxisMapper zMapper)
Constructs a new DensityMap object.

Parameters:
model - data model
mapper - mapper, used to map output to a plane in a n-dimensional space
zMapper - axis mapper for z values

SurfaceSeries

public SurfaceSeries(MatrixDataModel model,
                     PlaneMapper mapper)
Constructs a new DensityMap object

Parameters:
model - matrix data model
mapper - mapper, used to map output to a plane in a n-dimensional space
Method Detail

getPaletteCopy

public java.awt.Color[] getPaletteCopy()

getColorPalette

public java.awt.Color[] getColorPalette()
Return series fill palette

Returns:
series fill palette

setColorPalette

public void setColorPalette(java.awt.Color[] palette)
Sets a image palette.

Parameters:
palette - fill palette

setColorPalette

public void setColorPalette(ColorPalette palette,
                            int levelCount)
Sets a image palette.

Parameters:
palette - fill palette
levelCount - level count in the palette

updateLegendStyle

protected void updateLegendStyle()
Update legend style


createLegendEntries

public LegendEntry[] createLegendEntries()
Creates an array of legend entries with symbols corresponding the palette.

Specified by:
createLegendEntries in interface ChartSeries
Overrides:
createLegendEntries in class AbstractChartSeries<SurfacePaintTags,Projector2D>
Returns:
array of legend entries

createLegendEntries

public LegendEntry[] createLegendEntries(int legendEntriesCount)
Creates an array of legend entries with symbols corresponding the palette.

Parameters:
legendEntriesCount - number of legend entries
Returns:
array of legend entries

createLegendEntries

public LegendEntry[] createLegendEntries(int legendEntriesCount,
                                         java.lang.String pattern)
Creates an array of legend entries with symbols corresponding the palette.

Parameters:
legendEntriesCount - number of legend entries
pattern - The number format pattern
Returns:
array of legend entries

createLegendEntries

public LegendEntry[] createLegendEntries(java.lang.String pattern)
Creates an array of legend entries with symbols corresponding the palette.

Parameters:
pattern - The number format pattern
Returns:
array of legend entries

setAxis

public void setAxis(AxisMapper xMapper,
                    AxisMapper yMapper)
Sets axis mappers for the SurfaceSeries.

Parameters:
xMapper - x axis mapper
yMapper - y axis mapper

setAxis

public void setAxis(Axis xAxis,
                    Axis yAxis)
Sets axis for the DensityMap.

Parameters:
xAxis - x
yAxis - y

handleDataModelChangeEvent

protected void handleDataModelChangeEvent(DataModelChangeEvent ev)
Description copied from class: AbstractChartSeries
Handles data model change event. Called when DataModelChangeEvent is received. Calls repaint() method.

Overrides:
handleDataModelChangeEvent in class AbstractChartSeries<SurfacePaintTags,Projector2D>
Parameters:
ev - the chart data model change event
See Also:
DataModelChangeEvent

draw

public void draw(AbstractGraphics g)
Paints the density map in the specified Graphics context.

Specified by:
draw in interface ChartObject
Overrides:
draw in class AbstractChartSeries<SurfacePaintTags,Projector2D>
Parameters:
g - the Graphics context in which to paint density map

setSurfacePaintMode

public void setSurfacePaintMode(SurfacePaintMode mode)
Sets surface drawing mode (DRAW_DEFAULT or DRAW_POLYGON_MAP).

Parameters:
mode - Surface drawing mode.

getSurfacePaintMode

public SurfacePaintMode getSurfacePaintMode()
Returns surface drawing mode.

Returns:
Surface drawing mode (DRAW_IMAGE_MAP or DRAW_POLYGON_MAP).

isFixedColorPalette

public boolean isFixedColorPalette()
Gets if the color palette is according to the axis (true) or to the data (false-meaning not fixed)

Returns:
the fixedColorPalette value

setInterpolationEnabled

public void setInterpolationEnabled(boolean enable)
Sets matrix interpolation for null values

Parameters:
enable - enable interpolation

isInterpolationEnabled

public boolean isInterpolationEnabled()
Is interpolation enabled

Returns:
gets value if the interpolation is enabled

getMinValue

public java.lang.Object getMinValue(DataColumnType valType)
Description copied from class: AbstractChartSeries
Note: internal use only! Gets minimum value that is used by series to fit into the chart

Specified by:
getMinValue in class AbstractChartSeries<SurfacePaintTags,Projector2D>
Parameters:
valType - data value column
Returns:
minimum value needed

getMaxValue

public java.lang.Object getMaxValue(DataColumnType valType)
Description copied from class: AbstractChartSeries
Note: internal use only! Gets maximum value that is used by series to fit into the chart

Specified by:
getMaxValue in class AbstractChartSeries<SurfacePaintTags,Projector2D>
Parameters:
valType - data value column
Returns:
maximum value needed