Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Where do the property defaults come from?
Where do the property defaults come from? [message #144743] Fri, 02 May 2008 15:22 Go to next message
Kaspar  von Gunten is currently offline Kaspar von GuntenFriend
Messages: 21
Registered: July 2009
Junior Member
Hi

can somebody tell me, please, where the property default values (on the
property sheet or when creating/adding new components) are coming from?

The VisualEditor seems to set the preferredSize of every added panel to
(20,20) which we would like to change to another value, depending on the
type of panel added (actually we'd like it not to set any preferredSize at
all).

However, this size seems to exist in the model only, it is never written
to code (unless one sets the preferredSize in the property sheet
explicitly and manually).

Where can I hook into this? Who contributes this (20,20) size?

Thanks for any help,
Kaspar
Re: Where do the property defaults come from? [message #144761 is a reply to message #144743] Mon, 05 May 2008 13:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

That is only there so the you don't see just a dot. Certain controls
like a JPanel have a preferred size of (0,0). So if you put that into
another panel that is using a layout manager that lays out to preferred
size you would never see the JPanel and would never be able to drop
anything in it except through the Beans list. That is not it's actual
preferred size when running your code. The live code will continue to
have (0,0) as the preferred size.

This min size is only set on the few controls that have a default size
of (0,0). It can't be changed for editing.



Kaspar wrote:
> Hi
> can somebody tell me, please, where the property default values (on the
> property sheet or when creating/adding new components) are coming from?
>
> The VisualEditor seems to set the preferredSize of every added panel to
> (20,20) which we would like to change to another value, depending on the
> type of panel added (actually we'd like it not to set any preferredSize
> at all).
> However, this size seems to exist in the model only, it is never written
> to code (unless one sets the preferredSize in the property sheet
> explicitly and manually).
>
> Where can I hook into this? Who contributes this (20,20) size?
> Thanks for any help,
> Kaspar
>

--
Thanks,
Rich Kulp
Re: Where do the property defaults come from? [message #144770 is a reply to message #144761] Tue, 06 May 2008 10:44 Go to previous messageGo to next message
Kaspar  von Gunten is currently offline Kaspar von GuntenFriend
Messages: 21
Registered: July 2009
Junior Member
Hi Rich

thank you for your answer.

I agree with you, that this is not the runtime size on the panel and that
this size is merely used so that one gets an "initial handle" to move
things around in the VE.

But our problem is, that we insert ready-made components (that are
actually extending panels) via "insert bean" and those components are
inserted/shown with that (20,20) size (into the GridBagLayout of the
target panel), instead of their actually configured preferred size. This
is awkward.

If I explicitly "nullify" the preferred size of the inserted component in
the property sheet, then it is rendered correctly and as desired with its
preferred size.

Therefore I wonder, if I can somehow override that (20,20) to the actually
configured size, e.g. for some panels that implement
IMyNiceReadymadeComponent. Is there a way to influence the default size of
(20,20) for inserted panels? E.g. by setting a policy or so on a creation
tool?

Any pointers to where the (20,20) is coming from would be appreciated, I
can take it on from there myself.

Kaspar
Re: Where do the property defaults come from? [message #144779 is a reply to message #144770] Tue, 06 May 2008 14:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Hi,

That doesn't make sense to me. VE has had that from the beginning and
we've never seen it cause the actual calculated preferred size to be
ignored. It was only when the preferred size returned less than 20,20
did the VE do anything. If the preferred size was greater than 20,20
then that was used. The VE didn't actually do a physical set of the
preferred size on the component.


--
Thanks,
Rich Kulp
Re: Where do the property defaults come from? [message #144788 is a reply to message #144779] Tue, 06 May 2008 15:55 Go to previous messageGo to next message
Kaspar  von Gunten is currently offline Kaspar von GuntenFriend
Messages: 21
Registered: July 2009
Junior Member
Hi Rich

You are right: If I work with pure Swing, it is as you said: the preferred
size of the inserted component is respected.

So maybe this is the problem: in our case we're not actually using the
original VE (for Swing/SWT) but rather a VE-Extension from Canoo.com (ULC
Java) (which we minimally extend ourselves)

ULC is a remote implementation of Swing and so the instantiated composed
Panels are not part of the Swing hierarchy (that delegate to Swing on the
client side). For all ULC objects there exist separate .override files
(including all serializable shared objects such as Dimension etc.), there
are also separate PropertySourceAdapters etc. Could this be a reason for
the observed behavior?

To me it still seems to be the core VE that manages the initial (20,20)
size of inserted bean-panels, for what ever reason it may be. I'd be
really glad for a pointer where to start looking in the code for the
contribution of this (20,20) size.

Can you point something out here? Or do you have an idea, what
contribution could cause this behavior? Where might the logic be that
tells the VE to use (20,20) as a "transient" size (until a different value
is set in the properties by the user)?

Help would greatly be appreciated, I'd like to fix this behavior.

Thanks,
Kaspar

> That doesn't make sense to me. VE has had that from the beginning and
> we've never seen it cause the actual calculated preferred size to be
> ignored. It was only when the preferred size returned less than 20,20
> did the VE do anything. If the preferred size was greater than 20,20
> then that was used. The VE didn't actually do a physical set of the
> preferred size on the component.
Re: Where do the property defaults come from? [message #144797 is a reply to message #144788] Tue, 06 May 2008 16:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Unfortunately I don't remember. It's been over two years since the last
time I even looked at VE code. And that piece of code was written at
least three years ago. :-(

It would be either in the BeanAdapter or over in the remote vm itself.

--
Thanks,
Rich Kulp
Re: Where do the property defaults come from? [message #144805 is a reply to message #144797] Wed, 07 May 2008 09:20 Go to previous message
Kaspar  von Gunten is currently offline Kaspar von GuntenFriend
Messages: 21
Registered: July 2009
Junior Member
Thanks Rich, that's at least something.
I'll have a look.
Re: Where do the property defaults come from? [message #617191 is a reply to message #144743] Mon, 05 May 2008 13:30 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

That is only there so the you don't see just a dot. Certain controls
like a JPanel have a preferred size of (0,0). So if you put that into
another panel that is using a layout manager that lays out to preferred
size you would never see the JPanel and would never be able to drop
anything in it except through the Beans list. That is not it's actual
preferred size when running your code. The live code will continue to
have (0,0) as the preferred size.

This min size is only set on the few controls that have a default size
of (0,0). It can't be changed for editing.



Kaspar wrote:
> Hi
> can somebody tell me, please, where the property default values (on the
> property sheet or when creating/adding new components) are coming from?
>
> The VisualEditor seems to set the preferredSize of every added panel to
> (20,20) which we would like to change to another value, depending on the
> type of panel added (actually we'd like it not to set any preferredSize
> at all).
> However, this size seems to exist in the model only, it is never written
> to code (unless one sets the preferredSize in the property sheet
> explicitly and manually).
>
> Where can I hook into this? Who contributes this (20,20) size?
> Thanks for any help,
> Kaspar
>

--
Thanks,
Rich Kulp
Re: Where do the property defaults come from? [message #617192 is a reply to message #144761] Tue, 06 May 2008 10:44 Go to previous message
Kaspar  von Gunten is currently offline Kaspar von GuntenFriend
Messages: 21
Registered: July 2009
Junior Member
Hi Rich

thank you for your answer.

I agree with you, that this is not the runtime size on the panel and that
this size is merely used so that one gets an "initial handle" to move
things around in the VE.

But our problem is, that we insert ready-made components (that are
actually extending panels) via "insert bean" and those components are
inserted/shown with that (20,20) size (into the GridBagLayout of the
target panel), instead of their actually configured preferred size. This
is awkward.

If I explicitly "nullify" the preferred size of the inserted component in
the property sheet, then it is rendered correctly and as desired with its
preferred size.

Therefore I wonder, if I can somehow override that (20,20) to the actually
configured size, e.g. for some panels that implement
IMyNiceReadymadeComponent. Is there a way to influence the default size of
(20,20) for inserted panels? E.g. by setting a policy or so on a creation
tool?

Any pointers to where the (20,20) is coming from would be appreciated, I
can take it on from there myself.

Kaspar
Re: Where do the property defaults come from? [message #617193 is a reply to message #144770] Tue, 06 May 2008 14:21 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Hi,

That doesn't make sense to me. VE has had that from the beginning and
we've never seen it cause the actual calculated preferred size to be
ignored. It was only when the preferred size returned less than 20,20
did the VE do anything. If the preferred size was greater than 20,20
then that was used. The VE didn't actually do a physical set of the
preferred size on the component.


--
Thanks,
Rich Kulp
Re: Where do the property defaults come from? [message #617194 is a reply to message #144779] Tue, 06 May 2008 15:55 Go to previous message
Kaspar  von Gunten is currently offline Kaspar von GuntenFriend
Messages: 21
Registered: July 2009
Junior Member
Hi Rich

You are right: If I work with pure Swing, it is as you said: the preferred
size of the inserted component is respected.

So maybe this is the problem: in our case we're not actually using the
original VE (for Swing/SWT) but rather a VE-Extension from Canoo.com (ULC
Java) (which we minimally extend ourselves)

ULC is a remote implementation of Swing and so the instantiated composed
Panels are not part of the Swing hierarchy (that delegate to Swing on the
client side). For all ULC objects there exist separate .override files
(including all serializable shared objects such as Dimension etc.), there
are also separate PropertySourceAdapters etc. Could this be a reason for
the observed behavior?

To me it still seems to be the core VE that manages the initial (20,20)
size of inserted bean-panels, for what ever reason it may be. I'd be
really glad for a pointer where to start looking in the code for the
contribution of this (20,20) size.

Can you point something out here? Or do you have an idea, what
contribution could cause this behavior? Where might the logic be that
tells the VE to use (20,20) as a "transient" size (until a different value
is set in the properties by the user)?

Help would greatly be appreciated, I'd like to fix this behavior.

Thanks,
Kaspar

> That doesn't make sense to me. VE has had that from the beginning and
> we've never seen it cause the actual calculated preferred size to be
> ignored. It was only when the preferred size returned less than 20,20
> did the VE do anything. If the preferred size was greater than 20,20
> then that was used. The VE didn't actually do a physical set of the
> preferred size on the component.
Re: Where do the property defaults come from? [message #617195 is a reply to message #144788] Tue, 06 May 2008 16:35 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Unfortunately I don't remember. It's been over two years since the last
time I even looked at VE code. And that piece of code was written at
least three years ago. :-(

It would be either in the BeanAdapter or over in the remote vm itself.

--
Thanks,
Rich Kulp
Re: Where do the property defaults come from? [message #617196 is a reply to message #144797] Wed, 07 May 2008 09:20 Go to previous message
Kaspar  von Gunten is currently offline Kaspar von GuntenFriend
Messages: 21
Registered: July 2009
Junior Member
Thanks Rich, that's at least something.
I'll have a look.
Previous Topic:Where do the property defaults come from?
Next Topic:eclipse-SDK-3.4M6a-win32.zip and Visual Editor
Goto Forum:
  


Current Time: Thu Apr 25 20:45:45 GMT 2024

Powered by FUDForum. Page generated in 0.03071 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top