public interface Controller
Modifier and Type | Method and Description |
---|---|
static void |
checkIfValid(Controller controller)
Checks if key passed as argument is not
null 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)
Returns
true if all arguments are consistent. |
static boolean |
isValid(Controller controller)
Returns
true if the controller is consistent. |
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. |
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.
|
static boolean isConsistent(Controller controller, ControllerContext context, IsChart chart)
true
if all arguments are consistent.controller
- controller instance to checkcontext
- controller context instance, should be provided by CHART.JS.chart
- chart instancetrue
if all arguments are consistentstatic void checkIfValid(Controller controller)
null
and its type is valid as well. If not, throw a IllegalArgumentException
.controller
- controller instance to checkstatic boolean isValid(Controller controller)
true
if the controller is consistent.controller
- controller instance to checktrue
if the controller is consistentControllerType getType()
default boolean mustBeRegistered()
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.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 transformeddefault void onBeforeInitialize(ControllerContext context, IsChart chart)
context
- context of controllerchart
- chart instancedefault void onAfterInitialize(ControllerContext context, IsChart chart)
context
- context of controllerchart
- chart instancedefault void onBeforeParse(ControllerContext context, IsChart chart, int start, int count)
context
- context of controllerchart
- chart instancestart
- start index of metadatacount
- count of metadatadefault void onAfterParse(ControllerContext context, IsChart chart, int start, int count)
context
- context of controllerchart
- chart instancestart
- start index of metadatacount
- count of metadatadefault void onBeforeDraw(ControllerContext context, IsChart chart)
context
- context of controllerchart
- chart instancedefault void onAfterDraw(ControllerContext context, IsChart chart)
context
- context of controllerchart
- chart instancedefault void onBeforeUpdate(ControllerContext context, IsChart chart, TransitionKey mode)
context
- context of controllerchart
- chart instancemode
- update modedefault void onAfterUpdate(ControllerContext context, IsChart chart, TransitionKey mode)
context
- context of controllerchart
- chart instancemode
- update modedefault void onBeforeLinkScales(ControllerContext context, IsChart chart)
context
- context of controllerchart
- chart instancedefault void onAfterLinkScales(ControllerContext context, IsChart chart)
context
- context of controllerchart
- chart instance