lt.monarch.chart.chart3D.series
Class Bar3DStrategy<ChartProjector extends Projector>

java.lang.Object
  extended by lt.monarch.chart.chart3D.series.AbstractBar3DStrategy<ChartProjector>
      extended by lt.monarch.chart.chart3D.series.Bar3DStrategy<ChartProjector>
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FloatingBar3DStrategy

public class Bar3DStrategy<ChartProjector extends Projector>
extends AbstractBar3DStrategy<ChartProjector>

Bar drawing strategy. This strategy draws all bars.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  int size
          Data model size
 
Fields inherited from class lt.monarch.chart.chart3D.series.AbstractBar3DStrategy
barSpacing, barWidth, baseValue, clipList, colorMapper, dirty, mapper, metaModel, minMaxValues, model, orientation, seriesCount, seriesIndex, seriesSpacing, shape, style, xMapper, yMapper, zMapper, zoomMultiplier
 
Constructor Summary
Constructor and Description
Bar3DStrategy()
           
 
Method Summary
Modifier and Type Method and Description
 void dispose()
          Disposes the object
 void draw(AbstractGraphics g, ChartProjector projector, PlaneMapper mapper, HotSpotMap hotMap, boolean showNullValues, Style style, int seriesCount, int seriesIndex, java.lang.Object baseValue, float barSpacing, float seriesSpacing, AbstractBarSeries<ChartProjector> barSeries, IndexedClipList clipList, ColorMapper colorMapper)
          Draws the series in the chart area.
 void drawPrimitive(AbstractGraphics g, int index, ChartProjector projector, HotSpotMap hotMap, boolean showNullValues, java.lang.Object baseValue, AbstractBarSeries barSeries)
          Draws one primitive
protected  void finalize()
           
 double getBarBottom(int index, java.lang.Object baseValue)
          Gets bottom bar position
protected  Rectangle2D getBarBoundaries(int index, java.lang.Object baseValue)
          Transforms the specified bar.
protected  double getBarDepth()
          Retrieves a depth value for bars.
 double getBarPosition(int index)
          Gets bar position, where the bar should stand.
 double getBarTop(int index)
          Gets bar top position
protected  double getBarWidth()
          Returns general bar width for all bars.
 double getBarWidth(int index)
          Gets bar width from the style sheet.
 double getBarZPosition(int index)
          Retrieves the bar position in z axis.
protected  double getBottomBarTop(int index, DataColumnType dataColumn, AxisMapper mapper, java.lang.Object baseValue)
          Determines the bar position
 Shape2D getDefaultShape()
          Returns the default strategy shape
protected  int getLabelCount(AxisMapper mapper)
          Returns label count on the axis
protected  Transformation3D getTransformation(Orientation orientation, int size, int barIndex, double barWidth, double barDepth, ChartProjector projector)
          Gets the transformation for series
protected  double getZeroValue(AxisMapper mapper)
          Gets mapped zero value if possible to map
protected  double getZoomMultiplier(AxisMapper mapper)
          Returns zoom multiplier
 
Methods inherited from class lt.monarch.chart.chart3D.series.AbstractBar3DStrategy
getMinMaxValues, setShape
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

protected int size
Data model size

Constructor Detail

Bar3DStrategy

public Bar3DStrategy()
Method Detail

draw

public void draw(AbstractGraphics g,
                 ChartProjector projector,
                 PlaneMapper mapper,
                 HotSpotMap hotMap,
                 boolean showNullValues,
                 Style style,
                 int seriesCount,
                 int seriesIndex,
                 java.lang.Object baseValue,
                 float barSpacing,
                 float seriesSpacing,
                 AbstractBarSeries<ChartProjector> barSeries,
                 IndexedClipList clipList,
                 ColorMapper colorMapper)
Description copied from class: AbstractBar3DStrategy
Draws the series in the chart area.

Overrides:
draw in class AbstractBar3DStrategy<ChartProjector extends Projector>
Parameters:
g - graphics context
projector - projector instance
mapper - plane mapper
hotMap - hot spot map
showNullValues - boolean value indicating whether to show the null values
style - style object
seriesCount - series count
seriesIndex - series index
baseValue - base value
barSpacing - bar spacing
seriesSpacing - series spacing
barSeries - bar series instance
clipList - clip list
colorMapper - color mapper, which maps colors according to values

