Home » Modeling » GMF (Graphical Modeling Framework) » Figure position on the diagram
Figure position on the diagram [message #175792] |
Wed, 05 March 2008 08:41  |
Eclipse User |
|
|
|
Originally posted by: fbanica.soluta.net
Hello,
I am trying to set the position of a figure on the diagram, but it's not
working. I want to create (in code) some objects, when the model is created,
before the diagram is shown up. I create them, but I can not "tell" the
application where exactly to put them on the diagram.
I set the Location inside every figure, in the .gmfgraph file, and I was
expecting to see the results on the diagram. The other object that contains
them has a XYLayout. But, unfortunately, it doesn't work. All the elements
are created into the upper left corner of the "parent" object.
Where did I go wrong? What to do? Please, help! Thanks,
Floppy
|
|
|
Re: Figure position on the diagram [message #175829 is a reply to message #175792] |
Wed, 05 March 2008 10:02   |
Eclipse User |
|
|
|
Originally posted by: fbanica.soluta.net
I also tried with the EditPolicies. I've created a new CreationEditPolicy
for the "father" object and I've
overridden the "getCreateElementAndViewCommand" and "getCreateCommand"
methods
and put some breakpoints.
I noticed that the "getCreateCommand" is called when the diagram file is
created (new). The second method: "getCreateElementAndViewCommand" is called
when you create a new object ON the diagram (from the palette, for example),
meaning you already have the diagram open.
I want to create (in code) some objects, when the model is created, before
the diagram is shown up. I create them, but I can not "tell" the application
where exactly to put them on the diagram. So, it seems that the first method
would do for me...
:-( But, in "getCreateCommand" method, the request contains a reference to a
list of ALL the contained "children", so I cannot tell the request to set a
different location for every "child". I don't know how to handle with this
situation... I tried also to set the locations for the figures into the
..gmfgraph file, but there's no use.
Did I make myself clear? Is there any solution? Please, help. Thanks,
"Florin Banica" <fbanica@soluta.net> wrote in message
news:fqm7tj$hub$1@build.eclipse.org...
> Hello,
>
> I am trying to set the position of a figure on the diagram, but it's not
> working. I want to create (in code) some objects, when the model is
> created, before the diagram is shown up. I create them, but I can not
> "tell" the application where exactly to put them on the diagram.
>
> I set the Location inside every figure, in the .gmfgraph file, and I was
> expecting to see the results on the diagram. The other object that
> contains them has a XYLayout. But, unfortunately, it doesn't work. All the
> elements are created into the upper left corner of the "parent" object.
>
> Where did I go wrong? What to do? Please, help! Thanks,
>
>
>
> Floppy
>
|
|
|
Re: Figure position on the diagram [message #176353 is a reply to message #175829] |
Fri, 07 March 2008 03:12  |
Eclipse User |
|
|
|
Originally posted by: fbanica.soluta.net
Any help? Please!
"Florin Banica" <fbanica@soluta.net> wrote in message
news:fqmcm4$786$1@build.eclipse.org...
>I also tried with the EditPolicies. I've created a new CreationEditPolicy
>for the "father" object and I've
> overridden the "getCreateElementAndViewCommand" and "getCreateCommand"
> methods
> and put some breakpoints.
>
> I noticed that the "getCreateCommand" is called when the diagram file is
> created (new). The second method: "getCreateElementAndViewCommand" is
> called
> when you create a new object ON the diagram (from the palette, for
> example),
> meaning you already have the diagram open.
>
> I want to create (in code) some objects, when the model is created, before
> the diagram is shown up. I create them, but I can not "tell" the
> application
> where exactly to put them on the diagram. So, it seems that the first
> method
> would do for me...
>
> :-( But, in "getCreateCommand" method, the request contains a reference to
> a
> list of ALL the contained "children", so I cannot tell the request to set
> a
> different location for every "child". I don't know how to handle with this
> situation... I tried also to set the locations for the figures into the
> .gmfgraph file, but there's no use.
>
> Did I make myself clear? Is there any solution? Please, help. Thanks,
>
>
>
> "Florin Banica" <fbanica@soluta.net> wrote in message
> news:fqm7tj$hub$1@build.eclipse.org...
>> Hello,
>>
>> I am trying to set the position of a figure on the diagram, but it's not
>> working. I want to create (in code) some objects, when the model is
>> created, before the diagram is shown up. I create them, but I can not
>> "tell" the application where exactly to put them on the diagram.
>>
>> I set the Location inside every figure, in the .gmfgraph file, and I was
>> expecting to see the results on the diagram. The other object that
>> contains them has a XYLayout. But, unfortunately, it doesn't work. All
>> the elements are created into the upper left corner of the "parent"
>> object.
>>
>> Where did I go wrong? What to do? Please, help! Thanks,
>>
>>
>>
>> Floppy
>>
>
>
|
|
|
Goto Forum:
Current Time: Thu Jul 17 14:13:56 EDT 2025
Powered by FUDForum. Page generated in 0.04788 seconds
|