123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
-
- import java.util.ArrayList;
- import java.util.List;
-
-
-
- public class Animation {
- List<AFrame> frames = new ArrayList<AFrame>();
- private int lastFrameIndex = 0;
- private String name = "Animation";
-
-
-
- public String getName() {
- return name;
- }
-
-
-
- public void setName(String s) {
- name = s;
- }
-
-
-
- public AFrame get(int i) {
- try {
- return frames.get(i);
- } catch (IndexOutOfBoundsException e) {
- System.out.println(e.toString());
- return null;
- }
- }
-
-
-
- public void set(AFrame f, int i) {
- if (lastFrameIndex <= i) {
- try {
- frames.set(i, f);
- } catch (IndexOutOfBoundsException e) {
- System.out.println(e.toString());
- }
- }
- }
-
-
-
- public void remove(int i) {
- try {
- frames.remove(i);
- } catch (IndexOutOfBoundsException e) {
- System.out.println(e.toString());
- }
- }
-
-
-
- public void add(int i) {
- try {
- frames.add(i, new AFrame());
- lastFrameIndex++;
- } catch (IndexOutOfBoundsException e) {
- System.out.println(e.toString());
- }
- }
-
-
-
- public void add(int i, AFrame f) {
- try {
- frames.add(i, f);
- lastFrameIndex++;
- } catch (IndexOutOfBoundsException e) {
- System.out.println(e.toString());
- }
- }
-
-
-
- public int size() {
- return frames.size();
- }
- }
|