drawPrimitive

public void drawPrimitive(AbstractGraphics g,
                          int index,
                          ChartProjector projector,
                          HotSpotMap hotMap,
                          boolean showNullValues,
                          java.lang.Object baseValue,
                          AbstractBarSeries barSeries)
Description copied from class: AbstractBar3DStrategy
Draws one primitive

Specified by:
drawPrimitive in class AbstractBar3DStrategy<ChartProjector extends Projector>
Parameters:
g - graphics context
index - data point index
projector - projector
hotMap - hot spot map
showNullValues - if true show null values
baseValue - base line value
barSeries - bar series instance

getBarWidth

public double getBarWidth(int index)
Gets bar width from the style sheet. Works only when the mappers and data model have beens set.

Parameters:
index - data point index
Returns:
bar width

getBarTop

public double getBarTop(int index)
Description copied from class: AbstractBar3DStrategy
Gets bar top position

Specified by:
getBarTop in class AbstractBar3DStrategy<ChartProjector extends Projector>
Parameters:
index - data point index
Returns:
bar top position

getZeroValue

protected double getZeroValue(AxisMapper mapper)
Gets mapped zero value if possible to map

Parameters:
mapper - mapper
Returns:
zero value

getBarBottom

public double getBarBottom(int index,
                           java.lang.Object baseValue)
Description copied from class: AbstractBar3DStrategy
Gets bottom bar position

Specified by:
getBarBottom in class AbstractBar3DStrategy<ChartProjector extends Projector>
Parameters:
index - index of data point
baseValue - base line value
Returns:
bar bottom position

getBottomBarTop

protected double getBottomBarTop(int index,
                                 DataColumnType dataColumn,
                                 AxisMapper mapper,
                                 java.lang.Object baseValue)
Determines the bar position

Parameters:
index - bar index
dataColumn - data column in the data model
mapper - axis mapper
Returns:
bar position

getTransformation

protected Transformation3D getTransformation(Orientation orientation,
                                             int size,
                                             int barIndex,
                                             double barWidth,
                                             double barDepth,
                                             ChartProjector projector)
Gets the transformation for series

Returns:
bar transformation

getBarWidth

protected double getBarWidth()
Description copied from class: AbstractBar3DStrategy
Returns general bar width for all bars. This method works only when mappers have been set.

Specified by:
getBarWidth in class AbstractBar3DStrategy<ChartProjector extends Projector>
Returns:
normalized bar width value

getBarDepth

protected double getBarDepth()
Retrieves a depth value for bars.

Returns:
- depth value

getLabelCount

protected int getLabelCount(AxisMapper mapper)
Returns label count on the axis

Parameters:
mapper - axis mapper
Returns:
returns label count on the mapper

getZoomMultiplier

protected double getZoomMultiplier(AxisMapper mapper)
Returns zoom multiplier

Parameters:
mapper - axis mapper to calculate the zoom
Returns:
zoom multiplier number

dispose

public void dispose()
Description copied from class: AbstractBar3DStrategy
Disposes the object

Specified by:
dispose in class AbstractBar3DStrategy<ChartProjector extends Projector>

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

getDefaultShape

public Shape2D getDefaultShape()
Description copied from class: AbstractBar3DStrategy
Returns the default strategy shape

Specified by:
getDefaultShape in class AbstractBar3DStrategy<ChartProjector extends Projector>
Returns:
default strategy shape

getBarPosition

public double getBarPosition(int index)
Description copied from class: AbstractBar3DStrategy
Gets bar position, where the bar should stand. If vertical then x coordinate, if horizontal y coordinate

Specified by:
getBarPosition in class AbstractBar3DStrategy<ChartProjector extends Projector>
Parameters:
index - data point index
Returns:
bar position

getBarZPosition

public double getBarZPosition(int index)
Retrieves the bar position in z axis.

Parameters:
index - an index of bar
Returns:
the position of bar in z axis

getBarBoundaries

protected Rectangle2D getBarBoundaries(int index,
                                       java.lang.Object baseValue)
Description copied from class: AbstractBar3DStrategy
Transforms the specified bar. Shifts according to transformation and determines it's top and bottom bounds.

Specified by:
getBarBoundaries in class AbstractBar3DStrategy<ChartProjector extends Projector>
Parameters:
index - index of the data point
baseValue - base value