org.eclipse.birt.chart.render
Class BaseRenderer

java.lang.Object
  extended byorg.eclipse.birt.chart.render.BaseRenderer
All Implemented Interfaces:
ISeriesRenderer
Direct Known Subclasses:
AxesRenderer, EmptyWithoutAxes

public abstract class BaseRenderer
extends java.lang.Object
implements ISeriesRenderer

Provides a generic framework that initiates the rendering sequence of the various chart components. Series type extensions could subclass this class if they plan on rendering everything for themselves in the plot area.


Field Summary
static ColorDefinition SHADOW
          Internally used to simulate a translucent shadow
 
Constructor Summary
BaseRenderer()
          The internal constructor that must be defined as public
 
Method Summary
 java.lang.Object getComputations()
           
 DeferredCache getDeferredCache()
           
 DeferredCacheManager getDeferredCacheManager()
          Returns DeferredCacheManager instance.
 IDeviceRenderer getDevice()
           
 double getDeviceScale()
           
 int[] getFilteredMinSliceEntry(DataSetIterator dsi)
          Returns if the corresponding category entry is filtered as minslice in legend.
 Chart getModel()
           
 BaseRenderer getRenderer(int iIndex)
          Provides access to any other renderer in the group that participates in chart rendering
 RunTimeContext getRunTimeContext()
           
 Series getSeries()
           
 int getSeriesCount()
           
 SeriesDefinition getSeriesDefinition()
           
 int getSeriesIndex()
          Identifies the series sequence # in the list of series renders(start from 0).
 ISeriesRenderingHints getSeriesRenderingHints()
           
static double getX(Location[] loa, int iProperty)
          Finds particular X value from given location list.
 IDisplayServer getXServer()
           
static double getY(Location[] loa, int iProperty)
          Finds particular Y value from given location list.
static BaseRenderer[] instances(Chart cm, RunTimeContext rtc, java.lang.Object oComputations)
          This method returns appropriate renders for the given chart model.
 boolean isInteractivityEnabled()
          Returns if interactivity is enabled on the model.
 boolean isRightToLeft()
          Returns if the right-left mode is enabled.
 void processTrigger(Trigger tg, StructureSource source)
          post-process the triggers.
 void render(java.util.Map htRenderers, Bounds bo)
          Renders all blocks using the appropriate block z-order and the containment hierarchy.
 void renderLabel(IPrimitiveRenderer ipr, Block b, java.lang.Object oSource)
          Renders label.
 void renderLabel(java.lang.Object oSource, int iTextRenderType, Label laDataPoint, Position lp, Location lo, Bounds bo)
          This convenience method renders the data point label along with the shadow If there's a need to render the data point label and the shadow separately, each call should be made separately by calling into the primitive rendering interface directly.
 void renderLabel(java.lang.Object oSource, int iTextRenderType, Label laDataPoint, Position lp, Location lo, Bounds bo, DeferredCache _dc)
          Renderer label with specified DeferredCache.
 void renderLegend(IPrimitiveRenderer ipr, Legend lg, java.util.Map htRenderers)
          Renders the legend block based on the legend rendering rules.
 void renderPlot(IPrimitiveRenderer ipr, Plot p)
          Renders the Plot
 void renderTitle(IPrimitiveRenderer ipr, TitleBlock b)
          Renders the Chart Title Block
 void set(BaseRenderer[] _brna)
          Setes all associated renderers used for current chart rendering.
 void set(Chart _cm, java.lang.Object _oComputation, Series _se, SeriesDefinition _sd)
          Sets the context infomation for current renderer.
 void set(DeferredCache _dc)
          Sets the deferred cache used by current renderer.
 void set(IDeviceRenderer _ir)
          Sets the device renderer for current renderer.
 void set(IDisplayServer _xs)
          Sets the diplay server for current renderer.
 void set(ISeriesRenderingHints _srh)
          Sets the series rendering hints for current renderer.
 void set(RunTimeContext _rtc)
          Sets the runtime context object for current renderer.
 void setDeferredCacheManager(DeferredCacheManager dcm)
          Set current DeferredCacheManager instance.
 Anchor switchAnchor(Anchor anchor)
          Switch Anchor value due to right-left setting.
 Position switchPosition(Position po)
          Switch Position value due to right-left setting.
 TextAlignment switchTextAlignment(TextAlignment ta)
          Switch TextAlignment value due to right-left setting.
 void updateTranslucency(Fill fill, Series se)
          Updates the tranlucency of the fill according to series setting.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.birt.chart.render.ISeriesRenderer
