Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How can I refresh the diagram when properties change, that aer shown as labels in the diagram
How can I refresh the diagram when properties change, that aer shown as labels in the diagram [message #75054] Tue, 07 November 2006 09:49 Go to next message
Alexander Haag is currently offline Alexander HaagFriend
Messages: 119
Registered: July 2009
Senior Member
Hi,

I've got a GMF-generated graphical Editor that shows Properties of a
node (which define branch-conditions) as labels on its outgoing edges
(connections to other nodes).
Displaying them is not the problem, but when I change the Properties in
the Properties-view I want to update the diagram, so that the new
condition-values are shown as labels.

Does anyone know how I can obtain such behaviour?
I read some former posts
(news://news.eclipse.org:119/ecrrat$5h6$1@utils.eclipse.org), but i
didn't get to their point.

Thanks for any help in this manner

Greets Alex Haag
Re: How can I refresh the diagram when properties change, that aer shown as labels in the diagram [message #75776 is a reply to message #75054] Wed, 08 November 2006 14:07 Go to previous messageGo to next message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Alex,

Are you trying to update what is displayed on labels that already exist
on the diagram or are you trying to create new labels on the diagram
when the properties change?

If the labels already exist, then you just need to override the method
handleNotificationEvent(Notification evt) in your label editpart to
refresh the text in the label when the relevant property changes. Take
a look at the code in LEDEditPart.handleNotificationEvent(Notification
evt) for an example. Whenever the LED value changes it updates the
number displayed inside the LED.

Regards,
Cherie

Alex Haag wrote:
> Hi,
>
> I've got a GMF-generated graphical Editor that shows Properties of a
> node (which define branch-conditions) as labels on its outgoing edges
> (connections to other nodes).
> Displaying them is not the problem, but when I change the Properties in
> the Properties-view I want to update the diagram, so that the new
> condition-values are shown as labels.
>
> Does anyone know how I can obtain such behaviour?
> I read some former posts
> (news://news.eclipse.org:119/ecrrat$5h6$1@utils.eclipse.org), but i
> didn't get to their point.
>
> Thanks for any help in this manner
>
> Greets Alex Haag
Re: How can I refresh the diagram when properties change, that aer shown as labels in the diagram [message #75828 is a reply to message #75776] Wed, 08 November 2006 15:11 Go to previous message
Alexander Haag is currently offline Alexander HaagFriend
Messages: 119
Registered: July 2009
Senior Member
Hi Cherie,

thanks for your answer.
My label already exists in the diagram, but I think I don't have a
special Label EditPart. The Label I am talking about is just an
org.eclipse.draw2d.Label Label which is added to the figure of the
connectionEditPart (outgoing edge) in the constructor.

I will try to use the handleNotificationEvent()-method of the
connectionEditPart, maybe I can modify the Label in this way.

I will keep you informed when I'm stuck again.

Thanks Alex Haag



Cherie Revells wrote:
> Alex,
>
> Are you trying to update what is displayed on labels that already exist
> on the diagram or are you trying to create new labels on the diagram
> when the properties change?
>
> If the labels already exist, then you just need to override the method
> handleNotificationEvent(Notification evt) in your label editpart to
> refresh the text in the label when the relevant property changes. Take
> a look at the code in LEDEditPart.handleNotificationEvent(Notification
> evt) for an example. Whenever the LED value changes it updates the
> number displayed inside the LED.
>
> Regards,
> Cherie
>
> Alex Haag wrote:
>> Hi,
>>
>> I've got a GMF-generated graphical Editor that shows Properties of a
>> node (which define branch-conditions) as labels on its outgoing edges
>> (connections to other nodes).
>> Displaying them is not the problem, but when I change the Properties
>> in the Properties-view I want to update the diagram, so that the new
>> condition-values are shown as labels.
>>
>> Does anyone know how I can obtain such behaviour?
>> I read some former posts
>> (news://news.eclipse.org:119/ecrrat$5h6$1@utils.eclipse.org), but i
>> didn't get to their point.
>>
>> Thanks for any help in this manner
>>
>> Greets Alex Haag
Previous Topic:How to get Diagram size in layoutProvider
Next Topic:Can't find genFeature for feature 'configuredElements' in class Server
Goto Forum:
  


Current Time: Sat Jul 27 18:30:10 GMT 2024

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

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

Back to the top