Class BaseRenderer

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

public abstract class BaseRenderer extends 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.
  • Constructor Details

    • BaseRenderer

      public BaseRenderer()
      The internal constructor that must be defined as public
      Parameters:
      _ir -
      _cm -
  • Method Details

    • set

      public void set(Chart _cm, PlotComputation _oComputation, Series _se, SeriesDefinition _sd)
      Sets the context information for current renderer.
      Parameters:
      _cm -
      _o -
      _se -
      _ax -
      _sd -
    • set

      public 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)
      Sets 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:
      renderer
    • getRunTimeContext

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

      public void render(Map<Series,LegendItemRenderingHints> htRenderers, Bounds bo) throws ChartException
      Renders all blocks using the appropriate block z-order and the containment hierarchy.
      Parameters:
      bo -
      Throws:
      ChartException
    • getAxesDecorator

      public IAxesDecorator getAxesDecorator(OneAxis ax)
      Returns the decorator renderer associated with current series, default is none.
    • isTransposed

      public boolean isTransposed()
      Returns if current chart is transposed.
    • renderLegend

      public void renderLegend(IPrimitiveRenderer ipr, Legend lg, Map<Series,LegendItemRenderingHints> 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, Object oSource) throws ChartException
      Renders label of a LabelBlock.
      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, PlotComputation 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:
      renderers
      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 PlotComputation 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
    • 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:
      x value
    • 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(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(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.
    • switchAnchor

      public Anchor switchAnchor(Anchor anchor)
      Switch Anchor value due to right-left setting.
      Parameters:
      anchor -
    • switchPosition

      public Position switchPosition(Position po)
      Switch Position value due to right-left setting.
      Parameters:
      po -
    • switchTextAlignment

      public TextAlignment switchTextAlignment(TextAlignment ta)
      Switch TextAlignment value due to right-left setting.
      Parameters:
      ta -
    • isInteractivityEnabled

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

      public Collection<Integer> 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.