Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » GridbagLayout problems
GridbagLayout problems [message #54371] Wed, 04 August 2004 07:04 Go to next message
Eric Camden is currently offline Eric CamdenFriend
Messages: 19
Registered: July 2009
Junior Member
I am having trouble getting the visual editor to layout components in a
gridbaglayout the way they should. All I want is a grid with 4 components:
2 of equal height on the left, and on the right, one small component
followed by one large component. In ascii:

------------------------|-----------------
|
| comp 1 comp 2
| |-----------------
| |
| |
| |
------------------------|
| |
|
| comp 3
| comp 4
|
|
------------------------|

Currently, I have comp1 with grid height 2, comp 2 with grid height 1,
comp 4 with grid height 1, and comp 3 with grid height 2. But no matter
how I adjust sizes, comp 1 and comp 2 are always identically sized, as are
comp 4 and comp 3. Is this something wrong with the VE, or something I
don't understand about GridBagLayout?

Oh, and I also just switched to M2, and I've noticed that you can no
longer double click a label/button to set its text. Is this a bug or a
feature?
Re: GridbagLayout problems [message #54454 is a reply to message #54371] Wed, 04 August 2004 14:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: myersj.nospam.us.ibm.com

Hi Eric,

This is a fairly odd situation. The reason you're not getting the
behavior you're expecting is that there's nothing in the second row to
define its height, so the row has a height of 0. After a little fooling
around I came up with a way to get what I think you want.

Set the constraints of the components as follows:

1: x: 0, y: 0, grid height: 2, weight y: 1, fill: vertical
2: x: 1, y: 0, grid height: 1, weight y: 0, fill: none
3: x: 1, y: 1, grid height: 3, weight y: 1, fill: vertical
4: x: 0, y: 2, grid height: 2, weight y: 1, fill: vertical

Direct editing should still work, but the activation is by selecting
something twice, not double clicking. If you double click it may happen
too quickly for it to register as double selection. (it's supposed to
work the same way you can rename a file in Windows Explorer by double
selecting the file)

Hope this helps,

- Jeff

Eric Camden wrote:

> I am having trouble getting the visual editor to layout components in a
> gridbaglayout the way they should. All I want is a grid with 4 components:
> 2 of equal height on the left, and on the right, one small component
> followed by one large component. In ascii:
>
> ------------------------|-----------------
> |
> | comp 1 comp 2
> | |-----------------
> | |
> | |
> | |
> ------------------------|
> | |
> |
> | comp 3
> | comp 4
> |
> |
> ------------------------|
>
> Currently, I have comp1 with grid height 2, comp 2 with grid height 1,
> comp 4 with grid height 1, and comp 3 with grid height 2. But no matter
> how I adjust sizes, comp 1 and comp 2 are always identically sized, as are
> comp 4 and comp 3. Is this something wrong with the VE, or something I
> don't understand about GridBagLayout?
>
> Oh, and I also just switched to M2, and I've noticed that you can no
> longer double click a label/button to set its text. Is this a bug or a
> feature?
>
Re: GridbagLayout problems [message #54677 is a reply to message #54454] Thu, 05 August 2004 00:36 Go to previous message
Eric Camden is currently offline Eric CamdenFriend
Messages: 19
Registered: July 2009
Junior Member
Thank you, for both answers. Indeed, all I needed to do was turn the
y-weight of component 2 to 0, and problem solved. In my humble opinion,
this is a bit of a flaw in the design of GridBagLayout, but oh well, can't
have everything you want.

Jeff Myers wrote:

> Hi Eric,

> This is a fairly odd situation. The reason you're not getting the
> behavior you're expecting is that there's nothing in the second row to
> define its height, so the row has a height of 0. After a little fooling
> around I came up with a way to get what I think you want.

> Set the constraints of the components as follows:

> 1: x: 0, y: 0, grid height: 2, weight y: 1, fill: vertical
> 2: x: 1, y: 0, grid height: 1, weight y: 0, fill: none
> 3: x: 1, y: 1, grid height: 3, weight y: 1, fill: vertical
> 4: x: 0, y: 2, grid height: 2, weight y: 1, fill: vertical

> Direct editing should still work, but the activation is by selecting
> something twice, not double clicking. If you double click it may happen
> too quickly for it to register as double selection. (it's supposed to
> work the same way you can rename a file in Windows Explorer by double
> selecting the file)

> Hope this helps,

> - Jeff

> Eric Camden wrote:

> > I am having trouble getting the visual editor to layout components in a
> > gridbaglayout the way they should. All I want is a grid with 4 components:
> > 2 of equal height on the left, and on the right, one small component
> > followed by one large component. In ascii:
> >
> > ------------------------|-----------------
> > |
> > | comp 1 comp 2
> > | |-----------------
> > | |
> > | |
> > | |
> > ------------------------|
> > | |
> > |
> > | comp 3
> > | comp 4
> > |
> > |
> > ------------------------|
> >
> > Currently, I have comp1 with grid height 2, comp 2 with grid height 1,
> > comp 4 with grid height 1, and comp 3 with grid height 2. But no matter
> > how I adjust sizes, comp 1 and comp 2 are always identically sized, as are
> > comp 4 and comp 3. Is this something wrong with the VE, or something I
> > don't understand about GridBagLayout?
> >
> > Oh, and I also just switched to M2, and I've noticed that you can no
> > longer double click a label/button to set its text. Is this a bug or a
> > feature?
> >
Re: GridbagLayout problems [message #596699 is a reply to message #54371] Wed, 04 August 2004 14:01 Go to previous message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 396
Registered: July 2009
Senior Member
Hi Eric,

This is a fairly odd situation. The reason you're not getting the
behavior you're expecting is that there's nothing in the second row to
define its height, so the row has a height of 0. After a little fooling
around I came up with a way to get what I think you want.

Set the constraints of the components as follows:

1: x: 0, y: 0, grid height: 2, weight y: 1, fill: vertical
2: x: 1, y: 0, grid height: 1, weight y: 0, fill: none
3: x: 1, y: 1, grid height: 3, weight y: 1, fill: vertical
4: x: 0, y: 2, grid height: 2, weight y: 1, fill: vertical

Direct editing should still work, but the activation is by selecting
something twice, not double clicking. If you double click it may happen
too quickly for it to register as double selection. (it's supposed to
work the same way you can rename a file in Windows Explorer by double
selecting the file)

Hope this helps,

- Jeff

Eric Camden wrote:

> I am having trouble getting the visual editor to layout components in a
> gridbaglayout the way they should. All I want is a grid with 4 components:
> 2 of equal height on the left, and on the right, one small component
> followed by one large component. In ascii:
>
> ------------------------|-----------------
> |
> | comp 1 comp 2
> | |-----------------
> | |
> | |
> | |
> ------------------------|
> | |
> |
> | comp 3
> | comp 4
> |
> |
> ------------------------|
>
> Currently, I have comp1 with grid height 2, comp 2 with grid height 1,
> comp 4 with grid height 1, and comp 3 with grid height 2. But no matter
> how I adjust sizes, comp 1 and comp 2 are always identically sized, as are
> comp 4 and comp 3. Is this something wrong with the VE, or something I
> don't understand about GridBagLayout?
>
> Oh, and I also just switched to M2, and I've noticed that you can no
> longer double click a label/button to set its text. Is this a bug or a
> feature?
>
Re: GridbagLayout problems [message #596768 is a reply to message #54454] Thu, 05 August 2004 00:36 Go to previous message
Eric Camden is currently offline Eric CamdenFriend
Messages: 19
Registered: July 2009
Junior Member
Thank you, for both answers. Indeed, all I needed to do was turn the
y-weight of component 2 to 0, and problem solved. In my humble opinion,
this is a bit of a flaw in the design of GridBagLayout, but oh well, can't
have everything you want.

Jeff Myers wrote:

> Hi Eric,

> This is a fairly odd situation. The reason you're not getting the
> behavior you're expecting is that there's nothing in the second row to
> define its height, so the row has a height of 0. After a little fooling
> around I came up with a way to get what I think you want.

> Set the constraints of the components as follows:

> 1: x: 0, y: 0, grid height: 2, weight y: 1, fill: vertical
> 2: x: 1, y: 0, grid height: 1, weight y: 0, fill: none
> 3: x: 1, y: 1, grid height: 3, weight y: 1, fill: vertical
> 4: x: 0, y: 2, grid height: 2, weight y: 1, fill: vertical

> Direct editing should still work, but the activation is by selecting
> something twice, not double clicking. If you double click it may happen
> too quickly for it to register as double selection. (it's supposed to
> work the same way you can rename a file in Windows Explorer by double
> selecting the file)

> Hope this helps,

> - Jeff

> Eric Camden wrote:

> > I am having trouble getting the visual editor to layout components in a
> > gridbaglayout the way they should. All I want is a grid with 4 components:
> > 2 of equal height on the left, and on the right, one small component
> > followed by one large component. In ascii:
> >
> > ------------------------|-----------------
> > |
> > | comp 1 comp 2
> > | |-----------------
> > | |
> > | |
> > | |
> > ------------------------|
> > | |
> > |
> > | comp 3
> > | comp 4
> > |
> > |
> > ------------------------|
> >
> > Currently, I have comp1 with grid height 2, comp 2 with grid height 1,
> > comp 4 with grid height 1, and comp 3 with grid height 2. But no matter
> > how I adjust sizes, comp 1 and comp 2 are always identically sized, as are
> > comp 4 and comp 3. Is this something wrong with the VE, or something I
> > don't understand about GridBagLayout?
> >
> > Oh, and I also just switched to M2, and I've noticed that you can no
> > longer double click a label/button to set its text. Is this a bug or a
> > feature?
> >
Previous Topic:Tutorials for VE
Next Topic:Tutorials for VE
Goto Forum:
  


Current Time: Mon Jul 22 07:35:22 GMT 2024

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

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

Back to the top