🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19555

Re: XYLayout *is* buggy (-1)

#19555
From: Rich Wilkman
Date: Thu, 22 Jan 1998 00:00
59 lines
2665 bytes
Fabian:

If you size something down so that either it's height or width is the
same as the preferred size you will get a -1 for that portion of the
constraint.  Why?  Because preferred size is the more proper java
mechanism.

Bug?  Difference of opinion there.  It's working the way it was
designed to work.

The -1 is in the constraint and tells XYLayout that when it comes time
to call doLayout() it needs to ask the component what it's preferred
size is.  I'm not sure what you mean with your comment on
getPreferredSize().  You don't ask the layout that question, you ask
the compoment itself.  The component knows it's preferred size and
then it's up to the layout manager to decide if it wants to honor it
or ignore it.

XYLayout, in general, is a great prototype layout.  For the real world
it is recommended that you switch to a proper layout at deployment
time.  You can probably find on of my "co-ordinate based layouts are
evil" rants somewhere in the newsgroups if you want more on that.

-Rich

Fabian Beutin wrote:
> 
> Hi there!
> 
> Components beeing resized in the form editor sometimes get a -1 as a
> constraints value.
> A Borland emloyee said that this means that the preferred size will get
> used. Fine. Good answer, but still a bug.
> Why should the preferred size get used, when the component is resized
> with the mouse by the user?! The user is giving _absolute_ values here.
> The XYLayout manager definetely shouldn't make a -1 from that.
> Also getPreferredSize() won't result in the same value the user resized
> the component to...
> 
> So, is this a known bug after all?
> 
> Regards,
>         Fabian.

-- 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rich Wilkman
Senior Quality Assurance Engineer
Borland JBuilder Team

If you see something that looks like an opinion up there,
it's mine and mine alone.

Mail sent to me from the newsgroups won't bounce but will
be ignored.  If I have time, I'll respond, but you  have
a better chance if you confine your posts to the newsgroups
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID: <34C7851F.2F17D94@corp.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <34C6C5D2.CB579D92@berlin.snafu.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,bea07c142ab743f4
X-Google-Attributes: gidf74b3,public
From: Rich Wilkman <rwilkman@corp.borland.com>
Subject: Re: XYLayout *is* buggy (-1)
Date: 1998/01/22
Message-ID: <34C7851F.2F17D94@corp.borland.com>
X-Deja-AN: 318372590
Content-Transfer-Encoding: 7bit
References: <34C6C5D2.CB579D92@berlin.snafu.de>
Content-Type: text/plain; charset=us-ascii
Organization: None
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language