[3359] in java-interest

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

reshape & LayoutManager confusion

daemon@ATHENA.MIT.EDU (William Cook)
Thu Nov 9 00:26:56 1995

Date: Wed, 8 Nov 1995 19:06:09 -0800
To: java-interest@java.sun.com
From: William Cook <william@luma.com>

My initial experience with the Beta API was good, but now I am stumped.

I am trying to write a simple LayoutManager. Basically, I want to prevent
the normal "constraint-based" layout and just put things exactly where
I want them. So I make a class AbsoluteLayout which simply ignores
the request to layoutContainer; it assumes that the container parts are already
set up properly because nothing ever changes position.

I then create a Panel set its layout to a new AbsoluteLayout. I then create
a bunch of different things (mostly Panels with FlowLayouts), set their
position to an absolute location using "reshape" and then wait for
everything to be refreshed.

Somehow something resets all my Panels to have bounds (0, 0, 100, 100).

This is very mysterious to me, because the only method that changes
Container x, y, width, and height is "reshape". And these fields should
are private, so nobody else should be able to change them. Even when
I make a subclass MyPanel and override reshape to try and catch the offending
call (I expect to find somebody in awt calling reshape(0, 0, 100, 100)),
it never happens. Nobody is calling reshape, yet my bounds are changing.

I suspect that I am missing something simple, but I have to say that the
unexplained "peer" classes have me worried. I felt good just ignoring them,
because they were not documented. But what do they do?

I also got stuck trying to use the debugger: it kept complaining about an
"unhandled exception: FileNotFound".

Help!

-william cook
LUMA, Inc.

PS: I also have a small layout comment. It seems that the layout mechanism
lacks the concept of "maximum size", which would come from the container
just as the minimum size comes from the sum of the subparts. This means that
things sometimes can't be layed out very well, as when a flow is placed inside
a flow. Was this ever considered?


-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

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