1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package io.github.tonywasher.joceanus.tethys.core.pane;
18
19 import java.util.ArrayList;
20 import java.util.Iterator;
21 import java.util.List;
22
23 import io.github.tonywasher.joceanus.tethys.api.base.TethysUIComponent;
24 import io.github.tonywasher.joceanus.tethys.api.pane.TethysUIFlowPaneManager;
25 import io.github.tonywasher.joceanus.tethys.core.base.TethysUICoreComponent;
26 import io.github.tonywasher.joceanus.tethys.core.factory.TethysUICoreFactory;
27 import io.github.tonywasher.joceanus.tethys.core.factory.TethysUICoreFactory.TethysUIParentComponent;
28
29
30
31
32 public abstract class TethysUICoreFlowPaneManager
33 extends TethysUICoreComponent
34 implements TethysUIFlowPaneManager, TethysUIParentComponent {
35
36
37
38 private final TethysUICoreFactory<?> theFactory;
39
40
41
42
43 private final Integer theId;
44
45
46
47
48 private final List<TethysUIComponent> theNodeList;
49
50
51
52
53
54
55 protected TethysUICoreFlowPaneManager(final TethysUICoreFactory<?> pFactory) {
56 theFactory = pFactory;
57 theId = theFactory.getNextId();
58 theNodeList = new ArrayList<>();
59 }
60
61 @Override
62 public Integer getId() {
63 return theId;
64 }
65
66 @Override
67 public void addNode(final TethysUIComponent pNode) {
68 theNodeList.add(pNode);
69 theFactory.registerChild(this, pNode);
70 }
71
72 @Override
73 public void setEnabled(final boolean pEnabled) {
74 for (TethysUIComponent myNode : theNodeList) {
75 myNode.setEnabled(pEnabled);
76 }
77 }
78
79 @Override
80 public Iterator<TethysUIComponent> iterator() {
81 return theNodeList.iterator();
82 }
83 }