com.orsoncharts

## Class OnDrawHandler

- java.lang.Object
- - com.orsoncharts.OnDrawHandler

- All Implemented Interfaces:
    TableElementOnDraw

      public class OnDrawHandler
      extends java.lang.Object
      implements TableElementOnDraw

  An 'onDraw' handler that handles two aspects related to chart interactivity: (1) it adds a `RenderedElement` instance to the `RenderingInfo` for each element in the chart that requires it, and (2) it adds element hinting to the `Graphics2D` output (how this is handled by the `Graphics2D` instance is implementation dependent).
  Since:
    1.3

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OnDrawHandler(RenderingInfo info, boolean elementHinting)` Creates a new handler.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterDraw(TableElement element, java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds)` A callback method that is called after an element is drawn.
    `void` | `beforeDraw(TableElement element, java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds)` A callback method that is called before an element is drawn.

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

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

- - ### Constructor Detail

    - #### OnDrawHandler

          public OnDrawHandler(RenderingInfo info,
                               boolean elementHinting)

      Creates a new handler.
      Parameters:
        `info` - the rendering info to be populated (`null` permitted).
        `elementHinting` - a flag that controls whether or not element hinting is performed.

  - ### Method Detail

    - #### beforeDraw

          public void beforeDraw(TableElement element,
                                 java.awt.Graphics2D g2,
                                 java.awt.geom.Rectangle2D bounds)

      Description copied from interface: `TableElementOnDraw`
      A callback method that is called before an element is drawn.
      Specified by:
        `beforeDraw` in interface `TableElementOnDraw`
      Parameters:
        `element` - the element (`null` not permitted).
        `g2` - the graphics target (`null` not permitted).
        `bounds` - the bounds (`null` not permitted).

    - #### afterDraw

          public void afterDraw(TableElement element,
                                java.awt.Graphics2D g2,
                                java.awt.geom.Rectangle2D bounds)

      Description copied from interface: `TableElementOnDraw`
      A callback method that is called after an element is drawn.
      Specified by:
        `afterDraw` in interface `TableElementOnDraw`
      Parameters:
        `element` - the element (`null` not permitted).
        `g2` - the graphics target (`null` not permitted).
        `bounds` - the bounds (`null` not permitted).