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.Rectangle;
25
26 public class AcopFrame
27 {
28 protected java.awt.Color frameForeColor;
29 protected java.awt.Font frameFont;
30 protected boolean leftTimeLabel;
31 protected boolean absTimeDisplay;
32 protected int histogramPosition;
33 protected Rectangle histRect;
34 protected boolean drawFlag;
35
36 protected int ZoomExtent;
37 protected Rectangle zoomIcon;
38
39 protected int xleft, xright, dxwidth, absxleft;
40
41 public AcopFrame()
42 {
43 histRect = new Rectangle();
44 zoomIcon = new Rectangle();
45 ZoomExtent = 36;
46
47
48 }
49
50
51 protected void getOxleftright(AcopHisto pHisto, AcopScale pScale)
52 { int Rest, Wpixel, Offset;
53 double xtemp;
54
55 if ( pHisto.dismode == AcopConst.mode_histogram_rastoring )
56 {
57 dxwidth = Math.min( histRect.width, (int)(pScale.max-pScale.min) );
58 if (dxwidth < 2) dxwidth = pHisto.npoints > 2 ? pHisto.npoints - 1 : 1;
59 if ( histRect.width >= dxwidth )
60 {
61 Wpixel = histRect.width / dxwidth;
62 Offset = histRect.width % Wpixel;
63 Rest = ((histRect.width-Offset) % dxwidth);
64 if ( histogramPosition == 0 )
65 {
66 xleft = 0;
67 xright = histRect.width - Rest - Offset;
68 }
69 else if ( histogramPosition == 2 )
70 {
71 xleft = Rest + Offset;
72 xright = histRect.width;
73 }
74 else
75 {
76 xleft = Rest/2;
77 xright = histRect.width - (Rest - Rest/2) - Offset;
78 }
79 }
80 }
81 else
82 {
83 xleft = 0;
84 xright = histRect.width;
85 }
86 dxwidth = xright - xleft;
87 absxleft = xleft + histRect.x;
88 }
89
90 }
91