lt.monarch.chart.chart2D.series
Class MarkerDecorableSeries<Tags extends AbstractPaintTags,ChartProjector extends Projector>

java.lang.Object
  extended by lt.monarch.chart.engine.AbstractChartObject<Tags>
      extended by lt.monarch.chart.AbstractChartSeries<Tags,ChartProjector>
          extended by lt.monarch.chart.chart2D.series.MarkerDecorableSeries<Tags,ChartProjector>
All Implemented Interfaces:
java.io.Serializable, AbstractMarkerSeries, ChartEntity, ChartObject, ChartSeries, StyleEditorEntity
Direct Known Subclasses:
AbstractLineSeries, BarSeries, BubbleSeries, RadarSeries, StockSeries, VectorSeries

public abstract class MarkerDecorableSeries<Tags extends AbstractPaintTags,ChartProjector extends Projector>
extends AbstractChartSeries<Tags,ChartProjector>
implements AbstractMarkerSeries

See Also:
Serialized Form

Nested Class Summary
Modifier and Type Class and Description
 class MarkerDecorableSeries.MarkerEntity
           
 
Field Summary
Modifier and Type Field and Description
protected  java.lang.Object baseValue
          Base value
protected  ColorMapper colorMapper
          Color mapper, which maps bars and marker values to color
protected  MarkerPainter markerPainter
          Marker painter
protected  java.util.Map<AlignmentEntry,MarkerEntry> markers
          Marker list
protected  java.util.Map<DataColumnType,MinMaxValues> minMaxValues
          Minimum and Maximum values
protected  PseudoArrayDataModel pseudoModel
          Pseudo model, for null value calculation
 
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
MarkerDecorableSeries()
          Default marker decorable series
MarkerDecorableSeries(DataModel model, MetaDataModel metaModel, AxisMapper xMapper, AxisMapper yMapper)
          Marker decorable series
 
Method Summary
Modifier and Type Method and Description
 void addMarker(Marker marker)
          Adds Marker to the series.
 void addMarker(Marker marker, Alignment alignment)
          Adds marker to the series.
 void addMarker(Marker marker, Alignment verticalAlignment, Alignment horizontalAlignment)
          Adds marker to the BAR SERIES.
protected  java.lang.Object calculateNullValue(MarkerDecorableSeries<Tags,ChartProjector> series, int index)
          Calculates x or y values instead of null values in data model.
 void copy(MarkerDecorableSeries<?,?> src)
          Copies series object settings from source series object (style, markers)
protected  boolean dataConstraintExtraction()
           
 void draw(AbstractGraphics g)
          Renders chart object on the Graphics context.
 void drawMarkers(AbstractGraphics g)
          Draws markers according to default layouting
 void drawMarkers(AbstractGraphics g, Marker normalMarker, MarkerConstraints[] constraints)
          Sets values to marker from marker constraints and draws markers with MarkerPainter
protected  MarkerConstraints generateConstaint(Marker marker, GeneralPoint point, int index)
           
 java.lang.Object getBaseValue()
          Gets the base value of the series
 ColorMapper getColorMapper()
          Gets color mapper
 DataColumnType getKeyType()
          Gets the key value type, which is determined automatically
 java.util.ArrayList<java.util.ArrayList<MarkerConstraints>> getMarkerConstraints()
           
 java.util.List<MarkerEntry> getMarkers()
          Gets marker list
protected  Style getMarkerStyle(Marker marker, java.lang.Object value, int index)
           
 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
 PaintMode getPaintMode()
          Returns the paint mode of the grid
protected  GeneralPoint getPointForConstraint(ArrayDataModel model, int index)
           
 int getSortPosition()
          Returns chart object paint order index.
 void layout(AbstractGraphics g)
          Dummy ChartObject interface's layout method implementation.
protected  java.lang.Object mapMinMaxValue(DataColumnType valType, java.lang.Object obj)
          Gets mapped minimum or max value
 void removeMarker(Marker marker)
           
 void setBaseValue(java.lang.Object baseValue)
          Sets the base value of the series
 void setColorMapper(ColorMapper colorMapper)
          Sets color mapper
 void setPaintMode(PaintMode paintMode)
          Sets grid painting mode.
 
Methods inherited from class lt.monarch.chart.AbstractChartSeries
activate, checkDataModelRequirements, createLegendEntries, createLegendEntry, createLegendSymbol, deactivate, fillEntitySheet, getChartObjectBounds, getDataModel, getDescription, getMetaDataModel, getModelValidator, getName, getNearestChildEntity, getParentEntity, getProjector, getSeriesColor, getShortDescription, getShowNullValues, getXMapper, getYMapper, getZMapper, handleDataModelChangeEvent, 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, 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, repaint, repaint, setChart
 
Methods inherited from interface lt.monarch.chart.engine.StyleEditorEntity
getParent, getStyle
 

Field Detail

markerPainter

protected MarkerPainter markerPainter
Marker painter


baseValue

protected java.lang.Object baseValue
Base value


pseudoModel

protected PseudoArrayDataModel pseudoModel
Pseudo model, for null value calculation


colorMapper

protected ColorMapper colorMapper
Color mapper, which maps bars and marker values to color


markers

