Warning: session_start(): open(/var/lib/php/sessions/sess_6550nfa2cs32g3oq14rjv6tkst, 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 AnimatedImageSurface > ImageSurface {
double fps = 20;
// We start & stop the timer by setting its frequency
// to the actual frequency or 0, respectively.
// (Don't want to close the timer as that is permanent.)
FlexibleRateTimer animationTimer = new(0, l0 renderFrame).pileUp(false);
void renderFrame {
setImage(makeImage());
}
selfType fps aka setFPS(double fps) {
this.fps = fps;
swing { updateTimer(isShowing()); }
this;
}
swappable BufferedImage makeImage() {
ret whiteImage(10, 10);
}
*() { init(); }
*(IF0 *makeImage) { init(); }
*(double fps, IF0 *makeImage) { setFPS(fps); init(); }
*(Freq freq, IF0 *makeImage) { setFPS(freq!); init(); }
void updateTimer(bool showing) {
animationTimer.setFrequencyImmediately(showing ? fps : 0.0);
}
void init {
setDoubleBuffered(true);
bindToComponent(this,
-> { animationTimer.start(); updateTimer(true); },
-> updateTimer(false));
}
}