Package org.eclipse.birt.chart.device

# Class DeviceAdapter

java.lang.Object
org.eclipse.birt.chart.event.EventObjectCache
org.eclipse.birt.chart.device.DeviceAdapter

All Implemented Interfaces:
  `EventListener`, `IDeviceRenderer`, `IPrimitiveRenderer`, `IStructureDefinitionListener`

public abstract class DeviceAdapter extends EventObjectCache implements IDeviceRenderer
A no-op adapter implementation for the `IDeviceRenderer`interface definition.

## Field Summary

### Fields inherited from interface org.eclipse.birt.chart.device.IDeviceRenderer

`AREA_ALT_ENABLED, CACHE_ON_DISK, CACHED_IMAGE, COMPRESSED_OUTPUT, DPI_RESOLUTION, EXPECTED_BOUNDS, FILE_IDENTIFIER, FORMAT_IDENTIFIER, GRAPHICS_CONTEXT, UPDATE_NOTIFIER`

### 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`

## Constructor Summary

Constructors
Constructor
Description
`DeviceAdapter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`after()`
A notification sent to the device to cleanup after rendering is done
`void`
`applyTransformation(TransformationEvent tev)`
This method is capable of applying a global transformation on the device specific graphics context Available transformation types are: SCALE, TRANSLATE, ROTATE
`void`
`before()`
A notification sent to the device to initialize itself before rendering begins
`void`
`changeStructure(StructureChangeEvent scev)`
Sends out a notification to a listener indicating that a structure group has changed (either via a start or end) notification.
`void`
`dispose()`
A notification sent to the device to free all allocated system resources.
`void`
`drawArc(ArcRenderEvent are)`
This method is responsible for drawing an elliptical arc on the target rendering device's graphic context.
`void`
`drawArea(AreaRenderEvent are)`
This method is responsible for drawing a custom defined area on the target rendering device's graphic context.
`void`
`drawImage(ImageRenderEvent ire)`
This method is responsible for drawing an image on the target rendering device's graphic context.
`void`
`drawLine(LineRenderEvent lre)`
This method is responsible for drawing a line on the target rendering device's graphic context.
`void`
`drawOval(OvalRenderEvent ore)`
This method is responsible for drawing an oval area on the target rendering device's graphic context.
`void`
`drawPolygon(PolygonRenderEvent pre)`
This method is responsible for drawing a polygon on the target rendering device's graphic context.
`void`
`drawRectangle(RectangleRenderEvent rre)`
This method is responsible for drawing a rectangle on the target rendering device's graphic context.
`void`
`drawText(TextRenderEvent tre)`
This method renders text on the target rendering device's graphic context using one of the three methods: 1.
`void`
`enableInteraction(InteractionEvent ie)`
`void`
`fillArc(ArcRenderEvent are)`
This method is responsible for filling an elliptical arc on the target rendering device's graphic context.
`void`
`fillArea(AreaRenderEvent are)`
This method is responsible for filling a custom defined area on the target rendering device's graphic context.
`void`
`fillOval(OvalRenderEvent ore)`
This method is responsible for filling an oval area on the target rendering device's graphic context.
`void`
`fillPolygon(PolygonRenderEvent pre)`
This method is responsible for filling a polygon on the target rendering device's graphic context.
`void`
`fillRectangle(RectangleRenderEvent rre)`
This method is responsible for filling a rectangle on the target rendering device's graphic context.
`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
`final Locale`
`getLocale()`
Provides the locale to device renderer implementations as needed to retrieve localized resources for presentation.
`String`
`getMimeType()`
Returns the MIME type of the output image that the device renderer creates.
`final 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 cexp)`
Notifies a device renderer to present an exception in its context
`void`
`setChartComputation(IChartComputation cComp)`
Sets the chart computation.
`void`
`setClip(ClipRenderEvent cre)`
This method is responsible for clipping an arbitrary area on the target rendering device's graphic context.
`void`
`setProperty(String sProperty, Object oValue)`
Device-specific write-only properties that may be set for each device renderer

### Methods inherited from class org.eclipse.birt.chart.event.EventObjectCache

`getEventObject`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DeviceAdapter

public DeviceAdapter()

## Method Details

### setProperty

public void setProperty(String sProperty, Object oValue)
Description copied from interface: `IDeviceRenderer`
Device-specific write-only properties that may be set for each device renderer

Specified by:
  `setProperty` in interface `IDeviceRenderer`
