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.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
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.
-