Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class SlideAnimation

  1. Object
  2. SlideAnimation

The timing of a slide’s builds and the frames of its transitions, as pure functions of progress. SlideShow plays them against the animation clock; a test or a thumbnail strip renders any frame of them deterministically.

A slide’s builds play in steps: each Build.ON_CLICK build starts a step, and the WITH_PREVIOUS and AFTER_PREVIOUS builds after it belong to the same step. Builds before the first click build form step 0, which plays as soon as the slide appears.

Methods

public static int clickSteps(Slide slide)The number of steps a slide’s builds take, not counting the automatic first one when it is empty.
public static int stepDuration(Slide slide, int step)How long a step takes in milliseconds.
public static Map<String, SlideRenderer.ElementState> states(Slide slide, int step, long elapsed)The state of every built element while step is elapsed milliseconds in: the builds of earlier steps are done, later ones not yet started.
public static void paintTransition(Graphics g, SlideRenderer renderer, Presentation p, Slide from, Map<String, SlideRenderer.ElementState> fromStates, Slide to, Map<String, SlideRenderer.ElementState> toStates, int x, int y, float scale, float progress)Paints a frame of the transition into to: the slide leaving is from, which may be null for the first slide.

Inherited methods

Method details

clickSteps

public static int clickSteps(Slide slide)
The number of steps a slide’s builds take, not counting the automatic first one when it is empty.

Parameters

slide Slide
the slide

Returns

the click count to get through every build

stepDuration

public static int stepDuration(Slide slide, int step)
How long a step takes in milliseconds.

Parameters

slide Slide
the slide
step int
the step, 0 for the automatic one

Returns

the duration, 0 for a step with no builds

states

public static Map<String, SlideRenderer.ElementState> states(Slide slide, int step, long elapsed)
The state of every built element while step is elapsed milliseconds in: the builds of earlier steps are done, later ones not yet started.

Parameters

slide Slide
the slide
step int
the step playing
elapsed long
milliseconds into it; a large value shows the step finished

Returns

element states by id, for SlideRenderer.paint

paintTransition

public static void paintTransition(Graphics g, SlideRenderer renderer, Presentation p, Slide from, Map<String, SlideRenderer.ElementState> fromStates, Slide to, Map<String, SlideRenderer.ElementState> toStates, int x, int y, float scale, float progress)
Paints a frame of the transition into to: the slide leaving is from, which may be null for the first slide. Both slides are drawn into a box of w by h pixels at (x, y).

Parameters

g Graphics
the graphics
renderer SlideRenderer
paints the slides
p Presentation
the presentation
from Slide
the slide leaving, or null
fromStates Map<String, SlideRenderer.ElementState>
its element states, or null
to Slide
the slide arriving, whose transition is played
toStates Map<String, SlideRenderer.ElementState>
its element states, or null
x int
left of the slide area in pixels
y int
top of it
scale float
pixels per point
progress float
0 to 1