Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Label not centered
Label not centered [message #196884] Mon, 14 July 2008 11:41 Go to next message
Manfred Hahn is currently offline Manfred HahnFriend
Messages: 64
Registered: July 2009
Member
Hello,

I switched my GMF application to Eclipse 3.4 and by the way from GMF 2.1M2
to GMF 3.4.0.
Since then all editable Lables are not shown in the center of their parent
rectangle but in the upper left corner. I even did a new generation of the
diagram source. The source of the parent figure shows a createContents()
method with this line:

this.add(fFigureAktivitaetLabelFigure, BorderLayout.CENTER);

but it doesn't work as expected. What has been changed and what should I
do?

Any hints wellcome.

Manfred
Re: Label not centered [message #196892 is a reply to message #196884] Mon, 14 July 2008 11:48 Go to previous messageGo to next message
urs zeidler is currently offline urs zeidlerFriend
Messages: 91
Registered: July 2009
Member
Manfred Hahn schrieb:
> Hello,
>
> I switched my GMF application to Eclipse 3.4 and by the way from GMF
> 2.1M2 to GMF 3.4.0. Since then all editable Lables are not shown in the
> center of their parent rectangle but in the upper left corner. I even
> did a new generation of the diagram source. The source of the parent
> figure shows a createContents() method with this line:
>
> this.add(fFigureAktivitaetLabelFigure, BorderLayout.CENTER);
>
> but it doesn't work as expected. What has been changed and what should I
> do?
>
> Any hints wellcome.
>
> Manfred
>
>
As far as I can tell, I encountered the same issue, you will need to
setAligment(PositionConstants.Center) on your Label, this works for me,
so this seems to me as a change of layout responsibility.

greetings urs.
Re: Label not centered [message #196900 is a reply to message #196884] Mon, 14 July 2008 11:50 Go to previous messageGo to next message
Manfred Hahn is currently offline Manfred HahnFriend
Messages: 64
Registered: July 2009
Member
Oh, sorry, the new GMF version is still 2.1.0 (v20080501) so perhaps the
change is in some underlying plugin like GEF?
Nevertheless, I have to solve the problem....
Re: Label not centered [message #196948 is a reply to message #196884] Mon, 14 July 2008 14:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nospam.nospam.com

I noticed the same problem after switching to the latest GMF/GEF/Eclipse.
Some labels are not centered when they were before.
I haven't tried anything yet. I was hoping some changes in .gmfgraph would
help if not I will try to modify the code.
Re: Label not centered [message #196963 is a reply to message #196948] Mon, 14 July 2008 15:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: me.urszeidler.de

W.F. wrote:
> I noticed the same problem after switching to the latest GMF/GEF/Eclipse.
> Some labels are not centered when they were before.
> I haven't tried anything yet. I was hoping some changes in .gmfgraph
> would help if not I will try to modify the code.
>
You can set this in the graph configuration as a facet on the label,
just as the example shows.


<labels
name="Callname"
figure="CallFigure"
elementIcon="false"
accessor="//@figures.0/@descriptors.23/@accessors.0">
<facets
xsi:type="gmfgraph:GeneralFacet"
identifier="Alignment"
data="PositionConstants.CENTER"/>
</labels>

Or by code :
fFigureCallnameFigure.setAlignment(PositionConstants.CENTER) ;

greetings, urs.
Re: Label not centered [message #197022 is a reply to message #196963] Tue, 15 July 2008 06:47 Go to previous messageGo to next message
Manfred Hahn is currently offline Manfred HahnFriend
Messages: 64
Registered: July 2009
Member
Hello,

thanks for your help, it works!

gr. Manfred
Re: Label not centered [message #197464 is a reply to message #196963] Wed, 16 July 2008 14:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nospam.nospam.com

The change in code does work but the General Facet doesn't for me. There
is no difference in the generated code, the General Facet is ignored.
Re: Label not centered [message #197471 is a reply to message #197464] Wed, 16 July 2008 15:52 Go to previous message
urs zeidler is currently offline urs zeidlerFriend
Messages: 91
Registered: July 2009
Member
W.F. schrieb:
> The change in code does work but the General Facet doesn't for me. There
> is no difference in the generated code, the General Facet is ignored.
>
>
Quite disturbing, but you are right, and thanks I have to add just
another "@generated not" tag.
So Alex, did you know why the facet don't work ? It should I think.

greetings, urs.
Previous Topic:Cheat Sheet in Ganymede?
Next Topic:Border & Links color
Goto Forum:
  


Current Time: Sun Jun 07 09:46:51 GMT 2020

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

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

Back to the top