30 |
import java.util.*; |
import java.util.*; |
31 |
|
|
32 |
/** A vob that contains a list of other vobs. |
/** A vob that contains a list of other vobs. |
33 |
|
* The vobs are all rendered with the same |
34 |
|
* RenderTraversal settings, i.e. transform, |
35 |
|
* color etc. |
36 |
*/ |
*/ |
37 |
public class Group implements Vob { |
public class Group implements Sequence { |
38 |
|
|
39 |
protected final List content = new ArrayList(); |
protected final List content = new ArrayList(); |
40 |
protected int size = 1; |
protected int size = 1; |
41 |
|
|
42 |
|
public Sequence cloneEmpty() { |
43 |
|
return new Group(); |
44 |
|
} |
45 |
|
|
46 |
public int add(Vob v) { |
public int add(Vob v) { |
47 |
content.add(v); |
content.add(v); |
48 |
int index = size; |
int index = size; |
50 |
return index; |
return index; |
51 |
} |
} |
52 |
|
|
53 |
public void close() { |
public float getSize(Axis axis) { |
54 |
|
float size = 0; |
55 |
|
for(Iterator i=content.iterator(); i.hasNext();) { |
56 |
|
float s = ((Vob)i.next()).getSize(axis); |
57 |
|
if(s > size) size = s; |
58 |
|
} |
59 |
|
return size; |
60 |
|
} |
61 |
|
|
62 |
|
public Sequence close() { |
63 |
|
return this; |
64 |
} |
} |
65 |
|
|
66 |
public int getCount() { |
public int getCount() { |