Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Change the graphic aspect of an element according to the value of one of its attributes(How to reach the attribute? (Resolved))
Change the graphic aspect of an element according to the value of one of its attributes [message #538352] Mon, 07 June 2010 08:55 Go to next message
Eclipse UserFriend
Hello!

I would like change the graphic aspect of an element in my editors according to the value of an attribute of this element.

For example, I have an object X with an attribute S. If S = 0, my object is in blue. If S = 1, my object is in red. If the value changes, the color also changes.

For that purpose, I need to reach several things which I don't find...


First, I need to reach the attributes of my object directly in the corresponding class XXXeditpart.java. Because it is in this class that I define the graphic appearance of my object.
Are there somebody that knows how to reach the current element or the element selected by programming? To be able to read its attributes?


Then, are there somebody that knows how to verify the valuable changes of the attribute and to make update the display?
I could use a listener, but I could also make the update of the display in the method which applies the modifications of one attributes.


Thank in advance for your help!

Albert

[Updated on: Wed, 09 June 2010 10:41] by Moderator

Re: Change the graphic aspect of an element according to the value of one of its attributes [message #539058 is a reply to message #538352] Wed, 09 June 2010 09:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I think your answer is here:
http://wiki.eclipse.org/GMF_Newsgroup_Q_and_A#How_can_I_sync hronize_my_custom_figures_with_the_model.3F

Hope it helps ..
icon14.gif  Re: Change the graphic aspect of an element according to the value of one of its attributes [message #539069 is a reply to message #538352] Wed, 09 June 2010 10:35 Go to previous message
Eclipse UserFriend
You are my hero ! Very Happy

That will resolve lot's of problem...

[Updated on: Wed, 09 June 2010 10:37] by Moderator

Previous Topic:Documents about Validation in GMF
Next Topic:Problems wrapping RecordingCommand
Goto Forum:
  


Current Time: Fri May 09 08:58:06 EDT 2025

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

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

Back to the top