Package org.eclipse.birt.chart.device
Interface IDeviceRenderer
-
- All Superinterfaces:
java.util.EventListener,IPrimitiveRenderer,IStructureDefinitionListener
- All Known Implementing Classes:
DeviceAdapter
public interface IDeviceRenderer extends IPrimitiveRenderer, IStructureDefinitionListener
Combines the primitive rendering notifications provided in the primitive and other convenience methods needed by a device renderer. In addition, it provides an accessor to retrieve the underlying graphics context on which primitives are being rendered. Any new device renderer would have to implement this interface for it to transparently build charts via the rendering framework provided. Note that the device renderer works in conjunction with a display server implementation to correctly layout primitives.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAREA_ALT_ENABLEDA property name that indicates if alt attribute in area tag of image map will be used to display data point value.static java.lang.StringCACHE_ON_DISKA Property to enable/disable the caching of the image stream on disk Default is false.static java.lang.StringCACHED_IMAGEA property name that identifies an instance of a cached java.awt.Image that may be passed in for potential reuse.static java.lang.StringCOMPRESSED_OUTPUTA property name that indicates if the output associated with the device should be compressed ('true') or written out as is uncompressed ('false').static java.lang.StringDPI_RESOLUTIONA property name that indicates the dpi (dots/pixels per inch) resolution to use when rendering to the device.static java.lang.StringEXPECTED_BOUNDSA property name that identifies the expected bounds of the chart being generated.static java.lang.StringFILE_IDENTIFIERA property name that identifies a device-specific file identifier.static java.lang.StringFORMAT_IDENTIFIERA property name that identifies an output format identifierstatic java.lang.StringGRAPHICS_CONTEXTA property name that identifies a device-specific graphics contextstatic java.lang.StringUPDATE_NOTIFIERA property name that identifies a device-specific visual component (e.g.-
Fields inherited from interface org.eclipse.birt.chart.device.IStructureDefinitionListener
AFTER_DRAW_AXIS_LABEL, AFTER_DRAW_AXIS_TITLE, AFTER_DRAW_BLOCK, AFTER_DRAW_DATA_POINT, AFTER_DRAW_DATA_POINT_LABEL, AFTER_DRAW_ELEMENT, AFTER_DRAW_FITTING_CURVE, AFTER_DRAW_LEGEND_ENTRY, AFTER_DRAW_LEGEND_ITEM, AFTER_DRAW_MARKER, AFTER_DRAW_MARKER_LINE, AFTER_DRAW_MARKER_RANGE, AFTER_DRAW_SERIES, AFTER_DRAW_SERIES_TITLE, BEFORE_DRAW_AXIS_LABEL, BEFORE_DRAW_AXIS_TITLE, BEFORE_DRAW_BLOCK, BEFORE_DRAW_DATA_POINT, BEFORE_DRAW_DATA_POINT_LABEL, BEFORE_DRAW_ELEMENT, BEFORE_DRAW_FITTING_CURVE, BEFORE_DRAW_LEGEND_ENTRY, BEFORE_DRAW_LEGEND_ITEM, BEFORE_DRAW_MARKER, BEFORE_DRAW_MARKER_LINE, BEFORE_DRAW_MARKER_RANGE, BEFORE_DRAW_SERIES, BEFORE_DRAW_SERIES_TITLE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidafter()A notification sent to the device to cleanup after rendering is donevoidbefore()A notification sent to the device to initialize itself before rendering beginsvoiddispose()A notification sent to the device to free all allocated system resources.IChartComputationgetChartComputation()Returns the chart computation.IDisplayServergetDisplayServer()Returns an instance of the low level display server capable of providing text metrics, screen resolution, etc.java.lang.ObjectgetGraphicsContext()Returns an instance of the low level graphics context being used to render primitivesjava.util.LocalegetLocale()Deprecated.usegetULocale()instead.java.lang.StringgetMimeType()Returns the MIME type of the output image that the device renderer creates.com.ibm.icu.util.ULocalegetULocale()Provides the locale to device renderer implementations as needed to retrieve localized resources for presentation.booleanneedsStructureDefinition()Indicated to the caller if the device renderer needs additional structure definition callbacks to identify how primitives are to be grouped to possibly aid in client side event handling.voidpresentException(java.lang.Exception ex)Notifies a device renderer to present an exception in its contextvoidsetChartComputation(IChartComputation cComp)Sets the chart computation.voidsetProperty(java.lang.String sProperty, java.lang.Object oValue)Device-specific write-only properties that may be set for each device renderer-
Methods inherited from interface org.eclipse.birt.chart.device.IPrimitiveRenderer
applyTransformation, drawArc, drawArea, drawImage, drawLine, drawOval, drawPolygon, drawRectangle, drawText, enableInteraction, fillArc, fillArea, fillOval, fillPolygon, fillRectangle, setClip
-
Methods inherited from interface org.eclipse.birt.chart.device.IStructureDefinitionListener
changeStructure
-
-
-
-
Field Detail
-
FILE_IDENTIFIER
static final java.lang.String FILE_IDENTIFIER
A property name that identifies a device-specific file identifier. The value can be either file path or instance of output stream.- See Also:
- Constant Field Values
-
FORMAT_IDENTIFIER
static final java.lang.String FORMAT_IDENTIFIER
A property name that identifies an output format identifier- See Also:
- Constant Field Values
-
GRAPHICS_CONTEXT
static final java.lang.String GRAPHICS_CONTEXT
A property name that identifies a device-specific graphics context- See Also:
- Constant Field Values
-
UPDATE_NOTIFIER
static final java.lang.String UPDATE_NOTIFIER
A property name that identifies a device-specific visual component (e.g. used for event detection)- See Also:
- Constant Field Values
-
EXPECTED_BOUNDS
static final java.lang.String EXPECTED_BOUNDS
A property name that identifies the expected bounds of the chart being generated. This notification is sent out to provide the renderer with a hint about the location and size of the output being generated typically used with an Image file output. This is internally set by the 'Generator'.- See Also:
- Constant Field Values
-
CACHED_IMAGE
static final java.lang.String CACHED_IMAGE
A property name that identifies an instance of a cached java.awt.Image that may be passed in for potential reuse. In general, the image device renderers are configured to create a new image instance for every chart image generation request if a cached image is not specified. Ensure that the image passed in externally uses the correct size in pixels equivalent to the expected bounds specified in points.- See Also:
- Constant Field Values
-
COMPRESSED_OUTPUT
static final java.lang.String COMPRESSED_OUTPUT
A property name that indicates if the output associated with the device should be compressed ('true') or written out as is uncompressed ('false'). Device renderers should interpret a missing undefined value as uncompressed.- See Also:
- Constant Field Values
-
DPI_RESOLUTION
static final java.lang.String DPI_RESOLUTION
A property name that indicates the dpi (dots/pixels per inch) resolution to use when rendering to the device. This is used to convert 'points' in pixels (a point is 1/72 inch). If not indicated, it will use the default dpi resolution of the corresponding display server (typically 96dpi)- See Also:
- Constant Field Values
-
CACHE_ON_DISK
static final java.lang.String CACHE_ON_DISK
A Property to enable/disable the caching of the image stream on disk Default is false.- See Also:
- Constant Field Values
-
AREA_ALT_ENABLED
static final java.lang.String AREA_ALT_ENABLED
A property name that indicates if alt attribute in area tag of image map will be used to display data point value.- See Also:
- Constant Field Values
-
-
Method Detail
-
setProperty
void setProperty(java.lang.String sProperty, java.lang.Object oValue)Device-specific write-only properties that may be set for each device renderer- Parameters:
sProperty- The property whose value is to be setoValue- The value associated with the property
-
getGraphicsContext
java.lang.Object getGraphicsContext()
Returns an instance of the low level graphics context being used to render primitives- Returns:
- An instance of the low level graphics context being used to render primitives
-
getDisplayServer
IDisplayServer getDisplayServer()
Returns an instance of the low level display server capable of providing text metrics, screen resolution, etc.- Returns:
- An instance of the low level display server capable of providing text metrics, screen resolution, etc.
-
needsStructureDefinition
boolean needsStructureDefinition()
Indicated to the caller if the device renderer needs additional structure definition callbacks to identify how primitives are to be grouped to possibly aid in client side event handling.- Returns:
- 'true' if structure definition notificates are required in the device renderer implementation.
-
before
void before() throws ChartExceptionA notification sent to the device to initialize itself before rendering begins- Throws:
ChartException
-
after
void after() throws ChartExceptionA notification sent to the device to cleanup after rendering is done- Throws:
ChartException
-
dispose
void dispose()
A notification sent to the device to free all allocated system resources.
-
presentException
void presentException(java.lang.Exception ex)
Notifies a device renderer to present an exception in its context- Parameters:
ex- The exception to be presented
-
getLocale
@Deprecated java.util.Locale getLocale()
Deprecated.usegetULocale()instead.Provides the locale to device renderer implementations as needed to retrieve localized resources for presentation.- Returns:
- The locale to be used
-
getULocale
com.ibm.icu.util.ULocale getULocale()
Provides the locale to device renderer implementations as needed to retrieve localized resources for presentation.- Returns:
- The locale to be used
- Since:
- 2.1
-
getMimeType
java.lang.String getMimeType()
Returns the MIME type of the output image that the device renderer creates. Returns null in case of native rendering (no image file is created)- Returns:
- the MIME type as a String (e.g. "image/png")
- Since:
- 2.3
-
getChartComputation
IChartComputation getChartComputation()
Returns the chart computation.- Returns:
- IChartComputation
- Since:
- 2.5
-
setChartComputation
void setChartComputation(IChartComputation cComp)
Sets the chart computation.- Parameters:
cComp- IChartComputation- Since:
- 2.5
-
-