Private APIs not usable in Java 9? - behind the scene
Jeff Hain
jeffhain at rocketmail.com
Thu Apr 9 20:57:56 UTC 2015
[Re-sending with more line breaks (hopefully - looked fine when sent but most were gone when I received it)]
Tom Schindl wrote:>So to summerize the most lacking API is in the font/text rendering space
What I find lacking too, coming from AWT/Swing, is some low-level (for JavaFX) features :
- Something like WritableImage.getGraphicsContext() (as we have Image.getGraphics()).
- Something like GraphicsContext.setXORMode(Color) (as we have Graphics.setXORMode(Color)) (for example for drawing a kind of cursor in a Canvas).
- Easier reading of Canvas pixels. The only way I found to just read a pixel in a Canvas, is to call Canvas.snapshot(...) (which needs to be called in FX application thread) with parameters corresponding to that pixel, and then do getPixelReader().getArgb(0, 0) on the returned WritableImage.
For simplicity of my code (minimalistic dependencies and cognitive load, easy-or-no bug),its adaptability (I might want to make it easy to do things JDK UI libraries have not been designed for),and its portability (I want it to run on top of AWT, JavaFX, OpenGL, or whatever widely supportedframework of the day), I don't want to commit myself to most of the JavaFX API, like the Scene Graphand Nodes, and just want to use Canvas, mouse/key events, and Stages and their events as windows,in some adaptation layer.
There might be some minimalistic windowing frameworks etc. out there in C,but I like the "write once run anywhere" of Java so I try to stick to it for now.
What I'm looking for surely exists behind the scene (accidental pun),but dispatched over internal layers (Glass, Quantum, etc.),and not regrouped into a consistent public API.
-Jeff
More information about the openjfx-dev
mailing list