Interface ComplicationDataSource


  • public interface ComplicationDataSource
    Represents a source of data that can be displayed on a watchface complication.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      float getProgress()
      Returns the progress.
      java.lang.String getText()
      Returns the text.
      boolean hasIcon()
      Returns whether this source provides an icon.
      boolean hasProgress()
      Returns whether this source provides a progress.
      boolean hasText()
      Returns whether this source provides a text.
      void renderIcon​(ej.microui.display.GraphicsContext g, int x, int y, int width, int height)
      Renders the icon.
    • Method Detail

      • hasText

        boolean hasText()
        Returns whether this source provides a text.
        Returns:
        whether this source provides a text.
      • hasIcon

        boolean hasIcon()
        Returns whether this source provides an icon.
        Returns:
        whether this source provides an icon.
      • hasProgress

        boolean hasProgress()
        Returns whether this source provides a progress.
        Returns:
        whether this source provides a progress.
      • getText

        java.lang.String getText()
        Returns the text.
        Returns:
        the text.
        Throws:
        java.lang.IllegalStateException - if this source does not provide a text.
      • renderIcon

        void renderIcon​(ej.microui.display.GraphicsContext g,
                        int x,
                        int y,
                        int width,
                        int height)
        Renders the icon.
        Parameters:
        g - the graphics context to draw with.
        x - the x coordinate of the region to draw in.
        y - the y coordinate of the region to draw in.
        width - the width of the region to draw in.
        height - the height of the region to draw in.
        Throws:
        java.lang.IllegalStateException - if this source does not provide an icon.
      • getProgress

        float getProgress()
        Returns the progress.
        Returns:
        the progress (between 0.0f and 1.0f).
        Throws:
        java.lang.IllegalStateException - if this source does not provide a progress.