[kaffe] Classpath AWT progress.
James Simmons
jsimmons@infradead.org
Tue Dec 16 11:27:01 2003
> Would you have a problem with this for your xlib implementation? If so,
> it would be interesting to know the reason.
I have to see if it would work with my design goal. The basic goal is to
have two totally different environments work together as if they we one
environment. One screen would be X windows and the other screen would be
a linux framebuffer implementation. The problem is two very different
environments are going to have two different toolkits. Since it is
possible to pass in a GraphicsConfiguration to a Frame, Window etc I was
thinking it would be easiest to grab the proper toolkit from the
GraphicsConfiguration. Do you see any other way to grab the proper
toolkit?
> Just a side comment from reading your code:
> java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment() should never
> throw a HeadlessException. Instead, it should return a headless instance
> of GraphicsEnvironment when it is called in a server environment. The
> returned instance is supposed to throw a HeadlessException when it gets
> asked to perform things that only make sense in a GUI, such as
> determining the maximal size of any attached screen.
Fixed.
> >package gnu.java.awt;
> >public class ClasspathGraphicsEnvironment extends GraphicsEnvironment
>
> This may just be my personal opinion, but I'm currently not convinced why
> this class is needed at all. It seems that pretty much all of its
> functionality would be highly specific to the platform, with the
> exception of the getBounds() and getCenterPoint() methods -- so why
> introduce a concrete-but-not-functional subclass of the abstract
> GraphicsEnvironment? But this may be different when it turns out that we
> can refactor the implementation of other GraphicsEnvironment methods
> (such as getAllFonts).
>From what I interpet from the java specs it is a collect of all
GraphicsDevices and all Fonts. Its up to the Toolkit to tell the app which
fonts it can actually use. The tricky one is createGraphics. I haven't
figured that one out yet :-( If I have a different xxxGraphicsEnvironment
then my goal wouldn't work. It would be only one Toolkit at a time which
would grab only that one type of environment.
> By the way: Thanks for having documented your code, it makes it so much
> easier to read.
No problem.