[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Repainting Variable Custom Figures

Hi all,

I have defined custom figures following the approach I was told in post "Custom figures with external labels and compartment" (basically defining my own figure class that inherits from ScalableImageFigure). Everything works fine (thank you very much), but now I have new problems :)

I need to change the whole custom figure of an object depending of one of its attribute values. Overriding the method handleNotificationEvent in the corresponding EditPart helps me in the task, but now I do not now how to:

1. Change the url of the image class to repaint the new custom figure ***of the modified object***. This is caused by the fact that the image url of the class is static (as needed by its super constructor) and when I change the image url affects to all objects of the corresponding class (and not only to the modified object, as needed)

2. I do not what method I have to call from handleNotificationEvent to repaint the object with the new figure. I have tried with refresh() and getPrimaryShape().repaint() but none of them perform this action, maybe because the image url is set in the construction of the figure.

Thank you very much,
Jose E. Rivera