Class SeriesTransition
- All Implemented Interfaces:
Animation
- Direct Known Subclasses:
XYMultiSeriesTransition, XYSeriesTransition, XYValueSeriesTransition
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionSeriesTransition(ChartComponent chart) SeriesTransition(ChartComponent chart, int easing) SeriesTransition(ChartComponent chart, int easing, int duration) -
Method Summary
Modifier and TypeMethodDescriptionbooleananimate()Allows the animation to reduce "repaint" calls when it returns false.voidApplies all pending changes to the chart model and renderer using the current animation settings.protected voidcleanup()Cleans up any settings in the transition.getChart()Gets the ChartComponent that is the subject of the transition.intGets the duration of the transition.intGets the type of easing used in the transition.protected voidInitializes the transition for another iteration.voidDraws the animation, within a component the standard paint method would be invoked since it bares the exact same signature.voidsetChart(ChartComponent chart) Sets the ChartComponent that is the subject of the transition.voidsetDuration(int duration) Sets the duration of the transition in milliseconds.voidsetEasing(int easing) Sets the type of easing used in the transition.protected abstract voidupdate(int progress) Updates the renderer and model at the specified progress position of the animation.voidApplies all pending changes to the chart model and renderer and repaints the chart.
-
Field Details
-
EASING_LINEAR
public static final int EASING_LINEAR- See Also:
-
EASING_IN
public static final int EASING_IN- See Also:
-
EASING_OUT
public static final int EASING_OUT- See Also:
-
EASING_IN_OUT
public static final int EASING_IN_OUT- See Also:
-
-
Constructor Details
-
SeriesTransition
-
SeriesTransition
-
SeriesTransition
-
-
Method Details
-
initTransition
protected void initTransition()Initializes the transition for another iteration. This can be overridden by subclasses to provide their own initialization. This method will be called just prior to the transition taking place. IMPORTANT: Subclasses must make sure to call super.initTransition() so that the animation will be initialized properly. -
cleanup
protected void cleanup()Cleans up any settings in the transition. Called after a transition is complete. This is meant to be overridden by subclasses. -
update
protected abstract void update(int progress) Updates the renderer and model at the specified progress position of the animation. Meant to be overridden by subclasses.
Parameters
progress: The progress of the animation (between 0 and 100).
-
animate
public boolean animate()Description copied from interface:AnimationAllows the animation to reduce "repaint" calls when it returns false. It is called once for every frame. Frames are defined by the
com.codename1.ui.Displayclass.Returns
true if a repaint is desired or false if no repaint is necessary
-
paint
-
getChart
Gets the ChartComponent that is the subject of the transition.
Returns
the chart
-
setChart
Sets the ChartComponent that is the subject of the transition.
Parameters
chart: the chart to set
-
getDuration
public int getDuration()Gets the duration of the transition. (in milliseconds)
Returns
the duration
-
setDuration
public void setDuration(int duration) Sets the duration of the transition in milliseconds.
Parameters
duration: the duration to set
-
getEasing
public int getEasing()Gets the type of easing used in the transition. Should be one of EASING_LINEAR, EASING_IN, EASING_OUT, or EASING_IN_OUT.
Returns
the easing
-
setEasing
public void setEasing(int easing) Sets the type of easing used in the transition. Should be one of EASING_LINEAR, EASING_IN, EASING_OUT, or EASING_IN_OUT.
Parameters
easing: the easing to set
-
animateChart
public void animateChart()Applies all pending changes to the chart model and renderer using the current animation settings. -
updateChart
public void updateChart()Applies all pending changes to the chart model and renderer and repaints the chart. This is basically like calling animateChart() with a duration of 0.
-