lt.monarch.chart.chart3D.series
Class Bar3DSeries

java.lang.Object
  extended by lt.monarch.chart.engine.AbstractChartObject<Tags>
      extended by lt.monarch.chart.AbstractChartSeries<Tags,ChartProjector>
          extended by lt.monarch.chart.chart3D.series.MarkerDecorableSeries3D<SeriesPaintTags,Projector3D>
              extended by lt.monarch.chart.chart3D.series.Bar3DSeries
All Implemented Interfaces:
java.io.Serializable, AbstractBarSeries<Projector3D>, AbstractMarkerSeries, ChartEntity, ChartObject, ChartSeries, StyleEditorEntity

public class Bar3DSeries
extends MarkerDecorableSeries3D<SeriesPaintTags,Projector3D>
implements AbstractBarSeries<Projector3D>

Bar series. This series draws various types of bars. In order, to change the drawing strategy,you must set different strategy. The strategies included are BAR_STRATEGY, ERROR_BAR_STRATEGY, EVENT_STRATEGY, FLOATING_BAR_STRATEGY, WATERFALL_STRATEGY Stylesheet constants setObject, "primitive" - sets the bar shape primitive.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  double barDepth
          Custom bar depth
protected  java.lang.Double barDepthOrg
           
protected static java.util.Hashtable<AxisMapper,java.lang.Float> barSpacings
          Hashtable that maps axis mapper to bar spacing
protected  double barWidth
          Custom bar width
protected  java.lang.Double barWidthOrg
           
protected  PlaneMapper mapper
          the plane mapper
protected  ArrayDataModel model
          Chart data model
protected  int seriesCount
          Series count on the mapper.
protected  int seriesIndex
          Series index on the mapper.
protected static java.util.Hashtable<AxisMapper,java.lang.Float> seriesSpacings
          Hashtable that maps axis mapper to bar spacing
 
Fields inherited from class lt.monarch.chart.chart3D.series.MarkerDecorableSeries3D
baseValue, colorMapper, markerPainter, markers, pseudoModel
 
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
Bar3DSeries(ArrayDataModel model, AxisMapper xMapper, AxisMapper yMapper, AxisMapper zMapper)
          Bar series constructor without a meta data model and default plane mapper is for Cartesian coordinates.
Bar3DSeries(ArrayDataModel model, AxisMapper xMapper, AxisMapper yMapper, AxisMapper zMapper, PlaneMapper mapper)
          Constructs a new BarSeries object
Bar3DSeries(ArrayDataModel model, MetaDataModel metaModel, AxisMapper xMapper, AxisMapper yMapper, AxisMapper zMapper)
          Constructs a new bar series.
Bar3DSeries(ArrayDataModel model, MetaDataModel metaModel, AxisMapper xMapper, AxisMapper yMapper, AxisMapper zMapper, PlaneMapper mapper)
          Constructs a new BarSeries object
 
Method Summary
Modifier and Type Method and Description
 LegendSymbol createLegendSymbol(int bar)
          Create a legend symbol for the specified bar.
 void dispose()
          Cleans this bar series object.
 void draw(AbstractGraphics g)
          Renders chart object on the Graphics context.
 double getBarDepth()
          Retrieves the depth of the bars.
static float getBarSpacing(AxisMapper mapper)
          Returns spacing between bars.
 double getBarWidth()
          Retrieves the width of the bars.
 AxisMapper getGroupKey()
          Gets grouping key for bar layout.
 MarkerConstraints[] getMarkerConstraints()
          Returns series marker constraints.
 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
 Orientation getOrientation()
          Gets bar orientation
static float getSeriesSpacing(AxisMapper mapper)
          Returns spacing between different bar series.
 AbstractBar3DStrategy<Projector3D> getStrategy()
          Gets bar drawing strategy object
protected  void handleDataModelChangeEvent(DataModelChangeEvent ev)
          Handles data model change event.
protected  void initLegendSymbol()
          Initializes a new BarSeriesLegendSymbol used for representing bar series in legend.
 void invalidate()
          Invalidates the bar series.
 void layout(int seriesCount, int index)
          Layout bar series (series layouting)
static void removeBarSpacing(AxisMapper mapper)
          Removes bar spacing from the hashtable according to the specified axis mapper
static void removeSeriesSpacing(AxisMapper mapper)
          Removes series spacing from the hashtable according to the specified axis mapper
 void setBarDepth(double barDepth)
          Sets a depth for the bars.
 void setBarDepthInternal(double barDepth)
           
static void setBarSpacing(AxisMapper mapper, float space)
          Sets spacing between bars for all series in a chart.
 void setBarWidth(double barWidth)
          Sets a width for the bars.
 void setBarWidthInternal(double barWidth)
           
 void setOrientation(Orientation orientation)
          Sets bar orientation
 void setPrimitive(Shapes primitive)
          Sets primitive of the bar shape
