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

        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