Package org.pepstock.charba.client
Interface Controller
-
- All Known Implementing Classes:
AbstractController
public interface ControllerThis 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 voidcheckIfValid(Controller controller)Checks if key passed as argument is notnulland its type is valid as well.ControllerTypegetType()Controller must define a unique id in order to be configurable.
Returns the controller id.static booleanisConsistent(Controller controller, ControllerContext context, IsChart chart)Returnstrueif all arguments are consistent.static booleanisValid(Controller controller)Returnstrueif the controller is consistent.default booleanmustBeRegistered()Returnsfalseif 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 voidonAfterDraw(ControllerContext context, IsChart chart)Called after it draws the representation of the data set.default voidonAfterInitialize(ControllerContext context, IsChart chart)Called after it initializes the controller.default voidonAfterLinkScales(ControllerContext context, IsChart chart)Called after it ensures that the data set represented by this controller is linked to a scale.default voidonAfterParse(ControllerContext context, IsChart chart, int start, int count)Called after it invokes to parse the data into the controller meta data.default voidonAfterUpdate(ControllerContext context, IsChart chart, TransitionKey mode)Called after it updates the elements in response to new data.default voidonBeforeDraw(ControllerContext context, IsChart chart)Called before it draws the representation of the data set.default voidonBeforeInitialize(ControllerContext context, IsChart chart)Called before it initializes the controller.default voidonBeforeLinkScales(ControllerContext context, IsChart chart)Called before it ensures that the data set represented by this controller is linked to a scale.default voidonBeforeParse(ControllerContext context, IsChart chart, int start, int count)Called before it invokes to parse the data into the controller meta data.default voidonBeforeUpdate(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)
Returnstrueif all arguments are consistent.- Parameters:
controller- controller instance to checkcontext- controller context instance, should be provided by CHART.JS.chart- chart instance- Returns:
trueif all arguments are consistent
-
checkIfValid
static void checkIfValid(Controller controller)
Checks if key passed as argument is notnulland its type is valid as well. If not, throw aIllegalArgumentException.- Parameters:
controller- controller instance to check
-
isValid
static boolean isValid(Controller controller)
Returnstrueif the controller is consistent.- Parameters:
controller- controller instance to check- Returns:
trueif 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()
Returnsfalseif 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:
falseif 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
-
-