public abstract class SeriesTransition extends Object implements Animation
Modifier and Type | Field and Description |
---|---|
static int |
EASING_IN |
static int |
EASING_IN_OUT |
static int |
EASING_LINEAR |
static int |
EASING_OUT |
Constructor and Description |
---|
SeriesTransition(ChartComponent chart) |
SeriesTransition(ChartComponent chart,
int easing) |
SeriesTransition(ChartComponent chart,
int easing,
int duration) |
Modifier and Type | Method and Description |
---|---|
boolean |
animate()
Allows the animation to reduce "repaint" calls when it returns false.
|
void |
animateChart()
Applies all pending changes to the chart model and renderer using the
current animation settings.
|
protected void |
cleanup()
Cleans up any settings in the transition.
|
ChartComponent |
getChart()
Gets the ChartComponent that is the subject of the transition.
|
int |
getDuration()
Gets the duration of the transition.
|
int |
getEasing()
Gets the type of easing used in the transition.
|
protected void |
initTransition()
Initializes the transition for another iteration.
|
void |
paint(Graphics g)
Draws the animation, within a component the standard paint method would be
invoked since it bares the exact same signature.
|
void |
setChart(ChartComponent chart)
Sets the ChartComponent that is the subject of the transition.
|
void |
setDuration(int duration)
Sets the duration of the transition in milliseconds.
|
void |
setEasing(int easing)
Sets the type of easing used in the transition.
|
protected abstract void |
update(int progress)
Updates the renderer and model at the specified progress position of
the animation.
|
void |
updateChart()
Applies all pending changes to the chart model and renderer and repaints
the chart.
|
public static final int EASING_LINEAR
public static final int EASING_IN
public static final int EASING_OUT
public static final int EASING_IN_OUT
public SeriesTransition(ChartComponent chart)
public SeriesTransition(ChartComponent chart, int easing)
public SeriesTransition(ChartComponent chart, int easing, int duration)
protected void initTransition()
protected void cleanup()
protected abstract void update(int progress)
progress
- The progress of the animation (between 0 and 100).public boolean animate()
Animation
Display
class.public void paint(Graphics g)
Animation
public ChartComponent getChart()
public void setChart(ChartComponent chart)
chart
- the chart to setpublic int getDuration()
public void setDuration(int duration)
duration
- the duration to setpublic int getEasing()
public void setEasing(int easing)
easing
- the easing to setpublic void animateChart()
public void updateChart()