I'm investigating using liquid as an embedded editor, when I run the editor v2.0.3
with lein uberjar
and java -jar target/uberjar/liquid-2.0.3-standalone.jar --jframe
, it runs, but only shows the most recent input update (see attached screenshot).
anyone know what I'm doing wrong?
Thank you @smith.adriane. I tried to reproduce on Linux and Windows without success. Unfortunately I do not have access to a Mac. Which Java version are you running, in case that makes a difference?
I tried 11.0.6 and 1.8.0_192 on Mac
I also tried versions v2.0.0 and v1.0.0
I also get the following warnings:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by clojure.lang.InjectedInvoker/0x0000000800231c40 (file:liquid/target/uberjar/liquid-2.0.3-standalone.jar) to method sun.java2d.SunGraphics2D.setFont(java.awt.Font)
WARNING: Please consider reporting this to the maintainers of clojure.lang.InjectedInvoker/0x0000000800231c40
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
my plan was to write a new output handler anyway. I was just trying to figure out how the drawing was implemented. it looks like when characters are deleted, they are removed from the view by just drawing the background color over the character?
I don't see anything that makes sure swing code is running on the main thread. I think that might be more of an issue on Mac
I'll try to fix locally and see if that helps
If the character at some position changes, the background color is drawn and then the new character. In case of deletion (empty character) the space character is used. The view is drawn in a separate thread (future), so that seems to fit with your observation regarding the main thread. I was not aware of this difference.
from all the sources that I can find, unless you call repaint
with a clipping rect, the paintComponent
method expects that you will repaint the full component
all the swing resources I can find are pretty old, but it seems like the recommended thing here is to paint to a buffered image?
either way, I think I'm all set for trying to make my own output-handler
this library looks really great. thanks for making it!