This is the mail archive of the java-patches@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: Xlib AWT and Java 2D


On Mon, Oct 23, 2000 at 03:36:50PM +1300, Bryce McKinlay wrote:
>[...]
> I'd like to make LightweightDispatcher pkgprivate and move it into java.awt
> (actually, might as well put it into Container.java - Sun have it there
> according to my stack trace). This way it can be made more efficient by
> referring to component bounds and such directly rather than by calling
> getX()/getY()/etc. I think it is generally safe and desirable to bypass the
> get methods within the awt implementation itself. LightweightPeer should
> probably go in there too for the sake of continuity.

I agree that bypassing the get-methods is desirable. The reason I 
didn't put LightweightDispatcher within java.awt initially, 
was that I wanted redirecting to occur before the event is posted on 
the event queue. Hoped to avoid problems due to changes to the 
component structure or geometry that occur while the event is waiting 
in the event queue. I later realized that we can never avoid those 
problems completely, since they can occur while events are sitting on 
the event queue of the native windowing system as well.

One other thing I worried about was whether events would coalesce 
properly if they weren't redirected first. But now when I think about 
it, I can't really see what harm it could do.

So, I agree... LightweightDispatcher should be moved into java.awt.

> It is interesting how Container has a dispatcher field according to the
> serialization spec. I don't know how we can achieve serialization
> compatibility when this class isn't documented, but this does imply that
> dispatcher maintains some state data. I wonder what?

The dispatcher needs to keep track of which button is pushed down on 
what component, so that is can redirect the button-up event to the same 
component, even if the cursor/pointer has moved to a different 
component in the mean time. Mouse motion events should also be 
redirected to the component where the mouse drag began. This is done 
automatically for heavyweight components by X11. We need to do that 
tracking ourself for lightweights. But this tracking only needs state 
data that is global for the whole toolkit. I don't see the need to 
store separate state data for each component.

>[...] 
> There's no immediate need to make this change however, but for now I would
> like to see the number of different packages we're currently spread across to
> reduce a little. What do you think about moving the files left in gnu/gcj/awt
> into gnu/awt and/or gnu/awt/j2d?

I would suggest:

gnu.gcj.awt.BitMaskExtent        --->  gnu.awt.BitMaskExtent
gnu.gcj.awt.Buffers              --->  gnu.awt.j2d.Buffers
gnu.gcj.awt.ComponentDataBlitOp  --->  gnu.awt.j2d.ComponentDataBlitOp
gnu.gcj.awt.GLightweightPeer     --->  gnu.awt.GLightweightPeer

-- 
Rolf W. Rasmussen

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]