1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package debugTest;
24
25 import javax.swing.JPanel;
26 import javax.swing.JFrame;
27 import java.awt.Dimension;
28 import java.awt.GridBagLayout;
29 import de.desy.acop.displayers.AcopChart;
30 import java.awt.GridBagConstraints;
31 import de.desy.acop.displayers.AcopDialKnob;
32 import de.desy.acop.displayers.AcopGauger;
33 import de.desy.acop.displayers.AcopLabel;
34 import de.desy.acop.displayers.AcopNumberLabel;
35 import de.desy.acop.displayers.AcopSlider;
36 import de.desy.acop.displayers.AcopTable;
37 import de.desy.acop.displayers.AcopWheelswitch;
38 import de.desy.acop.displayers.tools.AcopGraphParameters;
39 import de.desy.acop.transport.ConnectionParameters;
40 import de.desy.acop.transport.AccessMode;
41 import java.awt.Color;
42 import com.cosylab.gui.adapters.ConverterChain;
43 import com.cosylab.gui.adapters.Converter;
44 import com.cosylab.gui.adapters.MultiplierConverter;
45 import com.cosylab.gui.adapters.LogarithmicConverter;
46 import com.cosylab.gui.adapters.PotentialConverter;
47 import com.cosylab.gui.adapters.LinearConverter;
48 import com.cosylab.gui.adapters.IdentityConverter;
49
50 public class AcopBeansTest extends JFrame {
51
52 private static final long serialVersionUID = 1L;
53
54 private JPanel jContentPane = null;
55
56 private AcopChart acopChart = null;
57
58 private AcopDialKnob acopDialKnob = null;
59
60 private AcopGauger acopGauger = null;
61
62 private AcopLabel acopLabel = null;
63
64 private AcopNumberLabel acopNumberLabel = null;
65
66 private AcopSlider acopSlider = null;
67
68 private AcopTable acopTable = null;
69
70 private AcopWheelswitch acopWheelswitch = null;
71
72
73
74
75
76
77 private AcopChart getAcopChart() {
78 if (acopChart == null) {
79 try {
80 acopChart = new AcopChart();
81 acopChart.setMinimumSize(new Dimension(100, 100));
82 acopChart.setMaximumSize(new Dimension(400, 400));
83 acopChart.setDisplayerParameters(new AcopGraphParameters[] {new AcopGraphParameters(new ConnectionParameters("TINE/TEST/JWKSINE/Device 1/Sine", AccessMode.POLL, 1000, -1), new Color(-10027213), 0, 0, 0, 1, false, 100, new ConverterChain(new Converter[] {new MultiplierConverter(2.0), new LogarithmicConverter(2.7199999999999998)})), new AcopGraphParameters(new ConnectionParameters("TINE/TEST/JWKSINE/Device 0/Sine", AccessMode.POLL, 1000, -1), new Color(-16777216), 0, 0, 0, 1, false, 100, new MultiplierConverter(2.0))});
84 acopChart.setYAxisLabel("dva");
85 acopChart.setCaption("TINE/TEST/JWKSINE/Device 1/Sine");
86 acopChart.setName("TINE/TEST/JWKSINE/Device 1/Sine");
87 acopChart.setYFineTicks(14);
88 acopChart.setXScale(8.0D);
89 acopChart.setXMin(1.0D);
90 acopChart.setSecondaryYAxisOn(true);
91 acopChart.setXBestScale(true);
92 acopChart.setYBestScale(true);
93 acopChart.setXShift(7.0D);
94 acopChart.setYShift(9.0D);
95 acopChart.setXTicks(11);
96 acopChart.setSecondaryYTicks(15);
97 acopChart.setYMin(17.0D);
98 acopChart.setXAxisLabel("ena");
99 acopChart.setSecondaryYTickText(false);
100 acopChart.setYScale(10.0D);
101 acopChart.setSecondaryYMax(6.0D);
102 acopChart.setSecondaryYBestScale(true);
103 acopChart.setYMax(18.0D);
104 acopChart.setSecondaryYFineTicks(16);
105 acopChart.setSecondaryYLogOn(true);
106 acopChart.setYTicks(13);
107 acopChart.setXFineTicks(12);
108 acopChart.setSecondaryYAxisLabel("tri");
109 acopChart.setXMax(2.0D);
110 acopChart.setSecondaryYMin(17.0D);
111 acopChart.setCursorMarkerColor(new Color(204, 255, 51));
112 acopChart.setTagging(true);
113 acopChart.setFFT(1);
114 acopChart.setYExtent(3.0D);
115 acopChart.setReuseScreen(true);
116 acopChart.setColorFilled(false);
117 acopChart.setInvert(true);
118 acopChart.setScreenDepth(4);
119 acopChart.setDisplayMode(3);
120 acopChart.setAveragingMode(1);
121 acopChart.setWrapAround(true);
122 acopChart.setRandomData(false);
123 acopChart.setXExtent(2.0D);
124 acopChart.setReuseText(true);
125 acopChart.setFrameRightOffset(6);
126 acopChart.setPrintTextStickyAttribute(1);
127 acopChart.setTextDepth(2);
128 acopChart.setFrameLeftOffset(5);
129 acopChart.setPrintTextLocation(1);
130 acopChart.setFrameTopOffset(3);
131 acopChart.setFrameBottomOffset(4);
132 acopChart.setFrameWidth(1);
133 acopChart.setXGrid(true);
134 acopChart.setYGrid(true);
135 acopChart.setGraphStyle(1);
136 acopChart.setDrawStyle(3);
137 acopChart.setGridWidth(4);
138 acopChart.setDrawWidth(5);
139 acopChart.setGridStyle(3);
140 acopChart.setMarkerWidth(5);
141 acopChart.setLeadingEdgeYExtent(12.0D);
142 acopChart.setLeadingEdgeMode(1);
143 acopChart.setLeadingEdgeStyle(3);
144 acopChart.setMarkerMode(2);
145 acopChart.setMarkerYExtent(11.0D);
146 acopChart.setLeadingEdgeXExtent(9.0D);
147 acopChart.setLeadingEdgeWidth(6);
148 acopChart.setMarkerXExtent(8.0D);
149 acopChart.setMarkerStyle(2);
150 acopChart.setZooming(1);
151 acopChart.setLeadingEdgeGapSize(3);
152 acopChart.setHistogramPosition(2);
153 acopChart.setPreferredSize(new Dimension(300, 300));
154 } catch (java.lang.Throwable e) {
155
156 }
157 }
158 return acopChart;
159 }
160
161
162
163
164
165
166 private AcopDialKnob getAcopDialKnob() {
167 if (acopDialKnob == null) {
168 try {
169 acopDialKnob = new AcopDialKnob();
170 acopDialKnob.setMinimumSize(new Dimension(100, 100));
171 acopDialKnob.setMaximumSize(new Dimension(400, 400));
172 acopDialKnob.setPreferredSize(new Dimension(200, 200));
173 } catch (java.lang.Throwable e) {
174
175 }
176 }
177 return acopDialKnob;
178 }
179
180
181
182
183
184
185 private AcopGauger getAcopGauger() {
186 if (acopGauger == null) {
187 try {
188 acopGauger = new AcopGauger();
189 acopGauger.setMinimumSize(new Dimension(100, 30));
190 acopGauger.setMaximumSize(new Dimension(400, 400));
191 acopGauger.setPreferredSize(new Dimension(200, 50));
192 } catch (java.lang.Throwable e) {
193
194 }
195 }
196 return acopGauger;
197 }
198
199
200
201
202
203
204 private AcopLabel getAcopLabel() {
205 if (acopLabel == null) {
206 try {
207 acopLabel = new AcopLabel();
208 acopLabel.setConnectionParameters(new ConnectionParameters("TINE/TEST/JWKSINE/Device 1/Sine", AccessMode.POLL, 1000, -1));
209 acopLabel.setTitle("TINE/TEST/JWKSINE/Device 0/Sine");
210 } catch (java.lang.Throwable e) {
211
212 }
213 }
214 return acopLabel;
215 }
216
217
218
219
220
221
222 private AcopNumberLabel getAcopNumberLabel() {
223 if (acopNumberLabel == null) {
224 try {
225 acopNumberLabel = new AcopNumberLabel();
226 acopNumberLabel.setConverter(new ConverterChain(new Converter[] {new PotentialConverter(8.0), new PotentialConverter(1.0)}));
227 acopNumberLabel.setMaximum(45.0D);
228 acopNumberLabel.setResizable(false);
229 acopNumberLabel.setTitle("TINE/TEST/JWKSINE/Device 1/Sine");
230 acopNumberLabel.setTitleMinimumFontSize(20);
231 acopNumberLabel.setBoundsVisible(true);
232 acopNumberLabel.setUnits("kh");
233 acopNumberLabel.setConnectionParameters(new ConnectionParameters("TINE/TEST/JWKSINE/Device 1/Sine", AccessMode.POLL, 1000, -1));
234 acopNumberLabel.setArrayIndex(47);
235 acopNumberLabel.setMinimum(-9.0D);
236 } catch (java.lang.Throwable e) {
237
238 }
239 }
240 return acopNumberLabel;
241 }
242
243
244
245
246
247
248 private AcopSlider getAcopSlider() {
249 if (acopSlider == null) {
250 try {
251 acopSlider = new AcopSlider();
252 acopSlider.setConnectionParameters(new ConnectionParameters("TINE/TEST/JWKSINE/Device 0/Amplitude", AccessMode.POLL, 1000, -1));
253 acopSlider.setSmallStep(3.0D);
254 acopSlider.setBitStep(2.0D);
255 acopSlider.setLargeStep(4.0D);
256 acopSlider.setBitStepRelative(false);
257 acopSlider.setArrayIndex(1);
258 acopSlider.setEnabled(false);
259 acopSlider.setConverter(new IdentityConverter());
260 } catch (java.lang.Throwable e) {
261
262 }
263 }
264 return acopSlider;
265 }
266
267
268
269
270
271
272 private AcopTable getAcopTable() {
273 if (acopTable == null) {
274 try {
275 acopTable = new AcopTable();
276 acopTable.setMinimumSize(new Dimension(100, 100));
277 acopTable.setMaximumSize(new Dimension(400, 400));
278 acopTable.setPreferredSize(new Dimension(200, 200));
279 } catch (java.lang.Throwable e) {
280
281 }
282 }
283 return acopTable;
284 }
285
286
287
288
289
290
291 private AcopWheelswitch getAcopWheelswitch() {
292 if (acopWheelswitch == null) {
293 try {
294 acopWheelswitch = new AcopWheelswitch();
295 acopWheelswitch.setConverter(new LinearConverter(2.0, 3.0));
296 acopWheelswitch.setMaximum(20.0D);
297 acopWheelswitch.setTitle("TINE/TEST/JWKSINE/Device 0/Sine");
298 acopWheelswitch.setUnits("1/2.0*null");
299 acopWheelswitch.setConnectionParameters(new ConnectionParameters("TINE/TEST/JWKSINE/Device 0/Amplitude", AccessMode.POLL, 1000, -1));
300 acopWheelswitch.setEnabled(false);
301 acopWheelswitch.setMinimum(-3.0D);
302 } catch (java.lang.Throwable e) {
303
304 }
305 }
306 return acopWheelswitch;
307 }
308
309
310
311
312 public static void main(String[] args) {
313
314
315
316
317
318
319
320
321 }
322
323
324
325
326 public AcopBeansTest() {
327 super();
328 initialize();
329 }
330
331
332
333
334
335
336 private void initialize() {
337 this.setSize(837, 629);
338 this.setContentPane(getJContentPane());
339 this.setTitle("JFrames");
340 }
341
342
343
344
345
346
347 private JPanel getJContentPane() {
348 if (jContentPane == null) {
349 GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
350 gridBagConstraints8.gridx = 1;
351 gridBagConstraints8.gridwidth = 2;
352 gridBagConstraints8.gridy = 2;
353 GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
354 gridBagConstraints7.gridx = 0;
355 gridBagConstraints7.gridy = 2;
356 GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
357 gridBagConstraints6.gridx = 2;
358 gridBagConstraints6.gridy = 1;
359 GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
360 gridBagConstraints5.gridx = 1;
361 gridBagConstraints5.gridy = 1;
362 GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
363 gridBagConstraints4.gridx = 0;
364 gridBagConstraints4.gridy = 1;
365 GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
366 gridBagConstraints2.gridx = 2;
367 gridBagConstraints2.gridy = 0;
368 GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
369 gridBagConstraints1.gridx = 1;
370 gridBagConstraints1.gridy = 0;
371 GridBagConstraints gridBagConstraints = new GridBagConstraints();
372 gridBagConstraints.gridx = 0;
373 gridBagConstraints.fill = GridBagConstraints.BOTH;
374 gridBagConstraints.weightx = 0.0;
375 gridBagConstraints.weighty = 0.0;
376 gridBagConstraints.gridy = 0;
377 jContentPane = new JPanel();
378 jContentPane.setLayout(new GridBagLayout());
379 jContentPane.add(getAcopChart(), gridBagConstraints);
380 jContentPane.add(getAcopDialKnob(), gridBagConstraints1);
381 jContentPane.add(getAcopGauger(), gridBagConstraints2);
382 jContentPane.add(getAcopLabel(), gridBagConstraints4);
383 jContentPane.add(getAcopNumberLabel(), gridBagConstraints5);
384 jContentPane.add(getAcopSlider(), gridBagConstraints6);
385 jContentPane.add(getAcopTable(), gridBagConstraints7);
386 jContentPane.add(getAcopWheelswitch(), gridBagConstraints8);
387 }
388 return jContentPane;
389 }
390
391 }