Centering the text within a label? [message #188366] |
Wed, 21 May 2008 23:03 |
Eclipse User |
|
|
|
Hi All!
Is it possible to center the text within a label? And especially is it
possible to define this behaviour within the models (gmfgraph or gmfgen)?
So I'm not searching a possibility to center a label within a node, I want
to center the text within a single label.
I'm lopking forward to your replies... really tried everythin and didn't
succeeded.
Thanks in advance!
Yours,
Markus
|
|
|
Re: Centering the text within a label? [message #188656 is a reply to message #188366] |
Thu, 22 May 2008 10:51 |
Eclipse User |
|
|
|
Originally posted by: ste-re.gmx.de
Hi Markus,
I'm not sure, but isn't the text inside a label always centered? I
think only the position of the label can be different.
For exmaple, if you want to center der name (label) of a node, you
have to center the whole label. to do this, a realy simple code
change have to be done.
Search for XXX.diagram.edit.parts.YYYEditPart (YYY = YourElement),
in this package the function public YYYFigure() and change the
following line from
layoutThis.setMinorAlignment(FlowLayout.ALIGN_TOPLEFT);
to
layoutThis.setMinorAlignment(FlowLayout.ALIGN_CENTER);
Actually I don't know an other way
Stefan
Markus Gieser wrote:
> Hi All!
>
> Is it possible to center the text within a label? And especially is it
> possible to define this behaviour within the models (gmfgraph or gmfgen)?
>
> So I'm not searching a possibility to center a label within a node, I want
> to center the text within a single label.
>
> I'm lopking forward to your replies... really tried everythin and didn't
> succeeded.
>
> Thanks in advance!
>
> Yours,
> Markus
>
>
|
|
|
Re: Centering the text within a label? [message #188673 is a reply to message #188656] |
Thu, 22 May 2008 10:48 |
Richard Gronback Messages: 605 Registered: July 2009 |
Senior Member |
|
|
Did you try label.setAlignment(PositionConstants.CENTER)?
- Rich
On 5/22/08 6:51 AM, in article g13in4$jv9$1@build.eclipse.org, "Stefan"
<ste-re@gmx.de> wrote:
> Hi Markus,
>
> I'm not sure, but isn't the text inside a label always centered? I
> think only the position of the label can be different.
> For exmaple, if you want to center der name (label) of a node, you
> have to center the whole label. to do this, a realy simple code
> change have to be done.
> Search for XXX.diagram.edit.parts.YYYEditPart (YYY = YourElement),
> in this package the function public YYYFigure() and change the
> following line from
> layoutThis.setMinorAlignment(FlowLayout.ALIGN_TOPLEFT);
> to
> layoutThis.setMinorAlignment(FlowLayout.ALIGN_CENTER);
>
> Actually I don't know an other way
>
> Stefan
>
> Markus Gieser wrote:
>> Hi All!
>>
>> Is it possible to center the text within a label? And especially is it
>> possible to define this behaviour within the models (gmfgraph or gmfgen)?
>>
>> So I'm not searching a possibility to center a label within a node, I want
>> to center the text within a single label.
>>
>> I'm lopking forward to your replies... really tried everythin and didn't
>> succeeded.
>>
>> Thanks in advance!
>>
>> Yours,
>> Markus
>>
>>
|
|
|
|
Re: Centering the text within a label? [message #189609 is a reply to message #188656] |
Wed, 28 May 2008 00:10 |
Eclipse User |
|
|
|
Thanks for your help! I solved my problem... :-)
Greetings,
Markus
"Stefan" <ste-re@gmx.de> schrieb im Newsbeitrag
news:g13in4$jv9$1@build.eclipse.org...
> Hi Markus,
>
> I'm not sure, but isn't the text inside a label always centered? I think
> only the position of the label can be different.
> For exmaple, if you want to center der name (label) of a node, you have to
> center the whole label. to do this, a realy simple code change have to be
> done.
> Search for XXX.diagram.edit.parts.YYYEditPart (YYY = YourElement), in
> this package the function public YYYFigure() and change the following line
> from layoutThis.setMinorAlignment(FlowLayout.ALIGN_TOPLEFT);
> to
> layoutThis.setMinorAlignment(FlowLayout.ALIGN_CENTER);
>
> Actually I don't know an other way
>
> Stefan
>
> Markus Gieser wrote:
>> Hi All!
>>
>> Is it possible to center the text within a label? And especially is it
>> possible to define this behaviour within the models (gmfgraph or gmfgen)?
>>
>> So I'm not searching a possibility to center a label within a node, I
>> want to center the text within a single label.
>>
>> I'm lopking forward to your replies... really tried everythin and didn't
>> succeeded.
>>
>> Thanks in advance!
>>
>> Yours,
>> Markus
|
|
|
Powered by
FUDForum. Page generated in 0.02969 seconds