Extending GraphicsDevice for driver
I'm working with Java in an e-reader. I have an EInkDisplay class I'm using as a screen driver, containing a repaint(Rectangle) method and a getGraphics() method. I have another class, TouchDriver, capable of receiving touch events from the screen and generating MouseEvents for listeners. I'm working on a virtual keyboard so I can have keyboard input too.
In other words, I have the capabilities to create a non-headless GraphicsEnvironment. However, I'm not sure how to proceed with taking the above classes and generating a GraphicsDevice that I can use with Swing. Nowhere in the GraphicsDevice documentation does it give me a method to override and pass back the Graphics object that EInkDisplay provides me with.
Currently, whenever I attempt to instantiate a JFrame, I get a HeadlessException because the system does not recognize the E-Ink screen as an output device. I can definitely write to it, though; it's just a matter of formalizing it so Swing can understand.
Given the EInkDisplay and TouchDriver classes, how might I go about creating a GraphicsDevice or GraphicsEnvironment so I can generate a JFrame using new JFrame(GraphicsEnvironment)?
Alternately, if I could create a GraphicsDevice or GraphicsEnvironment and tell Java to use the Linux framebuffer at /dev/fb0, I'd be equally happy.