[2750] in java-interest

home help back first fref pref prev next nref lref last post

Questions about pre-beta peers/events/update()

daemon@ATHENA.MIT.EDU (Pat Niemeyer)
Thu Oct 12 16:28:30 1995

Date: Thu, 12 Oct 1995 13:10:40 -0500 (CDT)
From: Pat Niemeyer <pat@icon-stl.net>
To: java-interest@java.sun.com


Ok, so I'm confused about who causes components to be repainted and when.
Let me make some statements and questions and perhaps someone can clarify.

Assume I have a Frame with a Button inside of it...

The paint() methods are called by the "AWT-Motif/whatever" thread, an internal 
thread owned by the Java interpreter...

One obvious situation when components need to be repainted is when a 
window is exposed.

Window expose events seem to be one of the types of events that are
sucked up by the peer components.   I can't catch them in my component.
(though this may change in the future...  right?)

Big question: 
Is the peer component responsible for scheduling the update() by the AWT 
thread?  Who then calls the corresponding Java component's update()?

If not, how does the AWT thread know when to repaint() (where does it get
an event) and how does it even know what components exist?   Maybe I'm being
naive about how much the toolkit/native stuff does.

(more question-statements)

Graphics contexts ultimately come from the toolkit associated with the
component.   The graphics contexts for the Frame and Button are, at a
lower level, associated with different, real native windowing component.

That's why drawing on my frame doesn't draw over my Button... 
It's the native windowing system that provides the clipping, etc. for this...
(right?)

What is paintAll() for?   (It just calls validate() before painting
causing a layout() ) Does my component call this when it changes it's size etc.?

It looks like paintComponents() is used to get components to paint 
themselves on your particular graphics context as opposed to the ones 
associated with their native objects?  Does anything currently use this?
(maybe a print function will?)

As you can see, I'm confused...  I wish there were source available for 
the prebeta JDK. ;)


Thanks,
Pat

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post