Warning: session_start(): open(/var/lib/php/sessions/sess_ip4n6813rae06k73d0096mnoan, 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
// background color is set with setBackground
sclass JMultiColorBar > JComponentWithChangeListeners {
class Entry {
settable double value;
settable Color color;
}
L entries = notifyingList(l0 repaint);
settableWithVar double max = 100;
void addEntry(double value, Color color) {
entries.add(new Entry().+value.+color);
}
*() {
setForeground(Color.red);
varMax().onChange(l0 repaint);
jMinSize(50, 10, this);
}
public void paintComponent(Graphics g) {
super.paintComponent(g); // paint background
int w = getWidth(), h = getHeight();
int x = 0;
for (e : entries) {
int x2 = main max(x, iround(w*clampZeroToOne(doubleRatio(e.value, max))));
if (x2 > x)
fillRect(g, x2+1, 0, x2-x, h, e.color);
x = x2;
}
}
}