Warning: session_start(): open(/var/lib/php/sessions/sess_tc1utqdb67ibu0muujhsc8sq02, 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
srecord noeq JGazelleVScriptRunner(SimpleLiveValue lvScript) {
GazelleVScript parsedScript;
O result;
SingleComponentPanel scpScriptResult = singleComponentPanel();
new WeakVar isScriptResult;
new WeakVar taResult;
JComponent scriptAndResultPanel() {
ret northAndCenter(
scriptInputField(),
scpScriptResult = singleComponentPanel()
);
}
JComponent scriptInputField() {
ret withMargin(centerAndEastWithMargin(
withLabel("Gazelle V Script:", jLiveTextField(lvScript)),
jPopDownButton_noText(
"Show Scripting Help", rThread { showText("Gazelle V Scripting Help", GazelleVScript.helpText) })
));
}
void showScriptOutput {
//print(result := className(result));
if (result cast BWImage) {
showImageResult(result);
} else if (result cast Animation) {
showImageResult(result.toImage());
} else {
showTextResult(str(result));
}
}
void showTextResult(S text) {
text = shorten(1000, text);
if (isShowing(taResult!)) {
setText(taResult, text);
} else {
var ta = jTextArea_noUndo(text);
scpScriptResult.set(jscroll(ta));
taResult.set(ta);
}
}
void showImageResult(BufferedImage etc img) {
if (img == null) ret;
if (isShowing(isScriptResult!)) {
isScriptResult->setImage(img);
} else {
var is = stdImageSurface();
is.setImage(img);
scpScriptResult.set(jscroll_centered(is));
isScriptResult.set(is);
}
}
ImageSurface stdImageSurface() {
ret pixelatedImageSurface().setAutoZoomToDisplay(true).repaintInThread(false);
}
void parse {
parsedScript = new GazelleVScript(lvScript!);
}
void runOn(IBWIntegralImage ii) {
var run = parsedScript.new Run();
run.setIntegralImage(ii);
run.run();
result = run.result();
}
void parseAndRunOn(IBWIntegralImage ii) {
try {
parse();
runOn(ii);
} catch e {
result = exceptionToStringShort(e);
printStackTrace(e);
}
showScriptOutput();
}
}