protected java.util.Map<AlignmentEntry,MarkerEntry> markers
Marker list


minMaxValues

protected java.util.Map<DataColumnType,MinMaxValues> minMaxValues
Minimum and Maximum values

Constructor Detail

MarkerDecorableSeries

public MarkerDecorableSeries()
Default marker decorable series


MarkerDecorableSeries

public MarkerDecorableSeries(DataModel model,
                             MetaDataModel metaModel,
                             AxisMapper xMapper,
                             AxisMapper yMapper)
Marker decorable series

Parameters:
model - data model
metaModel - meta data model
xMapper - x axis mapper
yMapper - y axis mapper
Method Detail

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 AbstractChartSeries<Tags extends AbstractPaintTags,ChartProjector extends Projector>
Returns:
object paint order index

calculateNullValue

protected java.lang.Object calculateNullValue(MarkerDecorableSeries<Tags,ChartProjector> series,
                                              int index)
Calculates x or y values instead of null values in data model. This method is used only if user has set nullMarker object to the stylesheet of this series. Marker (nullMarker) will be drawn if this method will calculated and return non-null value.

Parameters:
series - Series that data model will be used to calculate
index -
Returns:
Calculated (x or y) value

getMarkerStyle

protected Style getMarkerStyle(Marker marker,
                               java.lang.Object value,
                               int index)

dataConstraintExtraction

protected boolean dataConstraintExtraction()

generateConstaint

protected MarkerConstraints generateConstaint(Marker marker,
                                              GeneralPoint point,
                                              int index)

getPointForConstraint

protected GeneralPoint getPointForConstraint(ArrayDataModel model,
                                             int index)

getMarkerConstraints

public java.util.ArrayList<java.util.ArrayList<MarkerConstraints>> getMarkerConstraints()

drawMarkers

public void drawMarkers(AbstractGraphics g,
                        Marker normalMarker,
                        MarkerConstraints[] constraints)
Sets values to marker from marker constraints and draws markers with MarkerPainter

Parameters:
g - the Graphics context in which to paint markers
normalMarker - the marker to draw
constraints - array of marker constraints

drawMarkers

public void drawMarkers(AbstractGraphics g)
Draws markers according to default layouting

Specified by:
drawMarkers in interface AbstractMarkerSeries
Parameters:
g - graphics context

addMarker

public void addMarker(Marker marker,
                      Alignment verticalAlignment,
                      Alignment horizontalAlignment)
Adds marker to the BAR SERIES. It is aligned as specified. Only one instance of the marker with the same alignment combination can be added. If second marker is added with the same alignment, then the old one will be overwritten.

Parameters:
marker - marker to add
verticalAlignment - vertical alignment of the marker
horizontalAlignment - horizontal alignment of the marker

addMarker

public void addMarker(Marker marker,
                      Alignment alignment)
Adds marker to the series. It is aligned as specified. Only one instance of the marker with the same alignment can be added. If second marker is added with the same alignment, then the old one will be overwritten.

Parameters:
marker - marker to add
alignment - alignment of the marker

addMarker

public void addMarker(Marker marker)
Adds Marker to the series. It is aligned to the top of the series data point. Only one instance of the marker will be added. If another one is added, then the old one is overwritten.

Parameters:
marker - marker to add

removeMarker

public void removeMarker(Marker marker)

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 AbstractChartSeries<Tags extends AbstractPaintTags,ChartProjector extends Projector>
Parameters:
g - graphics context

getBaseValue

public java.lang.Object getBaseValue()
Gets the base value of the series

Returns:
the baseValue

setBaseValue

public void setBaseValue(java.lang.Object baseValue)
Sets the base value of the series

Parameters:
baseValue - the baseValue to set

getColorMapper

public ColorMapper getColorMapper()
Gets color mapper

Returns:
the colorMapper object

setColorMapper

public void setColorMapper(ColorMapper colorMapper)
Sets color mapper

Parameters:
colorMapper - the colorMapper class

getKeyType

public DataColumnType getKeyType()
Gets the key value type, which is determined automatically

Returns:
key data value type

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.

getMarkers

public java.util.List<MarkerEntry> getMarkers()
Gets marker list

Returns:
marker list

mapMinMaxValue

protected java.lang.Object mapMinMaxValue(DataColumnType valType,
                                          java.lang.Object obj)
Gets mapped minimum or max value

Parameters:
valType - value type
obj - object to map
Returns:
minimum or maximum value

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<Tags extends AbstractPaintTags,ChartProjector extends Projector>
Parameters:
valType - data value column
Returns:
maximum value needed

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<Tags extends AbstractPaintTags,ChartProjector extends Projector>
Parameters:
valType - data value column
Returns:
minimum value needed

copy

public void copy(MarkerDecorableSeries<?,?> src)
Copies series object settings from source series object (style, markers)

Parameters:
src - source chart series

layout

public void layout(AbstractGraphics g)
Description copied from class: AbstractChartObject
Dummy ChartObject interface's layout method implementation.

Specified by:
layout in interface ChartObject
Overrides:
layout in class AbstractChartObject<Tags extends AbstractPaintTags>
Parameters:
g - the Graphics context in which chart object will be painted
See Also:
ChartObject.layout(lt.monarch.chart.engine.AbstractGraphics)