01: package org.openwfe.gpe.model;
02:
03: import java.util.ArrayList;
04: import java.util.List;
05:
06: /**
07: * @author christelle
08: */
09: public class CompositeOrOneChild extends FlowElement {
10:
11: protected List children = new ArrayList();
12:
13: public CompositeOrOneChild() {
14: }
15:
16: /**
17: * @param figure
18: */
19:
20: public void addChild(FlowElement child) {
21: addChild(child, -1);
22: }
23:
24: public void addChild(FlowElement child, int index) {
25: if (index >= 0)
26: children.add(index, child);
27: else
28: children.add(child);
29: fireStructureChange(CHILDREN, child);
30: }
31:
32: public List getChildren() {
33: return children;
34: }
35:
36: public void removeChild(FlowElement child) {
37: children.remove(child);
38: fireStructureChange(CHILDREN, child);
39: }
40:
41: }
|