Warning: session_start(): open(/var/lib/php/sessions/sess_0k750i0spgs1m6ndh8ioha2akn, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass JAmplitudeGraph extends JComponent {
float[] values;
public void paint(Graphics g) {
int w = getWidth(), h = getHeight();
fillRect(g, 0, 0, w, h, getBackground());
float[] values = this.values;
if (empty(values)) ret;
Color fg = getForeground();
double factor = doubleRatio(l(values), w);
_print(+factor);
for x to w: {
int i1 = min(l(values)-1, ifloor(x*factor));
int i2 = max(i1+1, ifloor((x+1)*factor));
float val = 0;
for (int i = i1; i < i2; i++) val = max(val, values[i]);
int y = iround(val*h);
fillRect(g, x, h-y, 1, y, fg);
}
}
void setValues(float[] values) {
this.values = values;
repaint();
}
}