1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package io.github.tonywasher.joceanus.prometheus.toolkit;
18
19 import io.github.tonywasher.joceanus.gordianknot.api.factory.GordianFactoryType;
20 import io.github.tonywasher.joceanus.gordianknot.api.lock.GordianPasswordLockSpec;
21 import io.github.tonywasher.joceanus.metis.toolkit.MetisToolkit;
22 import io.github.tonywasher.joceanus.oceanus.base.OceanusException;
23 import io.github.tonywasher.joceanus.prometheus.preference.PrometheusPreferenceManager;
24 import io.github.tonywasher.joceanus.prometheus.preference.PrometheusPreferenceSecurity.PrometheusSecurityPreferences;
25 import io.github.tonywasher.joceanus.prometheus.preference.PrometheusPreferenceView;
26 import io.github.tonywasher.joceanus.prometheus.security.PrometheusSecurityGenerator;
27 import io.github.tonywasher.joceanus.prometheus.security.PrometheusSecurityPasswordManager;
28 import io.github.tonywasher.joceanus.tethys.api.base.TethysUIProgram;
29 import io.github.tonywasher.joceanus.tethys.api.factory.TethysUIFactory;
30 import io.github.tonywasher.joceanus.tethys.api.thread.TethysUIThreadManager;
31
32
33
34
35 public class PrometheusToolkit {
36
37
38
39 private final MetisToolkit theToolkit;
40
41
42
43
44 private final PrometheusPreferenceManager thePreferenceManager;
45
46
47
48
49 private final PrometheusSecurityPasswordManager thePasswordMgr;
50
51
52
53
54
55
56
57 public PrometheusToolkit(final TethysUIFactory<?> pFactory) throws OceanusException {
58
59 theToolkit = new MetisToolkit(pFactory, false);
60
61
62 thePreferenceManager = new PrometheusPreferenceManager(theToolkit.getViewerManager());
63 theToolkit.setUpColors(thePreferenceManager);
64
65
66 final PrometheusSecurityPreferences myPreferences = thePreferenceManager.getPreferenceSet(PrometheusSecurityPreferences.class);
67 thePasswordMgr = newPasswordManager(myPreferences.getFactoryType(), myPreferences.getPasswordLockSpec());
68
69
70 final TethysUIThreadManager myThreadMgr = theToolkit.getThreadManager();
71 myThreadMgr.setThreadData(this);
72 }
73
74
75
76
77
78
79 public PrometheusPreferenceManager getPreferenceManager() {
80 return thePreferenceManager;
81 }
82
83
84
85
86
87
88 public PrometheusSecurityPasswordManager getPasswordManager() {
89 return thePasswordMgr;
90 }
91
92
93
94
95
96
97 public TethysUIProgram getProgramDefinitions() {
98 return theToolkit.getProgramDefinitions();
99 }
100
101
102
103
104
105
106 public MetisToolkit getToolkit() {
107 return theToolkit;
108 }
109
110
111
112
113
114
115
116
117
118 private PrometheusSecurityPasswordManager newPasswordManager(final GordianFactoryType pFactoryType,
119 final GordianPasswordLockSpec pLockSpec) throws OceanusException {
120 return PrometheusSecurityGenerator.newPasswordManager(getToolkit().getGuiFactory(), pFactoryType, pLockSpec);
121 }
122
123
124
125
126
127
128 public PrometheusPreferenceView newPreferenceView() {
129 return new PrometheusPreferenceView(getToolkit().getGuiFactory(), thePreferenceManager);
130 }
131 }