IMG
- The image type to be used for the FlipBookBuilder
.public interface FlipBookBuilder<IMG>
extends org.refcodes.component.LifeCycleComponent.UncheckedLifeCycleComponent, org.refcodes.component.Ceasable.UncheckedCeasable
FlipBookBuilder
defines a sequence of images (animation) to be
flipped through (as of an old fashioned flip-book). The
FlipBookBuilder
supports different phases initiated by the according
life-cycle phases:
INITIALIZE THE SEQUENCE:
Initializable.initialize()
: Reset the FlipBookBuilder
to start the
animation over again with the start-up sequence. The start-up sequence is
displayed just once to commence the main-loop sequence. Note: The
FlipBookBuilder
animation is not yet started, just prepared to begin
with the start-up sequence!
START THE SEQUENCE:
Startable.start()
: Starts the FlipBookBuilder
animation. In case there
is a start-up sequence, that sequence is flipped through till the end
followed by the main-loop sequence which is being repeated until instructed
differently (via Stoppable.stop()
, Pausable.pause()
or Destroyable.destroy()
).
PAUSE THE SEQUENCE:
Pausable.pause()
: Pauses the animation just where it is currently (to be
resumed later with Resumable.resume()
).
RESUME THE SEQUENCE:
Resumable.resume()
: Resumes a paused (Pausable.pause()
) the animation to
continue just where it has been paused.
STOP THE SEQUENCE:
Stoppable.stop()
: Stops the animation sequence at the beginning of the
main-loop. The animation continues till the beginning main loop reached its
sequence's end, then it stops.
CEASE THE SEQUENCE:
Ceasable.UncheckedCeasable.cease()
: In case you want to fade out your sequence or let it end
with an explosion, you may invoke the Ceasable.UncheckedCeasable.cease()
method. The animation
should be initialized (Initializable.initialize()
) in order to begin with the
start-up sequence again.org.refcodes.component.LifeCycleComponent.LifeCycleAutomaton, org.refcodes.component.LifeCycleComponent.UncheckedLifeCycleComponent
org.refcodes.component.Destroyable.DestroyAutomaton
org.refcodes.component.Initializable.InitializeAutomaton, org.refcodes.component.Initializable.InitializeBuilder<B extends org.refcodes.component.Initializable.InitializeBuilder<B>>, org.refcodes.component.Initializable.UncheckedInitializable
org.refcodes.component.Startable.StartAutomaton, org.refcodes.component.Startable.StartBuilder<B extends org.refcodes.component.Startable.StartBuilder<B>>, org.refcodes.component.Startable.UncheckedStartable
org.refcodes.component.Pausable.PauseAutomaton, org.refcodes.component.Pausable.PauseBuilder<B extends org.refcodes.component.Pausable.PauseBuilder<B>>, org.refcodes.component.Pausable.UncheckedPausable
org.refcodes.component.Resumable.ResumeAutomaton, org.refcodes.component.Resumable.ResumeBuilder<B extends org.refcodes.component.Resumable.ResumeBuilder<B>>, org.refcodes.component.Resumable.UncheckedResumable
Modifier and Type | Method and Description |
---|---|
void |
addCeaseImage(IMG aImage)
Adds an image to the cease sequence.
|
default void |
addCeaseSequence(IMG... aImages)
Adds a sequence of images to the cease sequence.
|
void |
addMainLoopImage(IMG aImage)
Adds an image to the main-loop sequence.
|
default void |
addMainLoopSequence(IMG... aImages)
Adds a sequence of images to the main-loop sequence.
|
void |
addStartUpImage(IMG aImage)
Adds an image to the start-up sequence.
|
default void |
addStartUpSequence(IMG... aImages)
Adds a sequence of images to the start-up sequence.
|
int |
getImageDurationInMs()
Gets the duration of a single image to be displayed until the next image
is shown.
|
int |
getStartUpDelayInMs()
Gets the start-up delay of the animation before it is started.
|
void |
setImageDurationInMs(int aDurationInMs)
Sets the duration of a single image to be displayed until the next image
is shown.
|
void |
setStartUpDelayInMs(int aStartUpDelayInMs)
Sets the start-up delay of the animation before it is started.
|
default FlipBookBuilder<IMG> |
withCeaseImage(IMG aImage)
Adds an image to the cease sequence.
|
default FlipBookBuilder<IMG> |
withCeaseSequence(IMG... aImages)
Adds a sequence of images to the cease sequence.
|
default FlipBookBuilder<IMG> |
withImageDurationInMs(int aDurationInMs)
Sets the duration of a single image to be displayed until the next image
is shown.
|
default FlipBookBuilder<IMG> |
withMainLoopImage(IMG aImage)
Adds an image to the main-loop sequence.
|
default FlipBookBuilder<IMG> |
withMainLoopSequence(IMG... aImages)
Adds a sequence of images to the main-loop sequence.
|
default FlipBookBuilder<IMG> |
withStartUpDelayInMs(int aStartUpDelayInMs)
Sets the start-up delay of the animation before it is started.
|
default FlipBookBuilder<IMG> |
withStartUpImage(IMG aImage)
Adds an image to the start-up sequence.
|
default FlipBookBuilder<IMG> |
withStartUpSequence(IMG... aImages)
Adds a sequence of images to the start-up sequence.
|
void addStartUpImage(IMG aImage)
aImage
- The image to be added to the end of the start-up sequence.default FlipBookBuilder<IMG> withStartUpImage(IMG aImage)
aImage
- The image to be added to the end of the start-up sequence.FlipBookBuilder
as of the Builder-Pattern.default void addStartUpSequence(IMG... aImages)
aImages
- The images to be added to the end of the start-up
sequence.default FlipBookBuilder<IMG> withStartUpSequence(IMG... aImages)
aImages
- The images to be added to the end of the start-up
sequence.FlipBookBuilder
as of the Builder-Pattern.void addMainLoopImage(IMG aImage)
aImage
- The image to be added to the end of the main-loop sequence.default FlipBookBuilder<IMG> withMainLoopImage(IMG aImage)
aImage
- The image to be added to the end of the main-loop sequence.FlipBookBuilder
as of the Builder-Pattern.default void addMainLoopSequence(IMG... aImages)
aImages
- The images to be added to the end of the main-loop
sequence.default FlipBookBuilder<IMG> withMainLoopSequence(IMG... aImages)
aImages
- The images to be added to the end of the main-loop
sequence.FlipBookBuilder
as of the Builder-Pattern.void addCeaseImage(IMG aImage)
aImage
- The image to be added to the end of the cease sequence.default FlipBookBuilder<IMG> withCeaseImage(IMG aImage)
aImage
- The image to be added to the end of the cease sequence.FlipBookBuilder
as of the Builder-Pattern.default void addCeaseSequence(IMG... aImages)
aImages
- The images to be added to the end of the cease sequence.default FlipBookBuilder<IMG> withCeaseSequence(IMG... aImages)
aImages
- The images to be added to the end of the cease sequence.FlipBookBuilder
as of the Builder-Pattern.void setImageDurationInMs(int aDurationInMs)
aDurationInMs
- The duration in milliseconds.int getImageDurationInMs()
default FlipBookBuilder<IMG> withImageDurationInMs(int aDurationInMs)
aDurationInMs
- The duration in milliseconds.FlipBookBuilder
as of the Builder-Pattern.void setStartUpDelayInMs(int aStartUpDelayInMs)
aStartUpDelayInMs
- The start-up delay in milliseconds.int getStartUpDelayInMs()
default FlipBookBuilder<IMG> withStartUpDelayInMs(int aStartUpDelayInMs)
aStartUpDelayInMs
- The start-up delay in milliseconds.FlipBookBuilder
as of the Builder-Pattern.Copyright © 2018. All rights reserved.