classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Differences to Java


From: Roman Kennke
Subject: Re: Differences to Java
Date: Sun, 25 Sep 2005 10:33:53 +0200

Hi!,

Am Sonntag, den 25.09.2005, 09:01 +0200 schrieb Thomas Zander:
> On Saturday 24 September 2005 18:45, theUser BL wrote:
> > Hi!
> >
> > Look at my comment at
> > http://forums.java.net/jive/thread.jspa?threadID=1510&tstart=0
> >
> > It seems, that GNU Classpath handles the layout different to Suns Java.
> >
> > The GNU version makes more sense for me. But I am not sure, if Suns
> > version is that, how it is written in the standardization (one of Suns
> > books).
> >
> > So, is the bug in GNU Classpath or in Suns Java?
> 
> Since there is no specification as to how this class should work, the sun 
> implementation is right.
> The description given in the reply of the thread you pasted makes sense. 
> Well, it describes the logic I see in Suns layouter, but its not logical 
> to me.

Wow, now I think I understand how this thing is supposed to work. What
really happens is this:

1. The layouter computes a baseline, based on the alignments and the
preferredWidths of the components. The alignment specifies, how much of
a component is on the left side of the base line. So 0.0 means,
everything is on the right, 0.5 means fifty-fifty and 1.0 means all is
on the left side. The baseline is then at width * (left/right) or so.
2. Then it lays out the components along the baseline according to their
aligments.

Easy, but the constant field names are very misleading, since 'left
alignment' does not align the component to the left, it merely aligns
the left edge of the component along the baseline....

Thank you theUserBL (BTW: What's your real name?) for pointing this out
and Thomas for giving me a last kick, I think I now can implement this
and fix the BoxLayout :-) I I'll make sure to document this stuff...

/Roman

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]