|
|
Re: Making figures sensitive to attributes of semantic elements [message #215053 is a reply to message #214942] |
Mon, 12 January 2009 21:37 |
Eclipse User |
|
|
|
Originally posted by: ML1984.gmx.de
Hello everybody.
At first, thanks to Joel. My mistake.
> You should store the semantic changes in the model file. Adding the
> "updateFace()" to the constructor does the job of having an "updated"
> figure when the diagram if opened.
After adding updateFace() to the constructor a part of the problem still
remains. When reopening the diagram file, labels in the node (that are
affected by updateFace, too) have their original color.
To me, it seems that WrappingLabel.setForegroundColor has no effect, if
it is called from a constructor of a Figure. Sounds pretty strange, I know.
Do you guys have any hints how to solve that?
Regards,
Mark
|
|
|
Re: Making figures sensitive to attributes of semantic elements [message #215164 is a reply to message #215053] |
Wed, 14 January 2009 00:25 |
Eclipse User |
|
|
|
Originally posted by: jgreen.upb.de
Hi Mark,
Mark L. wrote:
> Hello everybody.
>
> At first, thanks to Joel. My mistake.
>
>> You should store the semantic changes in the model file. Adding the
>> "updateFace()" to the constructor does the job of having an "updated"
>> figure when the diagram if opened.
>
> After adding updateFace() to the constructor a part of the problem still
> remains. When reopening the diagram file, labels in the node (that are
> affected by updateFace, too) have their original color.
>
> To me, it seems that WrappingLabel.setForegroundColor has no effect, if
> it is called from a constructor of a Figure.
Where are you calling what? Are you trying to update child figures? In the GMF tutorial, the updateFace() is called
before createContents() where your WrappingLabels will be created. You may want to try calling the uodateFace() after
the createContents() -- I don't know why they propose this order.
Or try modifying the createContents() method.
Joel
> Sounds pretty strange, I know.
>
> Do you guys have any hints how to solve that?
>
> Regards,
> Mark
|
|
|
Re: Making figures sensitive to attributes of semantic elements [message #215242 is a reply to message #215164] |
Wed, 14 January 2009 20:38 |
Eclipse User |
|
|
|
Originally posted by: ML1984.gmx.de
Hi all.
It's working now. There were subsequent calls to setForegroundColor
after the ones in my code. I suggest the following steps for
"making figures sensitive to attributes of semantic elements":
- React on direct changes of semantic element (in all cases):
override handleNotificationEvent (as described in the wiki)
- Initialization after reopening the diagram file:
- Nodes: add init code to end of constructor
(as described in the wiki)
- Labels: add init code to the end of refreshVisuals
- Edges: add new method refreshVisuals (overrides inherited one);
add call to refreshVisuals of the superclass;
add init code
If you think this is absolutely wrong, please tell me/us.
Cheers,
Mark
|
|
|
Powered by
FUDForum. Page generated in 0.03463 seconds