Package org.pepstock.charba.client
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 Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static void
checkIfValid(Controller controller)
Checks if key passed as argument is notnull
and its type is valid as well.ControllerType
getType()
Controller must define a unique id in order to be configurable.
Returns the controller id.static boolean
isConsistent(Controller controller, ControllerContext context, IsChart chart)
Returnstrue
if all arguments are consistent.static boolean
isValid(Controller controller)
Returnstrue
if the controller is consistent.default boolean
mustBeRegistered()
Returnsfalse
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.default void
onAfterDraw(ControllerContext context, IsChart chart)
Called after it draws the representation of the data set.default void
onAfterInitialize(ControllerContext context, IsChart chart)
Called after it initializes the controller.default void
onAfterLinkScales(ControllerContext context, IsChart chart)
Called after it ensures that the data set represented by this controller is linked to a scale.default void
onAfterParse(ControllerContext context, IsChart chart, int start, int count)
Called after it invokes to parse the data into the controller meta data.default void
onAfterUpdate(ControllerContext context, IsChart chart, TransitionKey mode)
Called after it updates the elements in response to new data.default void
onBeforeDraw(ControllerContext context, IsChart chart)
Called before it draws the representation of the data set.default void
onBeforeInitialize(ControllerContext context, IsChart chart)
Called before it initializes the controller.default void
onBeforeLinkScales(ControllerContext context, IsChart chart)
Called before it ensures that the data set represented by this controller is linked to a scale.default void
onBeforeParse(ControllerContext context, IsChart chart, int start, int count)
Called before it invokes to parse the data into the controller meta data.default void
onBeforeUpdate(ControllerContext context, IsChart chart, TransitionKey mode)
Called before it updates the elements in response to new data.
-
-
-
Method Detail
-
isConsistent
static boolean isConsistent(Controller controller, ControllerContext context, IsChart chart)
Returnstrue
if all arguments are consistent.- Parameters:
controller
- controller instance to checkcontext
- 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 notnull
and its type is valid as well. If not, throw aIllegalArgumentException
.- Parameters:
controller
- controller instance to check
-
isValid
static boolean isValid(Controller controller)
Returnstrue
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()
Returnsfalse
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 controllerchart
- chart instance
-
onAfterInitialize
default void onAfterInitialize(ControllerContext context, IsChart chart)
Called after it initializes the controller.- Parameters:
context
- context of controllerchart
- 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 controllerchart
- chart instancestart
- start index of metadatacount
- 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 controllerchart
- chart instancestart
- start index of metadatacount
- 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 controllerchart
- chart instance
-
onAfterDraw
default void onAfterDraw(ControllerContext context, IsChart chart)
Called after it draws the representation of the data set.- Parameters:
context
- context of controllerchart
- chart instance
-
onBeforeUpdate
default void onBeforeUpdate(ControllerContext context, IsChart chart, TransitionKey mode)
Called before it updates the elements in response to new data.- Parameters:
context
- context of controllerchart
- chart instancemode
- update mode
-
onAfterUpdate
default void onAfterUpdate(ControllerContext context, IsChart chart, TransitionKey mode)
Called after it updates the elements in response to new data.- Parameters:
context
- context of controllerchart
- chart instancemode
- 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 controllerchart
- 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 controllerchart
- chart instance
-
-