Interface Controller

  • All Known Implementing Classes:
    AbstractController

    public interface Controller
    This interface enables the capability to create a custom chart.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • isConsistent

        static boolean isConsistent​(Controller controller,
                                    ControllerContext context,
                                    IsChart chart)
        Returns true if all arguments are consistent.
        Parameters:
        controller - controller instance to check
        context - controller context instance, should be provided by CHART.JS.
        chart - chart instance
        Returns:
        true if all arguments are consistent
      • checkIfValid

        static void checkIfValid​(Controller controller)
        Checks if key passed as argument is not null and its type is valid as well. If not, throw a IllegalArgumentException.
        Parameters:
        controller - controller instance to check
      • isValid

        static boolean isValid​(Controller controller)
        Returns true if the controller is consistent.
        Parameters:
        controller - controller instance to check
        Returns:
        true if the controller is consistent
      • getType

        ControllerType getType()
        Controller must define a unique id in order to be configurable.
        Returns the controller id.
        Returns:
        the controller id.
      • mustBeRegistered

        default boolean mustBeRegistered()
        Returns false if the controller does not have to be registered because is a OUT-OF-THE-BOX controller (in javascript) and does not have to be transformed.
        Returns:
        false if the controller does not have to be registered because is a OUT-OF-THE-BOX controller (in javascript) and does not have to be transformed
      • onBeforeInitialize

        default void onBeforeInitialize​(ControllerContext context,
                                        IsChart chart)
        Called before it initializes the controller.
        Parameters:
        context - context of controller
        chart - chart instance
      • onAfterInitialize

        default void onAfterInitialize​(ControllerContext context,
                                       IsChart chart)
        Called after it initializes the controller.
        Parameters:
        context - context of controller
        chart - chart instance
      • onBeforeParse

        default void onBeforeParse​(ControllerContext context,
                                   IsChart chart,
                                   int start,
                                   int count)
        Called before it invokes to parse the data into the controller meta data.
        Parameters:
        context - context of controller
        chart - chart instance
        start - start index of metadata
        count - count of metadata
      • onAfterParse

        default void onAfterParse​(ControllerContext context,
                                  IsChart chart,
                                  int start,
                                  int count)
        Called after it invokes to parse the data into the controller meta data.
        Parameters:
        context - context of controller
        chart - chart instance
        start - start index of metadata
        count - count of metadata
      • onBeforeDraw

        default void onBeforeDraw​(ControllerContext context,
                                  IsChart chart)
        Called before it draws the representation of the data set.
        Parameters:
        context - context of controller
        chart - chart instance
      • onAfterDraw

        default void onAfterDraw​(ControllerContext context,
                                 IsChart chart)
        Called after it draws the representation of the data set.
        Parameters:
        context - context of controller
        chart - chart instance
      • onBeforeUpdate

        default void onBeforeUpdate​(ControllerContext context,
                                    IsChart chart,
                                    TransitionMode mode)
        Called before it updates the elements in response to new data.
        Parameters:
        context - context of controller
        chart - chart instance
        mode - update mode
      • onAfterUpdate

        default void onAfterUpdate​(ControllerContext context,
                                   IsChart chart,
                                   TransitionMode mode)
        Called after it updates the elements in response to new data.
        Parameters:
        context - context of controller
        chart - chart instance
        mode - update mode
      • onBeforeLinkScales

        default void onBeforeLinkScales​(ControllerContext context,
                                        IsChart chart)
        Called before it ensures that the data set represented by this controller is linked to a scale.
        Parameters:
        context - context of controller
        chart - chart instance
      • onAfterLinkScales

        default void onAfterLinkScales​(ControllerContext context,
                                       IsChart chart)
        Called after it ensures that the data set represented by this controller is linked to a scale.
        Parameters:
        context - context of controller
        chart - chart instance