On Mon, 22 Apr 2002 13:55:07 +0200 "Alexander Maryanovsky" <[EMAIL PROTECTED]> wrote:
> Why not wait until it's reconnected Answer is in next paragraph... > > However, there is a lot of "state" stored in > > the X-server (Graphics-Context etc.), > Hmm, I guess this was my confusion... I'm a Java developer Now, you got it right! > Well, like I said, I thought the applications were supposed to keep > all the state, not the X-server. There is a tradeof. Imagine an application trying to draw a line. You'll need to pass many parameters for each redraw, e.g: width, stappling (---....--...-), color, line ending style (round, truncated) etc. More complex figures (e.g: filled shapes) has even more drawing parameters. The solution is to put some "graphics state" (in X11 it is called Graphics Context) into the X-server, so you can draw a line with simple two endpoints coordinates parameters. AFAIK this method is employed by all common graphics systems: X11, Win, Mac (If I miss anything about the MS/Apple world, please fix me). What you see in Java is an illusion (albeit a good one). The classes (specifically the Graphics class) maintain state indeed. However, you should remember that on a low level Java works with the native display system, so when you issue for example a setFont() call to a Graphics object, Java simply store some internal info and calls a similar method on the native system (e.g: XSetFont on X11) which talks with the DISPLAY. Cheers, ---------------------------------------------------------------- Oron Peled Voice/Fax: +972-4-8228492 [EMAIL PROTECTED] http://www.actcom.co.il/~oron "Some people have a life, others have Windows to tell them where they want to go today" - Ronald C.F. Antony ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
