Package org.eclipse.birt.chart.device

# Interface IDeviceRenderer

All Superinterfaces:
  `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 final 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.
`static final String`
`CACHE_ON_DISK`
A Property to enable/disable the caching of the image stream on disk Default is false.
`static final String`
`CACHED_IMAGE`
A property name that identifies an instance of a cached java.awt.Image that may be passed in for potential reuse.
`static final 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').
`static final String`
`DPI_RESOLUTION`
A property name that indicates the dpi (dots/pixels per inch) resolution to use when rendering to the device.
`static final String`
`EXPECTED_BOUNDS`
A property name that identifies the expected bounds of the chart being generated.
`static final String`
`FILE_IDENTIFIER`
A property name that identifies a device-specific file identifier.
`static final String`
`FORMAT_IDENTIFIER`
A property name that identifies an output format identifier
`static final String`
`GRAPHICS_CONTEXT`
A property name that identifies a device-specific graphics context
`static final String`
`UPDATE_NOTIFIER`
A 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

Modifier and Type
Method
Description
`void`
`after()`
A notification sent to the device to cleanup after rendering is done
`void`
`before()`
A notification sent to the device to initialize itself before rendering begins
`void`
`dispose()`
A notification sent to the device to free all allocated system resources.
`IChartComputation`
`getChartComputation()`
Returns the chart computation.
`IDisplayServer`
`getDisplayServer()`
Returns an instance of the low level display server capable of providing text metrics, screen resolution, etc.
`Object`
`getGraphicsContext()`
Returns an instance of the low level graphics context being used to render primitives
`Locale`
`getLocale()`
Deprecated.
use `getULocale()` instead.
`String`
`getMimeType()`
Returns the MIME type of the output image that the device renderer creates.
`com.ibm.icu.util.ULocale`
`getULocale()`
Provides the locale to device renderer implementations as needed to retrieve localized resources for presentation.
`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.
`void`
`presentException(Exception ex)`
Notifies a device renderer to present an exception in its context
`void`
`setChartComputation(IChartComputation cComp)`
Sets the chart computation.
`void`
`setProperty(String sProperty, 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 Details

### FILE_IDENTIFIER

static final 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 String FORMAT_IDENTIFIER
A property name that identifies an output format identifier

See Also:
  - Constant Field Values

### GRAPHICS_CONTEXT

static final String GRAPHICS_CONTEXT
A property name that identifies a device-specific graphics context

See Also:
  - Constant Field Values

### UPDATE_NOTIFIER

static final 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 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 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 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 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 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 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 Details

### setProperty

void setProperty(String sProperty, Object oValue)
Device-specific write-only properties that may be set for each device renderer

Parameters:
  `sProperty` - The property whose value is to be set
  `oValue` - The value associated with the property

### getGraphicsContext

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 ChartException
A notification sent to the device to initialize itself before rendering begins

Throws:
  `ChartException`

### after

void after() throws ChartException
A 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(Exception ex)
Notifies a device renderer to present an exception in its context

Parameters:
  `ex` - The exception to be presented

### getLocale

@Deprecated Locale getLocale()
Deprecated.
use `getULocale()` 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

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