Class 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.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intclickSteps(Slide slide) The number of steps a slide's builds take, not counting the automatic first one when it is empty.static voidpaintTransition(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 intoto: the slide leaving isfrom, which may be null for the first slide.static Map<String, SlideRenderer.ElementState> The state of every built element whilestepiselapsedmilliseconds in: the builds of earlier steps are done, later ones not yet started.static intstepDuration(Slide slide, int step) How long a step takes in milliseconds.
-
Method Details
-
clickSteps
The number of steps a slide's builds take, not counting the automatic first one when it is empty.
Parameters
slide: the slide
Returns
the click count to get through every build
-
stepDuration
How long a step takes in milliseconds.
Parameters
-
slide: the slide -
step: the step, 0 for the automatic one
Returns
the duration, 0 for a step with no builds
-
-
states
The state of every built element while
stepiselapsedmilliseconds in: the builds of earlier steps are done, later ones not yet started.Parameters
-
slide: the slide -
step: the step playing -
elapsed: 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 isfrom, which may be null for the first slide. Both slides are drawn into a box ofwbyhpixels at (x,y).Parameters
-
g: the graphics -
renderer: paints the slides -
p: the presentation -
from: the slide leaving, or null -
fromStates: its element states, or null -
to: the slide arriving, whose transition is played -
toStates: its element states, or null -
x: left of the slide area in pixels -
y: top of it -
scale: pixels per point -
progress: 0 to 1
-
-