compute, renderLegendGraphic, renderSeries
 

Field Detail

SHADOW

public static final ColorDefinition SHADOW
Internally used to simulate a translucent shadow

Constructor Detail

BaseRenderer

public BaseRenderer()
The internal constructor that must be defined as public

Method Detail

set

public void set(Chart _cm,
                java.lang.Object _oComputation,
                Series _se,
                SeriesDefinition _sd)
Sets the context infomation for current renderer.

Parameters:
_cm -
_se -
_sd -

set

public final void set(DeferredCache _dc)
Sets the deferred cache used by current renderer.


set

public final void set(IDeviceRenderer _ir)
Sets the device renderer for current renderer.


set

public final void set(IDisplayServer _xs)
Sets the diplay server for current renderer.


set

public final void set(ISeriesRenderingHints _srh)
Sets the series rendering hints for current renderer.


set

public final void set(BaseRenderer[] _brna)
Setes all associated renderers used for current chart rendering.


set

public final void set(RunTimeContext _rtc)
Sets the runtime context object for current renderer.


getSeriesRenderingHints

public final ISeriesRenderingHints getSeriesRenderingHints()
Returns:
Returns the series rendering hints for current renderer.

getXServer

public final IDisplayServer getXServer()
Returns:
Returns the display server for current renderer.

getDeviceScale

public final double getDeviceScale()
Returns:
Returns the scale of current device against standard 72dpi (X/72).

getSeriesDefinition

public final SeriesDefinition getSeriesDefinition()
Returns:
Returns the series definition associated with current renderer.

getSeriesIndex

public final int getSeriesIndex()
Identifies the series sequence # in the list of series renders(start from 0).

Returns:
The index of the Series being rendered

getSeriesCount

public final int getSeriesCount()
Returns:
Returns the series count for current chart rendering.

getDeferredCache

public final DeferredCache getDeferredCache()
Returns:
Returns the deferred cache associated with current renderer.

getRenderer

public final BaseRenderer getRenderer(int iIndex)
Provides access to any other renderer in the group that participates in chart rendering

Parameters:
iIndex -
Returns:

getRunTimeContext

public final RunTimeContext getRunTimeContext()
Returns:
Returns the runtime context associated with current renderer.

render

public void render(java.util.Map htRenderers,
                   Bounds bo)
            throws ChartException
Renders all blocks using the appropriate block z-order and the containment hierarchy.

Parameters:
bo -
Throws:
ChartException

renderLegend

public void renderLegend(IPrimitiveRenderer ipr,
                         Legend lg,
                         java.util.Map htRenderers)
                  throws ChartException
Renders the legend block based on the legend rendering rules.

Parameters:
ipr -
lg -
htRenderers -
Throws:
ChartException

renderPlot

public void renderPlot(IPrimitiveRenderer ipr,
                       Plot p)
                throws ChartException
Renders the Plot

Parameters:
ipr - The Primitive Renderer of a Device Renderer
p - The Plot to render
Throws:
ChartException

renderLabel

public void renderLabel(IPrimitiveRenderer ipr,
                        Block b,
                        java.lang.Object oSource)
                 throws ChartException
Renders label.

Parameters:
ipr -
b -
Throws:
ChartException

renderTitle

public void renderTitle(IPrimitiveRenderer ipr,
                        TitleBlock b)
                 throws ChartException
Renders the Chart Title Block

