liquid

phronmophobic 2020-07-16T19:37:35.002800Z

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?

mogenslund 2020-07-16T20:49:48.004700Z

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?

phronmophobic 2020-07-16T20:51:05.005Z

I tried 11.0.6 and 1.8.0_192 on Mac

phronmophobic 2020-07-16T20:52:12.005400Z

I also tried versions v2.0.0 and v1.0.0

phronmophobic 2020-07-16T20:53:34.005900Z

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

phronmophobic 2020-07-16T21:03:10.007200Z

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?

phronmophobic 2020-07-16T21:08:18.007900Z

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

phronmophobic 2020-07-16T21:09:42.009100Z

I'll try to fix locally and see if that helps

mogenslund 2020-07-16T21:11:24.010900Z

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.

👍 1
phronmophobic 2020-07-16T21:41:57.012100Z

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

phronmophobic 2020-07-16T21:43:13.012900Z

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?

phronmophobic 2020-07-16T21:46:41.013300Z

either way, I think I'm all set for trying to make my own output-handler

phronmophobic 2020-07-16T21:46:55.013700Z

this library looks really great. thanks for making it!

🙂 1