1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package de.desy.acop.chart;
24 import java.awt.BasicStroke;
25 import java.text.DecimalFormat;
26
27 public class AcopConst
28 {
29 protected static DecimalFormat textFormat = new DecimalFormat("#0.0000");
30 protected static int max_points = 524288;
31 protected static double zero_check = 1.0e-30;
32
33 protected static int N_TIME = 6;
34 protected static int timeMax[] = {100, 100, 100, 100, 20, 68},
35 timeScale[] = {1, 60, 3600, 86400, 2592000, 31536000};
36 protected static java.lang.String[] timeStr = {"Seconds", "Minutes", "Hours", "Days", "Months", "Years"};
37
38 public static int MAX_DISPLAY = 100;
39 protected static int MAX_TEXT = 100;
40 public static int N_DEF_DISPLAY = 20;
41 protected static int TEXT_MOVE = 3;
42 protected static int lengthZoom = 20;
43 protected static int MAX_BACKGROUND_REGION = 16;
44 protected static int MAX_AXIS = 2;
45
46 protected static int NEW_PRINT_WINDOW = 4;
47 protected static int NEW_TEXT_WINDOW = 3;
48 protected static int NEW_ZOOM_WINDOW = 2;
49 protected static int NEW_MOVE_WINDOW = 1;
50
51 protected static int FFT_SPEKTRUM = 0x1;
52 protected static int FFT_PHASE = 0x2;
53 protected static int FFT_SP = 0x3;
54 protected static int FFT_RI = 0x4;
55 protected static int FFT_REAL = 0x5;
56 protected static int FFT_IMAGINARY = 0x6;
57 protected static int FFT_RI_INVERSE = 0x7;
58
59 public static int PS_SOLID = 0,
60 PS_DASH = 1,
61 PS_DOT = 2,
62 PS_DASH_DOT = 3;
63
64 public static int mode_polyline = 0,
65 mode_barline = 1,
66 mode_histogram = 2,
67 mode_dots = 3,
68 mode_histogram_rastoring = 4,
69 mode_rectangle = 5,
70 mode_circle = 6,
71 mode_textbox = 7,
72 mode_polyline_dots = 8,
73 mode_barline_dots = 9,
74 mode_histogram_dots = 10,
75 mode_histogram_rastoring_dots = 11,
76 mode_barline_histo = 12,
77 mode_barline_histo_dots = 13;
78
79 protected static double log_check(double x)
80 {
81 if ( x < 1.0e-18 ) x = 1.0e-19;
82 return x;
83 }
84
85 protected static BasicStroke createStroke(float penWidth, int penStyle)
86 { BasicStroke stroke;
87
88 if ( penStyle == PS_SOLID )
89 {
90 if ( penWidth <= 1 ) stroke = new BasicStroke((float)penWidth);
91 else stroke = new BasicStroke((float)penWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER);
92 }
93 else if ( penStyle == AcopConst.PS_DASH )
94 stroke = new BasicStroke((float)penWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER,(float)penWidth,new float[]{6.f,2.f},6f);
95 else if ( penStyle == AcopConst.PS_DOT )
96 stroke = new BasicStroke((float)penWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER,(float)penWidth,new float[]{2.f,2.f},2f);
97 else
98 stroke = new BasicStroke((float)penWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER,(float)penWidth,new float[]{2.f,2.f,6.f,2.f},2f);
99
100 return stroke;
101 }
102
103 }