Parameters:
  `sProperty` - The property whose value is to be set
  `oValue` - The value associated with the property

### getGraphicsContext

public Object getGraphicsContext()
Description copied from interface: `IDeviceRenderer`
Returns an instance of the low level graphics context being used to render primitives

Specified by:
  `getGraphicsContext` in interface `IDeviceRenderer`
Returns:
  An instance of the low level graphics context being used to render primitives

### getDisplayServer

public IDisplayServer getDisplayServer()
Description copied from interface: `IDeviceRenderer`
Returns an instance of the low level display server capable of providing text metrics, screen resolution, etc.

Specified by:
  `getDisplayServer` in interface `IDeviceRenderer`
Returns:
  An instance of the low level display server capable of providing text metrics, screen resolution, etc.

### getLocale

public final Locale getLocale()
Description copied from interface: `IDeviceRenderer`
Provides the locale to device renderer implementations as needed to retrieve localized resources for presentation.

Specified by:
  `getLocale` in interface `IDeviceRenderer`
Returns:
  The locale to be used

### getULocale

public final com.ibm.icu.util.ULocale getULocale()
Description copied from interface: `IDeviceRenderer`
Provides the locale to device renderer implementations as needed to retrieve localized resources for presentation.

Specified by:
  `getULocale` in interface `IDeviceRenderer`
Returns:
  The locale to be used

### needsStructureDefinition

public boolean needsStructureDefinition()
Description copied from interface: `IDeviceRenderer`
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.

Specified by:
  `needsStructureDefinition` in interface `IDeviceRenderer`
Returns:
  'true' if structure definition notificates are required in the device renderer implementation.

### before

public void before() throws ChartException
Description copied from interface: `IDeviceRenderer`
A notification sent to the device to initialize itself before rendering begins

Specified by:
  `before` in interface `IDeviceRenderer`
Throws:
  `ChartException`

### after

public void after() throws ChartException
Description copied from interface: `IDeviceRenderer`
A notification sent to the device to cleanup after rendering is done

Specified by:
  `after` in interface `IDeviceRenderer`
Throws:
  `ChartException`

### dispose

public void dispose()
Description copied from interface: `IDeviceRenderer`
A notification sent to the device to free all allocated system resources.

Specified by:
  `dispose` in interface `IDeviceRenderer`

### setClip

public void setClip(ClipRenderEvent cre)
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for clipping an arbitrary area on the target rendering device's graphic context.

Specified by:
  `setClip` in interface `IPrimitiveRenderer`
Parameters:
  `cre` - Encapsulated information that defines the area to be clipped

### drawImage

public void drawImage(ImageRenderEvent ire) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for drawing an image on the target rendering device's graphic context.

Specified by:
  `drawImage` in interface `IPrimitiveRenderer`
Parameters:
  `ire` - Encapsulated information that defines a polygon and its attributes
Throws:
  `ChartException`

### drawLine

public void drawLine(LineRenderEvent lre) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for drawing a line on the target rendering device's graphic context.

Specified by:
  `drawLine` in interface `IPrimitiveRenderer`
Parameters:
  `lre` - Encapsulated information that defines a line and its attributes
Throws:
  `ChartException`

### drawRectangle

public void drawRectangle(RectangleRenderEvent rre) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for drawing a rectangle on the target rendering device's graphic context.

Specified by:
  `drawRectangle` in interface `IPrimitiveRenderer`
Parameters:
  `rre` - Encapsulated information that defines a rectangle and its attributes
Throws:
  `ChartException`

### fillRectangle

public void fillRectangle(RectangleRenderEvent rre) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for filling a rectangle on the target rendering device's graphic context.

Specified by:
  `fillRectangle` in interface `IPrimitiveRenderer`
Parameters:
  `rre` - Encapsulated information that defines a rectangle and its attributes
Throws:
  `ChartException`

### drawPolygon

public void drawPolygon(PolygonRenderEvent pre) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for drawing a polygon on the target rendering device's graphic context.

Specified by:
  `drawPolygon` in interface `IPrimitiveRenderer`
Parameters:
  `pre` - Encapsulated information that defines a polygon and its attributes
Throws:
  `ChartException`

### fillPolygon

public void fillPolygon(PolygonRenderEvent pre) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for filling a polygon on the target rendering device's graphic context.

Specified by:
  `fillPolygon` in interface `IPrimitiveRenderer`
Parameters:
  `pre` - Encapsulated information that defines a polygon and its attributes
Throws:
  `ChartException`

