Package com.microej.wear.components

## Interface Renderable

-     public interface Renderable

  Represents a UI that can be rendered on a graphics context and that can be shown on the display.

  The methods of a renderable are called in the following order:

  1. one call to `onAttached()`
  2. any number of calls to `render(ej.microui.display.GraphicsContext)`
  3. one optional call to `showOnDisplay()`
  4. one call to `onDetached()`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `onAttached()` | Called when this instance is scheduled for imminent rendering.
    `void` | `onDetached()` | Called when this instance is no longer scheduled for imminent rendering.
    `void` | `render​(GraphicsContext g)` | Renders this instance on the given graphics context.
    `void` | `showOnDisplay()` | Shows this instance on the display.

- - ### Method Detail

    - #### onAttached

          void onAttached()

      Called when this instance is scheduled for imminent rendering.

      For example, this method can load the resources necessary for rendering.

    - #### onDetached

          void onDetached()

      Called when this instance is no longer scheduled for imminent rendering.

      For example, this method can dispose of the resources loaded in `onAttached()`.

    - #### render

          void render​(GraphicsContext g)

      Renders this instance on the given graphics context.

      This method applies the translation and clip set in the given graphics context (it should not reset the translation and clip before drawing).

      Parameters:
        `g` - the graphics context to draw with.

    - #### showOnDisplay

          void showOnDisplay()

      Shows this instance on the display.

      Once the displayable is shown on the display, it can start animations and handle events. Once it is hidden (due to an other displayable being shown), it can stop the started animations and dispose of the resources loaded in `onAttached()`.