static void setSeriesSpacing(AxisMapper mapper, float space)
          Sets spacing between different bar series.
 void setStrategy(Bar3DStrategies strategy)
          Sets bar drawing strategy, i.e.
 
Methods inherited from class lt.monarch.chart.chart3D.series.MarkerDecorableSeries3D
addMarker, addMarker, addMarker, drawMarkers, drawMarkers, getBaseValue, getColorMapper, getKeyType, getPaintMode, getSortPosition, setBaseValue, setColorMapper, setPaintMode
 
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, setLegendSymbol, setName, setShowNullValues, setValidateData, showLegend, updateClippingToProjector
 
Methods inherited from class lt.monarch.chart.engine.AbstractChartObject
chart, copy, finalize, getChart, getPaintStyle, getParent, getStyle, getStyle, 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.AbstractBarSeries
getDataModel, getKeyType, getMetaDataModel, getModelValidator, getPaintMode, getProjector, getXMapper, getYMapper, getZMapper
 
Methods inherited from interface lt.monarch.chart.engine.ChartSeries
createLegendEntries, createLegendEntry, getName, setName
 
Methods inherited from interface lt.monarch.chart.engine.ChartObject
getChart, getSortPosition, getStyle, getStyle, isVisible, layout, repaint, repaint, setChart
 
Methods inherited from interface lt.monarch.chart.engine.ChartEntity
fillEntitySheet, getDescription, getParentEntity, getShortDescription
 
Methods inherited from interface lt.monarch.chart.engine.StyleEditorEntity
getChartObjectBounds, getParent, getStyle
 

Field Detail

model

protected ArrayDataModel model
Chart data model


mapper

protected PlaneMapper mapper
the plane mapper


seriesCount

protected int seriesCount
Series count on the mapper. Use this attribute indirectly through method.


seriesIndex

protected int seriesIndex
Series index on the mapper. Use this attribute indirectly through method.


barSpacings

protected static final java.util.Hashtable<AxisMapper,java.lang.Float> barSpacings
Hashtable that maps axis mapper to bar spacing


seriesSpacings

protected static final java.util.Hashtable<AxisMapper,java.lang.Float> seriesSpacings
Hashtable that maps axis mapper to bar spacing


barWidth

protected double barWidth
Custom bar width


barWidthOrg

protected java.lang.Double barWidthOrg

barDepth

protected double barDepth
Custom bar depth


barDepthOrg

protected java.lang.Double barDepthOrg
Constructor Detail

Bar3DSeries

public Bar3DSeries(ArrayDataModel model,
                   MetaDataModel metaModel,
                   AxisMapper xMapper,
                   AxisMapper yMapper,
                   AxisMapper zMapper,
                   PlaneMapper mapper)
Constructs a new BarSeries object

Parameters:
model - chart data model
metaModel - meta data model
xMapper - x axis mapper
yMapper - y axis mapper
zMapper - z axis mapper
mapper - mapper, used to map output to a plane in a n-dimensional space

Bar3DSeries

public Bar3DSeries(ArrayDataModel model,
                   AxisMapper xMapper,
                   AxisMapper yMapper,
                   AxisMapper zMapper,
                   PlaneMapper mapper)
Constructs a new BarSeries object

Parameters:
model - chart data model
xMapper - x axis mapper
yMapper - y axis mapper
zMapper - z axis mapper
mapper - mapper, used to map output to a plane in a n-dimensional space

Bar3DSeries

public Bar3DSeries(ArrayDataModel model,
                   AxisMapper xMapper,
                   AxisMapper yMapper,
                   AxisMapper zMapper)
Bar series constructor without a meta data model and default plane mapper is for Cartesian coordinates.

Parameters:
model - chart data model
xMapper - x axis mapper
yMapper - y axis mapper
zMapper - z axis mapper

Bar3DSeries

public Bar3DSeries(ArrayDataModel model,
                   MetaDataModel metaModel,
                   AxisMapper xMapper,
                   AxisMapper yMapper,
                   AxisMapper zMapper)
Constructs a new bar series. The default plane mapper is used for Cartesian coordinate system.

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

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<SeriesPaintTags,Projector3D>
Parameters:
ev - the chart data model change event
See Also:
DataModelChangeEvent

createLegendSymbol

public LegendSymbol createLegendSymbol(int bar)
Create a legend symbol for the specified bar. Each bar can have different style attributes. This method creates a specific legend symbol for a given bar in a series.

Parameters:
bar - bar index
Returns:
a legend symbol for the specified bar

initLegendSymbol

protected void initLegendSymbol()
Initializes a new BarSeriesLegendSymbol used for representing bar series in legend.


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 MarkerDecorableSeries3D<SeriesPaintTags,Projector3D>
Parameters:
g - graphics context

layout

public void layout(int seriesCount,
                   int index)
Description copied from interface: AbstractBarSeries
Layout bar series (series layouting)

