There's a try/catch around each call to a decorator, so that a decorator can't disturb the rest of the drawing. It's failing with the exception:
ex = (org.python.core.PyException) Traceback (innermost last):
File "demoRendererDecorator.jy", line 23, in paint
IOError: Stream Closed
which is indicated in the server log file.
Interestingly, if I draw a circle in Java code, at DasPlot.drawDecorator, it works fine. So maybe this is a permission problem. If I have the decorator simply print text, it still fails, so it's something with the callback. I wonder if any callbacks work in the server mode...
Last edit: Jeremy Faden 2026-06-10
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I noticed that the script https://github.com/autoplot/dev/blob/master/demos/annotations/strike/strikeDecorator.jy works, and it uses the addTopDecoration method in ScriptContext2023. I made this work with PlotElements as well as Plots and the Canvas, and sure enough this works. (So I think this has to due with thread security, and calling addTopDecorator calls into this properly.)
Last edit: Jeremy Faden 1 day ago
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is what it should look like.
This is what it looks like instead.
There's a try/catch around each call to a decorator, so that a decorator can't disturb the rest of the drawing. It's failing with the exception:
which is indicated in the server log file.
Interestingly, if I draw a circle in Java code, at DasPlot.drawDecorator, it works fine. So maybe this is a permission problem. If I have the decorator simply print text, it still fails, so it's something with the callback. I wonder if any callbacks work in the server mode...
Last edit: Jeremy Faden 2026-06-10
I noticed that the script https://github.com/autoplot/dev/blob/master/demos/annotations/strike/strikeDecorator.jy works, and it uses the addTopDecoration method in ScriptContext2023. I made this work with PlotElements as well as Plots and the Canvas, and sure enough this works. (So I think this has to due with thread security, and calling addTopDecorator calls into this properly.)
Last edit: Jeremy Faden 1 day ago