Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:55 Go to next message
Dewas is currently offline DewasFriend
Messages: 21
Registered: March 2010
Location: Toulouse (France)
Junior Member
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


DEWAS Albert
Master Degree in the IUP Intelligent Systems
Trainee to Continental Corporation Toulouse

[Updated on: Wed, 09 June 2010 14:41]

Report message to a 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 13:59 Go to previous messageGo to next message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
Member
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 14:35 Go to previous message
Dewas is currently offline DewasFriend
Messages: 21
Registered: March 2010
Location: Toulouse (France)
Junior Member
You are my hero ! Very Happy

That will resolve lot's of problem...


DEWAS Albert
Master Degree in the IUP Intelligent Systems
Trainee to Continental Corporation Toulouse

[Updated on: Wed, 09 June 2010 14:37]

Report message to a moderator

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


Current Time: Sat Nov 09 02:19:04 GMT 2024

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

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

Back to the top