Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Change shape upon field value
Change shape upon field value [message #187811] Mon, 19 May 2008 16:50 Go to next message
Eclipse UserFriend
Originally posted by: matthias.schmidt.xactium.com

Hello everybody,

I would like to change the shape of a diagram element whenever the value
of a field changes.
Is there a way to do that in GMF?

Thanks a lot.
Matthias
Re: Change shape upon field value [message #187873 is a reply to message #187811] Tue, 20 May 2008 10:31 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Matthias,

It is possible to create:
- two node mappings with different DiargamElements associated
- constraints (OCL) in each of these mappings limiting range of possible
"field" values.

As a result domain node with some "field" value will be represented by NodeMapping-1,
NodeMapping-2 will be used for other values.

-----------------
Alex Shatalin
Re: Change shape upon field value [message #187998 is a reply to message #187873] Tue, 20 May 2008 14:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matthias.schmidt.xactium.com

Hi Alex,

That sound fantastic. But can you give me more details?
Let's say I want to change the node mapping upon an integer value
'style'. If style<=1 one node mapping should be use and if style>1
another one.

How would the ocl constrain look like? (Sry, will be my first one. :)
How do I ensure, that the changes take effect to the same node in the
diagram?
I can't have to node mappings as children of one top node reference. Is
it right that, I would need a separate top node reference too?

Thanks!
Matthias





Alex Shatalin wrote:
> Hello Matthias,
>
> It is possible to create:
> - two node mappings with different DiargamElements associated -
> constraints (OCL) in each of these mappings limiting range of possible
> "field" values.
>
> As a result domain node with some "field" value will be represented by
> NodeMapping-1, NodeMapping-2 will be used for other values.
>
> -----------------
> Alex Shatalin
>
>
Re: Change shape upon field value [message #188026 is a reply to message #187998] Tue, 20 May 2008 15:38 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Matthias,

> 'style'. If style<=1 one node mapping should be use and if style>1
It's simple: "style <=1", "style > 1" :-) Just try it - you have to create
corresponding element below NodeMapping, set language to OCL and type these
strings as a body.

> I can't have to node mappings as children of one top node reference.
> Is it right that, I would need a separate top node reference too?
Yes, you are right!

-----------------
Alex Shatalin
Re: Change shape upon field value [message #188051 is a reply to message #188026] Tue, 20 May 2008 16:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matthias.schmidt.xactium.com

Wow! That works really nice and easy! :)
Thanks Alex.

But there are two smaller issues about it.
~ That diagram doesn't update automatically. I need to refresh with F5.
Is there a way to do it automatically?
~ The node jumps to a fixed spot near to the middle of the diagram pane
every time the node mapping changes. It's funny, but a bit unhandy!
How can I switch that off?


Cheers,
Matthias





Alex Shatalin wrote:
> Hello Matthias,
>
>> 'style'. If style<=1 one node mapping should be use and if style>1
> It's simple: "style <=1", "style > 1" :-) Just try it - you have to
> create corresponding element below NodeMapping, set language to OCL and
> type these strings as a body.
>
>> I can't have to node mappings as children of one top node reference.
>> Is it right that, I would need a separate top node reference too?
> Yes, you are right!
>
> -----------------
> Alex Shatalin
>
>
Re: Change shape upon field value [message #189193 is a reply to message #187811] Fri, 23 May 2008 15:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matthias.schmidt.xactium.com

Hello again,

I just browsed the GMF web page and found this page about the last
eclipseCON and this presentation by Tatiana Fesenko. Find the page here:
http://www.eclipsecon.org/2008/index.php?page=sub/&id=38 7

She was talking about how they did UML with GMF and mentioned that they
achieved to change the visual presentation of a diagram element when
related element's properties are changed.

Does anybody know more about this approach? Does it mean, that the
latest version of GMF give a better support for this issue?
Unfortunately the presentation is quite brief, so does anybody know
where to find a more detailed documentation about what they did?


Cheers,
Matthias




Matthias Schmidt wrote:
> Hello everybody,
>
> I would like to change the shape of a diagram element whenever the value
> of a field changes.
> Is there a way to do that in GMF?
>
> Thanks a lot.
> Matthias
Re: Change shape upon field value [message #189214 is a reply to message #189193] Fri, 23 May 2008 15:30 Go to previous messageGo to next message
Richard Gronback is currently offline Richard GronbackFriend
Messages: 605
Registered: July 2009
Senior Member
You can take a look at ChangeNotationAction class within the
org.eclipse.uml2.diagram.common plug-in of UML2 Tools to see their approach.

Otherwise, the concept of changing a figure based on change of an underlying
model element property has been discussed a number of times in the
newsgroup, so try searching first (plus, look at
http://wiki.eclipse.org/GMF_Tips#Making_figures_sensitive_to _attributes_of_s
emantic_elements).

One main sticky point of defining multiple mappings with distinct figures
based on constraints is that upon a change to the property the new figure
will be placed at the upper left of the diagram. Alex is looking into
preserving the location of "orphaned" view elements to allow the newly
created ones to not be moved following an update using F5. Again, take a
look through old newsgroup discussions on the topic.

Best,
Rich


On 5/23/08 11:10 AM, in article g16mpv$k7j$1@build.eclipse.org, "Matthias
Schmidt" <matthias.schmidt@xactium.com> wrote:

> Hello again,
>
> I just browsed the GMF web page and found this page about the last
> eclipseCON and this presentation by Tatiana Fesenko. Find the page here:
> http://www.eclipsecon.org/2008/index.php?page=sub/&id=38 7
>
> She was talking about how they did UML with GMF and mentioned that they
> achieved to change the visual presentation of a diagram element when
> related element's properties are changed.
>
> Does anybody know more about this approach? Does it mean, that the
> latest version of GMF give a better support for this issue?
> Unfortunately the presentation is quite brief, so does anybody know
> where to find a more detailed documentation about what they did?
>
>
> Cheers,
> Matthias
>
>
>
>
> Matthias Schmidt wrote:
>> Hello everybody,
>>
>> I would like to change the shape of a diagram element whenever the value
>> of a field changes.
>> Is there a way to do that in GMF?
>>
>> Thanks a lot.
>> Matthias
Re: Change shape upon field value [message #189222 is a reply to message #189214] Fri, 23 May 2008 15:31 Go to previous messageGo to next message
Richard Gronback is currently offline Richard GronbackFriend
Messages: 605
Registered: July 2009
Senior Member
Note that UML2 Tools applies the change using an action, e.g. "Show as
circle" for an Interface element.


On 5/23/08 11:30 AM, in article C45C5B40.D9E6%richard.gronback@borland.com,
"Richard Gronback" <richard.gronback@borland.com> wrote:

> You can take a look at ChangeNotationAction class within the
> org.eclipse.uml2.diagram.common plug-in of UML2 Tools to see their approach.
>
> Otherwise, the concept of changing a figure based on change of an underlying
> model element property has been discussed a number of times in the
> newsgroup, so try searching first (plus, look at
> http://wiki.eclipse.org/GMF_Tips#Making_figures_sensitive_to _attributes_of_s
> emantic_elements).
>
> One main sticky point of defining multiple mappings with distinct figures
> based on constraints is that upon a change to the property the new figure
> will be placed at the upper left of the diagram. Alex is looking into
> preserving the location of "orphaned" view elements to allow the newly
> created ones to not be moved following an update using F5. Again, take a
> look through old newsgroup discussions on the topic.
>
> Best,
> Rich
>
>
> On 5/23/08 11:10 AM, in article g16mpv$k7j$1@build.eclipse.org, "Matthias
> Schmidt" <matthias.schmidt@xactium.com> wrote:
>
>> Hello again,
>>
>> I just browsed the GMF web page and found this page about the last
>> eclipseCON and this presentation by Tatiana Fesenko. Find the page here:
>> http://www.eclipsecon.org/2008/index.php?page=sub/&id=38 7
>>
>> She was talking about how they did UML with GMF and mentioned that they
>> achieved to change the visual presentation of a diagram element when
>> related element's properties are changed.
>>
>> Does anybody know more about this approach? Does it mean, that the
>> latest version of GMF give a better support for this issue?
>> Unfortunately the presentation is quite brief, so does anybody know
>> where to find a more detailed documentation about what they did?
>>
>>
>> Cheers,
>> Matthias
>>
>>
>>
>>
>> Matthias Schmidt wrote:
>>> Hello everybody,
>>>
>>> I would like to change the shape of a diagram element whenever the value
>>> of a field changes.
>>> Is there a way to do that in GMF?
>>>
>>> Thanks a lot.
>>> Matthias
>
Re: Change shape upon field value [message #189513 is a reply to message #189222] Tue, 27 May 2008 14:26 Go to previous message
Eclipse UserFriend
Originally posted by: matthias.schmidt.xactium.com

Hi Richard,

Thanks for your tips, I'll investigate them more in detail.

Sounds like Alex is currently working on this issue. Is that right?
Is he going to have a look on the auto-refresh issue as well? 'cause
hitting F5 all the time is a bit non-user-friendly, isn't it?

We are really keen to hear more about this as we are integrating this
feature for a large us bank and would really appreciate all news and
updates you can give us.

Cheers,
Matthias





Richard Gronback wrote:
> Note that UML2 Tools applies the change using an action, e.g. "Show as
> circle" for an Interface element.
>
>
> On 5/23/08 11:30 AM, in article C45C5B40.D9E6%richard.gronback@borland.com,
> "Richard Gronback" <richard.gronback@borland.com> wrote:
>
>> You can take a look at ChangeNotationAction class within the
>> org.eclipse.uml2.diagram.common plug-in of UML2 Tools to see their approach.
>>
>> Otherwise, the concept of changing a figure based on change of an underlying
>> model element property has been discussed a number of times in the
>> newsgroup, so try searching first (plus, look at
>> http://wiki.eclipse.org/GMF_Tips#Making_figures_sensitive_to _attributes_of_s
>> emantic_elements).
>>
>> One main sticky point of defining multiple mappings with distinct figures
>> based on constraints is that upon a change to the property the new figure
>> will be placed at the upper left of the diagram. Alex is looking into
>> preserving the location of "orphaned" view elements to allow the newly
>> created ones to not be moved following an update using F5. Again, take a
>> look through old newsgroup discussions on the topic.
>>
>> Best,
>> Rich
>>
>>
>> On 5/23/08 11:10 AM, in article g16mpv$k7j$1@build.eclipse.org, "Matthias
>> Schmidt" <matthias.schmidt@xactium.com> wrote:
>>
>>> Hello again,
>>>
>>> I just browsed the GMF web page and found this page about the last
>>> eclipseCON and this presentation by Tatiana Fesenko. Find the page here:
>>> http://www.eclipsecon.org/2008/index.php?page=sub/&id=38 7
>>>
>>> She was talking about how they did UML with GMF and mentioned that they
>>> achieved to change the visual presentation of a diagram element when
>>> related element's properties are changed.
>>>
>>> Does anybody know more about this approach? Does it mean, that the
>>> latest version of GMF give a better support for this issue?
>>> Unfortunately the presentation is quite brief, so does anybody know
>>> where to find a more detailed documentation about what they did?
>>>
>>>
>>> Cheers,
>>> Matthias
>>>
>>>
>>>
>>>
>>> Matthias Schmidt wrote:
>>>> Hello everybody,
>>>>
>>>> I would like to change the shape of a diagram element whenever the value
>>>> of a field changes.
>>>> Is there a way to do that in GMF?
>>>>
>>>> Thanks a lot.
>>>> Matthias
>
Previous Topic:deleting "view" propery group
Next Topic:RollbackException with emf.transaction: pre-commit validation?
Goto Forum:
  


Current Time: Wed Apr 24 19:22:58 GMT 2024

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

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

Back to the top