Centering the text within a label? [message #188366] |
Wed, 21 May 2008 19: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 #188673 is a reply to message #188656] |
Thu, 22 May 2008 06:48   |
Eclipse User |
|
|
|
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] |
Tue, 27 May 2008 20: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.29358 seconds