Package org.eclipse.birt.chart.render
Class BaseRenderer
java.lang.Object
org.eclipse.birt.chart.render.BaseRenderer
- All Implemented Interfaces:
ISeriesRenderer
- Direct Known Subclasses:
AxesRenderer,EmptyWithoutAxes
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the decorator renderer associated with current series, default is none.final PlotComputationfinal DeferredCacheReturnsDeferredCacheManagerinstance.final IDeviceRendererfinal doubleReturns if the corresponding category entry is filtered as minslice in legend.final ChartgetModel()final BaseRenderergetRenderer(int iIndex) Provides access to any other renderer in the group that participates in chart renderingfinal RunTimeContextfinal Seriesfinal intfinal SeriesDefinitionfinal intIdentifies the series sequence # in the list of series renders(start from 0).final ISeriesRenderingHintsstatic final doubleFinds particular X value from given location list.final IDisplayServerstatic final doubleFinds particular Y value from given location list.static final BaseRenderer[]instances(Chart cm, RunTimeContext rtc, PlotComputation oComputations) This method returns appropriate renders for the given chart model.booleanReturns if interactivity is enabled on the model.booleanReturns if the right-left mode is enabled.booleanReturns if current chart is transposed.voidprocessTrigger(Trigger tg, StructureSource source) post-process the triggers.voidrender(Map<Series, LegendItemRenderingHints> htRenderers, Bounds bo) Renders all blocks using the appropriate block z-order and the containment hierarchy.final voidrenderLabel(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.final voidrenderLabel(Object oSource, int iTextRenderType, Label laDataPoint, Position lp, Location lo, Bounds bo, DeferredCache _dc) Renderer label with specifiedDeferredCache.voidrenderLabel(IPrimitiveRenderer ipr, Block b, Object oSource) Renders label of a LabelBlock.voidrenderLegend(IPrimitiveRenderer ipr, Legend lg, Map<Series, LegendItemRenderingHints> htRenderers) Renders the legend block based on the legend rendering rules.voidrenderPlot(IPrimitiveRenderer ipr, Plot p) Renders the PlotvoidrenderTitle(IPrimitiveRenderer ipr, TitleBlock b) Renders the Chart Title Blockfinal voidset(IDeviceRenderer _ir) Sets the device renderer for current renderer.final voidset(IDisplayServer _xs) Sets the diplay server for current renderer.final voidset(RunTimeContext _rtc) Sets the runtime context object for current renderer.voidset(Chart _cm, PlotComputation _oComputation, Series _se, SeriesDefinition _sd) Sets the context information for current renderer.final voidset(BaseRenderer[] _brna) Sets all associated renderers used for current chart rendering.voidset(DeferredCache _dc) Sets the deferred cache used by current renderer.final voidset(ISeriesRenderingHints _srh) Sets the series rendering hints for current renderer.voidSet currentDeferredCacheManagerinstance.switchAnchor(Anchor anchor) Switch Anchor value due to right-left setting.Switch Position value due to right-left setting.Switch TextAlignment value due to right-left setting.voidupdateTranslucency(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, waitMethods inherited from interface org.eclipse.birt.chart.render.ISeriesRenderer
compute, renderLegendGraphic, renderSeries
-
Constructor Details
-
BaseRenderer
public BaseRenderer()The internal constructor that must be defined as public- Parameters:
_ir-_cm-
-
-
Method Details
-
set
Sets the context information for current renderer.- Parameters:
_cm-_o-_se-_ax-_sd-
-
set
Sets the deferred cache used by current renderer. -
set
Sets the device renderer for current renderer. -
set
Sets the diplay server for current renderer. -
set
Sets the series rendering hints for current renderer. -
set
Sets all associated renderers used for current chart rendering. -
set
Sets the runtime context object for current renderer. -
getSeriesRenderingHints
- Returns:
- Returns the series rendering hints for current renderer.
-
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
- 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
- Returns:
- Returns the deferred cache associated with current renderer.
-
getRenderer
Provides access to any other renderer in the group that participates in chart rendering- Parameters:
iIndex-- Returns:
- renderer
-
getRunTimeContext
- Returns:
- Returns the runtime context associated with current renderer.
-
render
public void render(Map<Series, LegendItemRenderingHints> htRenderers, Bounds bo) throws ChartExceptionRenders all blocks using the appropriate block z-order and the containment hierarchy.- Parameters:
bo-- Throws:
ChartException
-
getAxesDecorator
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 ChartExceptionRenders the legend block based on the legend rendering rules.- Parameters:
ipr-lg-htRenderers-- Throws:
ChartException
-
renderPlot
Renders the Plot- Parameters:
ipr- The Primitive Renderer of a Device Rendererp- The Plot to render- Throws:
ChartException
-
renderLabel
Renders label of a LabelBlock.- Parameters:
ipr-b-- Throws:
ChartException
-
renderTitle
Renders the Chart Title Block- Parameters:
ipr- The Primitive Renderer of a Device Rendererb- 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
- Returns:
- Returns series associated with current renderer.
-
getModel
- Returns:
- Returns chart model associated with current renderer.
-
getComputations
- Returns:
- Returns computation object associated with current renderer.
-
getDevice
- Returns:
- Returns device renderer associated with current renderer.
-
getY
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
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
post-process the triggers.- Parameters:
tg- The Trigger to modifysource- 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 specifiedDeferredCache.- Parameters:
oSource-iTextRenderType-laDataPoint-lp-lo-bo-_dc-- Throws:
ChartException
-
isRightToLeft
public boolean isRightToLeft()Returns if the right-left mode is enabled. -
switchAnchor
Switch Anchor value due to right-left setting.- Parameters:
anchor-
-
switchPosition
Switch Position value due to right-left setting.- Parameters:
po-
-
switchTextAlignment
Switch TextAlignment value due to right-left setting.- Parameters:
ta-
-
isInteractivityEnabled
public boolean isInteractivityEnabled()Returns if interactivity is enabled on the model. -
getFilteredMinSliceEntry
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
Updates the tranlucency of the fill according to series setting.- Parameters:
fill-se-
-
setDeferredCacheManager
Set currentDeferredCacheManagerinstance.- Parameters:
dcm- specified instance ofDeferredCacheMananger.
-
getDeferredCacheManager
ReturnsDeferredCacheManagerinstance.- Returns:
DeferredCacheManagerinstance.
-