Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Label not centered
Label not centered [message #196884] Mon, 14 July 2008 07:41 Go to next message
Eclipse UserFriend
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 07:48 Go to previous messageGo to next message
Eclipse UserFriend
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 07:50 Go to previous messageGo to next message
Eclipse UserFriend
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 10: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 11: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 02:47 Go to previous messageGo to next message
Eclipse UserFriend
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 10: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 11:52 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 09:56:10 EDT 2025

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

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

Back to the top