Parameters:
ipr - The Primitive Renderer of a Device Renderer
b - The TitleBlock to render
Throws:
ChartException

instances

public static final BaseRenderer[] instances(Chart cm,
                                             RunTimeContext rtc,
                                             java.lang.Object oComputations)
                                      throws ChartException
This method returns appropriate renders for the given chart model. It uses extension points to identify a renderer corresponding to a custom series.

Parameters:
cm -
rtc -
oComputations -
Returns:
Throws:
ChartException

getSeries

public final Series getSeries()
Returns:
Returns series associated with current renderer.

getModel

public final Chart getModel()
Returns:
Returns chart model associated with current renderer.

getComputations

public final java.lang.Object getComputations()
Returns:
Returns computation object associated with current renderer.

getDevice

public final IDeviceRenderer getDevice()
Returns:
Returns device renderer associated with current renderer.

getY

public static final double getY(Location[] loa,
                                int iProperty)
Finds particular Y value from given location list.

Parameters:
loa - Location list.
iProperty - This value must be one of following:
  • IConstants.MIN
  • IConstants.MAX
  • IConstants.AVERAGE
Returns:

getX

public static final double getX(Location[] loa,
                                int iProperty)
Finds particular X value from given location list.

Parameters:
loa - Location list.
iProperty - This value must be one of following:
  • IConstants.MIN
  • IConstants.MAX
  • IConstants.AVERAGE
Returns:

processTrigger

public void processTrigger(Trigger tg,
                           StructureSource source)
post-process the triggers.

Parameters:
tg - The Trigger to modify
source - The StructureSource associated with the Trigger

renderLabel

public final void renderLabel(java.lang.Object oSource,
                              int iTextRenderType,
                              Label laDataPoint,
                              Position lp,
                              Location lo,
                              Bounds bo)
                       throws ChartException
This convenience method renders the data point label along with the shadow If there's a need to render the data point label and the shadow separately, each call should be made separately by calling into the primitive rendering interface directly.

Throws:
ChartException

renderLabel

public final void renderLabel(java.lang.Object oSource,
                              int iTextRenderType,
                              Label laDataPoint,
                              Position lp,
                              Location lo,
                              Bounds bo,
                              DeferredCache _dc)
                       throws ChartException
Renderer label with specified DeferredCache.

Parameters:
oSource -
iTextRenderType -
laDataPoint -
lp -
lo -
bo -
_dc -
Throws:
ChartException

isRightToLeft

public boolean isRightToLeft()
Returns if the right-left mode is enabled.

Returns:

switchAnchor

public Anchor switchAnchor(Anchor anchor)
Switch Anchor value due to right-left setting.

Parameters:
anchor -
Returns:

switchPosition

public Position switchPosition(Position po)
Switch Position value due to right-left setting.

Parameters:
po -
Returns:

switchTextAlignment

public TextAlignment switchTextAlignment(TextAlignment ta)
Switch TextAlignment value due to right-left setting.

Parameters:
ta -
Returns:

isInteractivityEnabled

public boolean isInteractivityEnabled()
Returns if interactivity is enabled on the model.

Returns:

getFilteredMinSliceEntry

public int[] getFilteredMinSliceEntry(DataSetIterator dsi)
Returns if the corresponding category entry is filtered as minslice in legend. Subclass should override this method to implement their own legend strategy.

Returns:
return null if no minslice applied or minslice feature is not supported.

updateTranslucency

public void updateTranslucency(Fill fill,
                               Series se)
Updates the tranlucency of the fill according to series setting.

Parameters:
fill -
se -

setDeferredCacheManager

public void setDeferredCacheManager(DeferredCacheManager dcm)
Set current DeferredCacheManager instance.

Parameters:
dcm - specified instance of DeferredCacheMananger.

getDeferredCacheManager

public DeferredCacheManager getDeferredCacheManager()
Returns DeferredCacheManager instance.

Returns:
DeferredCacheManager instance.


Copyright © 2005-2007 Actuate Corp. All rights reserved.