Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Two label layout in a Rectangle
Two label layout in a Rectangle [message #148101] Tue, 28 August 2007 10:20 Go to next message
Eclipse UserFriend
Hello,

I'm attemping to lay out two labels in a Rectangle like so:

______________
I I
I Label1 I
I Label2 I
I____________ I

so that they stay centred.

I can do it easily for a single label using a Stack Layout
but for two or more, they simply lay over each other.
Flow Layout doesn't seem to help either as it lays them to
the Left hand side, even when setting Major and Minor
Alignment to CENTER.

I've also tried using two contained rectangles, but no luck.

Can anyone advise on this before I go mad?!

Thanks,

Andy
Re: Two label layout in a Rectangle [message #148126 is a reply to message #148101] Wed, 29 August 2007 04:17 Go to previous messageGo to next message
Eclipse UserFriend
Try using a GridLayout( 1 column) for the parent Rectangle and
GridlayoutData for each label...

ase a écrit :
> Hello,
>
> I'm attemping to lay out two labels in a Rectangle like so:
>
> ______________
> I I
> I Label1 I
> I Label2 I
> I____________ I
>
> so that they stay centred.
>
> I can do it easily for a single label using a Stack Layout
> but for two or more, they simply lay over each other.
> Flow Layout doesn't seem to help either as it lays them to
> the Left hand side, even when setting Major and Minor
> Alignment to CENTER.
>
> I've also tried using two contained rectangles, but no luck.
>
> Can anyone advise on this before I go mad?!
>
> Thanks,
>
> Andy
>
>
>
>
Re: Two label layout in a Rectangle [message #148510 is a reply to message #148126] Thu, 30 August 2007 06:29 Go to previous messageGo to next message
Eclipse UserFriend
I've tried that now - see attached gmfgraph and result,
but the result is left hand placement of the labels.

Have I got the structure right?

Any other suggestions welcome!

Andy
"Gilles Cannenterre" <gilles.cannenterre@anyware-tech.com> wrote in message
news:fb3a2l$9ie$1@build.eclipse.org...
> Try using a GridLayout( 1 column) for the parent Rectangle and
> GridlayoutData for each label...
>
> ase a
  • Attachment: gmfgraph.jpg
    (Size: 17.39KB, Downloaded 116 times)
  • Attachment: result.jpg
    (Size: 2.80KB, Downloaded 106 times)
Re: Two label layout in a Rectangle [message #148524 is a reply to message #148510] Thu, 30 August 2007 07:22 Go to previous messageGo to next message
Eclipse UserFriend
Hello ase,

For each of the grid layout data set
Grab excess horizontal space : true
Horizontal alignement : CENTER
it should work...

ase a écrit :
> I've tried that now - see attached gmfgraph and result,
> but the result is left hand placement of the labels.
>
> Have I got the structure right?
>
> Any other suggestions welcome!
>
> Andy
> "Gilles Cannenterre" <gilles.cannenterre@anyware-tech.com> wrote in message
> news:fb3a2l$9ie$1@build.eclipse.org...
>> Try using a GridLayout( 1 column) for the parent Rectangle and
>> GridlayoutData for each label...
>>
>> ase a écrit :
>>> Hello,
>>>
>>> I'm attemping to lay out two labels in a Rectangle like so:
>>>
>>> ______________
>>> I I
>>> I Label1 I
>>> I Label2 I
>>> I____________ I
>>>
>>> so that they stay centred.
>>>
>>> I can do it easily for a single label using a Stack Layout
>>> but for two or more, they simply lay over each other.
>>> Flow Layout doesn't seem to help either as it lays them to
>>> the Left hand side, even when setting Major and Minor
>>> Alignment to CENTER.
>>>
>>> I've also tried using two contained rectangles, but no luck.
>>>
>>> Can anyone advise on this before I go mad?!
>>>
>>> Thanks,
>>>
>>> Andy
>>>
>>>
>>>
>>>
>
>
Re: Two label layout in a Rectangle [message #148580 is a reply to message #148524] Thu, 30 August 2007 11:25 Go to previous message
Eclipse UserFriend
Hi Giles,

That does seem to work. Although now I get the labels centred but
towards the top of the rectangle. I've tried setting grab excess vertical
space: true but no effect. Any thoughts?

Andy

"Gilles Cannenterre" <gilles.cannenterre@anyware-tech.com> wrote in message
news:fb699p$fmc$1@build.eclipse.org...
> Hello ase,
>
> For each of the grid layout data set
> Grab excess horizontal space : true
> Horizontal alignement : CENTER
> it should work...
>
> ase a
Previous Topic:Adding EStructuralfeature
Next Topic:Localization of GMF editors
Goto Forum:
  


Current Time: Sat May 10 08:43:50 EDT 2025

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

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

Back to the top