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 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:
    • FORMAT_IDENTIFIER

      static final String FORMAT_IDENTIFIER
      A property name that identifies an output format identifier
      See Also:
    • GRAPHICS_CONTEXT

      static final String GRAPHICS_CONTEXT
      A property name that identifies a device-specific graphics context
      See Also:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
  • 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