-
Notifications
You must be signed in to change notification settings - Fork 8
/
CustomTextAnimation.java
45 lines (37 loc) · 1.06 KB
/
CustomTextAnimation.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package de.pxav.kelp.core.animation;
import java.util.Arrays;
import java.util.List;
/**
* This animation allows you to create custom text animations
* which are independent from the existing algorithms.
*
* If you don't like the animation templates you can use this
* to create your own.
*
* You can also create own animation algorithms if you want
* by simply creating a new class which implements
* {@code TextAnimation} and takes a text input to process.
*
* @author pxav
* @see TextAnimation
*/
public class CustomTextAnimation implements TextAnimation {
private List<String> states;
public CustomTextAnimation() {}
public static CustomTextAnimation create() {
return new CustomTextAnimation();
}
public CustomTextAnimation addStates(String... states) {
this.states.addAll(Arrays.asList(states));
return this;
}
public CustomTextAnimation setStates(String... states) {
this.states.clear();
this.states.addAll(Arrays.asList(states));
return this;
}
@Override
public List<String> states() {
return this.states;
}
}