### drawArc

public void drawArc(ArcRenderEvent are) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for drawing an elliptical arc on the target rendering device's graphic context.

Specified by:
  `drawArc` in interface `IPrimitiveRenderer`
Parameters:
  `are` - Encapsulated information that defines the arc and its attributes
Throws:
  `ChartException`

### fillArc

public void fillArc(ArcRenderEvent are) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for filling an elliptical arc on the target rendering device's graphic context.

Specified by:
  `fillArc` in interface `IPrimitiveRenderer`
Parameters:
  `are` - Encapsulated information that defines an arc and its attributes
Throws:
  `ChartException`

### enableInteraction

public void enableInteraction(InteractionEvent ie) throws ChartException

Specified by:
  `enableInteraction` in interface `IPrimitiveRenderer`
Parameters:
  `ie` -
Throws:
  `ChartException`

### drawArea

public void drawArea(AreaRenderEvent are) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for drawing a custom defined area on the target rendering device's graphic context.

Specified by:
  `drawArea` in interface `IPrimitiveRenderer`
Parameters:
  `are` - Encapsulated information that defines the area and its attributes
Throws:
  `ChartException`

### fillArea

public void fillArea(AreaRenderEvent are) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for filling a custom defined area on the target rendering device's graphic context.

Specified by:
  `fillArea` in interface `IPrimitiveRenderer`
Parameters:
  `are` - Encapsulated information that defines the area and its attributes
Throws:
  `ChartException`

### drawOval

public void drawOval(OvalRenderEvent ore) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for drawing an oval area on the target rendering device's graphic context.

Specified by:
  `drawOval` in interface `IPrimitiveRenderer`
Parameters:
  `ore` - Encapsulated information that defines the oval and its attributes
Throws:
  `ChartException`

### fillOval

public void fillOval(OvalRenderEvent ore) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is responsible for filling an oval area on the target rendering device's graphic context.

Specified by:
  `fillOval` in interface `IPrimitiveRenderer`
Parameters:
  `ore` - Encapsulated information that defines the oval and its attributes
Throws:
  `ChartException`

### drawText

public void drawText(TextRenderEvent tre) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method renders text on the target rendering device's graphic context using one of the three methods: 1. Renders text (with optional insets, border, fill, etc) with the encapsulating container rectangle's corner or edge aligning against a given point 2. Renders a shadow offset with the encapsulating container rectangle's corner or edge aligning against a given point 3. Renders text (with optional insets, border, fill, etc) with the encapsulating container rectangle's bounding box aligned with a parent block's bounding box

Specified by:
  `drawText` in interface `IPrimitiveRenderer`
Throws:
  `ChartException`

### applyTransformation

public void applyTransformation(TransformationEvent tev) throws ChartException
Description copied from interface: `IPrimitiveRenderer`
This method is capable of applying a global transformation on the device specific graphics context Available transformation types are: SCALE, TRANSLATE, ROTATE

Specified by:
  `applyTransformation` in interface `IPrimitiveRenderer`
Parameters:
  `tev` -
Throws:
  `ChartException`

### changeStructure

public void changeStructure(StructureChangeEvent scev)
Description copied from interface: `IStructureDefinitionListener`
Sends out a notification to a listener indicating that a structure group has changed (either via a start or end) notification.

Specified by:
  `changeStructure` in interface `IStructureDefinitionListener`
Parameters:
  `scev` - Encapsulated information associated with the structure change notification that identifies the source object being changed.

### presentException

public void presentException(Exception cexp)
Description copied from interface: `IDeviceRenderer`
Notifies a device renderer to present an exception in its context

Specified by:
  `presentException` in interface `IDeviceRenderer`
Parameters:
  `cexp` - The exception to be presented

### getMimeType

public String getMimeType()
Description copied from interface: `IDeviceRenderer`
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)

Specified by:
  `getMimeType` in interface `IDeviceRenderer`
Returns:
  the MIME type as a String (e.g. "image/png")

### getChartComputation

public IChartComputation getChartComputation()
Description copied from interface: `IDeviceRenderer`
Returns the chart computation.

Specified by:
  `getChartComputation` in interface `IDeviceRenderer`
Returns:
  IChartComputation

### setChartComputation

public void setChartComputation(IChartComputation cComp)
Description copied from interface: `IDeviceRenderer`
Sets the chart computation.

Specified by:
  `setChartComputation` in interface `IDeviceRenderer`
Parameters:
  `cComp` - IChartComputation