Specified by:
layout in interface AbstractBarSeries<Projector3D>
Parameters:
seriesCount - series count in the chart
index - index of the bar

dispose

public void dispose()
Cleans this bar series object. After this series object is unusable and can be garbage collected.

Specified by:
dispose in interface ChartObject
Overrides:
dispose in class AbstractChartObject<SeriesPaintTags>

invalidate

public void invalidate()
Invalidates the bar series.

Specified by:
invalidate in interface ChartObject
Overrides:
invalidate in class AbstractChartObject<SeriesPaintTags>
See Also:
ChartObject.invalidate()

setBarWidth

public void setBarWidth(double barWidth)
Sets a width for the bars.

Parameters:
barWidth - bar width

setBarWidthInternal

public void setBarWidthInternal(double barWidth)

getBarWidth

public double getBarWidth()
Retrieves the width of the bars.

Returns:
width of bars

setBarDepth

public void setBarDepth(double barDepth)
Sets a depth for the bars.

Parameters:
barDepth - bar depth

setBarDepthInternal

public void setBarDepthInternal(double barDepth)

getBarDepth

public double getBarDepth()
Retrieves the depth of the bars.

Returns:
depth of bars

setBarSpacing

public static void setBarSpacing(AxisMapper mapper,
                                 float space)
Sets spacing between bars for all series in a chart.

Parameters:
mapper - Axis mapper for which bar spacing is specified. It is the mapper of the axis, where the bar key values are specified.
space - Space between different bars relative to bar width. Must be in interval [0.0 .. 1.0]. Passing negative space value allows the neighbouring bars to overlap.

getBarSpacing

public static float getBarSpacing(AxisMapper mapper)
Returns spacing between bars.

Parameters:
mapper - Axis mapper for which bar spacing is specified. It is the mapper of the axis, where the bar key values are specified.
Returns:
space between different bars relative to bar width in interval [0.0 .. 1.0].

getSeriesSpacing

public static float getSeriesSpacing(AxisMapper mapper)
Returns spacing between different bar series.

Parameters:
mapper - Axis mapper for which bar spacing is returned.
Returns:
space between different bar series relative to bar width in interval [0.0 .. 1.0].

setSeriesSpacing

public static void setSeriesSpacing(AxisMapper mapper,
                                    float space)
Sets spacing between different bar series.

Parameters:
mapper - Axis mapper for which bar spacing is specified.
space - Space between different bar series relative to bar width. Must be in interval [0.0 .. 1.0]. Passing negative space value allows the series to overlap.

removeBarSpacing

public static void removeBarSpacing(AxisMapper mapper)
Removes bar spacing from the hashtable according to the specified axis mapper

Parameters:
mapper - axis mapper, that specifies the bar spacing

removeSeriesSpacing

public static void removeSeriesSpacing(AxisMapper mapper)
Removes series spacing from the hashtable according to the specified axis mapper

Parameters:
mapper - axis mapper, that specifies the series spacing

getMarkerConstraints

public MarkerConstraints[] getMarkerConstraints()
Description copied from class: MarkerDecorableSeries3D
Returns series marker constraints.

Specified by:
getMarkerConstraints in class MarkerDecorableSeries3D<SeriesPaintTags,Projector3D>
Returns:
Series marker constraints.

getOrientation

public Orientation getOrientation()
Description copied from interface: AbstractBarSeries
Gets bar orientation

Specified by:
getOrientation in interface AbstractBarSeries<Projector3D>
Returns:
bar orientation

setOrientation

public void setOrientation(Orientation orientation)
Description copied from interface: AbstractBarSeries
Sets bar orientation

Specified by:
setOrientation in interface AbstractBarSeries<Projector3D>
Parameters:
orientation - bar orientation

setStrategy

public void setStrategy(Bar3DStrategies strategy)
Sets bar drawing strategy, i.e. chooses the bar type. use enumeration BarStrategies to choose the appropriate bar drawing strategy. If you want to set your own custom strategy set it directly to the stylesheet, using tag "strategy", e.g. style.setObject("strategy", new MyStrategy());

Parameters:
strategy - the bar drawing strategy to set

getStrategy

public AbstractBar3DStrategy<Projector3D> getStrategy()
Gets bar drawing strategy object


setPrimitive

public void setPrimitive(Shapes primitive)
Sets primitive of the bar shape

Parameters:
primitive - bar shape primitive

getGroupKey

public AxisMapper getGroupKey()
Description copied from interface: AbstractBarSeries
Gets grouping key for bar layout. Override this method in order to get custom layout.
Default layout for vertical bars is according to X axis, for horizontal according to Y axis.

Specified by:
getGroupKey in interface AbstractBarSeries<Projector3D>
Returns:
grouping key for bar layout.

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<SeriesPaintTags,Projector3D>
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<SeriesPaintTags,Projector3D>
Parameters:
valType - data value column
Returns:
minimum value needed