Changing Link Arrows [message #206388] |
Tue, 23 September 2008 05:11 |
Eclipse User |
|
|
|
Originally posted by: nuclearpsyche.gmail.com
Hello,
Let's suppose I have Link objects with a boolean property called
"bidirectional".
I want the link on the diagram to show arrows on both sides of the line
when that property==true and only an arrow on one side if
bidirectional==false.
Is there a way to do that assuming I have a property sheet that allows
changing the boolean value?
Thank you!
tamer
|
|
|
|
Re: Changing Link Arrows [message #206506 is a reply to message #206388] |
Tue, 23 September 2008 10:08 |
Eclipse User |
|
|
|
Originally posted by: tobk42.gmx.de
In addition to Alex' sugestion -- which surely is more in the sense of
model driven engineering -- it is also possible to do some changes in
the code, which might have advantages depending on the number of
settings for a link or a node (and the possible combinations thereof).
Add a method setBidirectional(boolean) to your link's figure (normally
found in the link's edit part), adding/removing the link's second
decoration (see the code for the first decoration, to find out how to do
this). Now you have to implement the link edit part's notifyChanged
method, testing notification.getFeatureID(YourPackage.class) and calling
the setBidirectional method followed by calling refreshVisuals() on the
right feature ID.
Finally, don't forget to mark both methods "@generated NOT", so they
will not be overwritten on the next code generation.
Regards,
Tobias
Tamer schrieb:
> Hello,
> Let's suppose I have Link objects with a boolean property called
> "bidirectional".
> I want the link on the diagram to show arrows on both sides of the line
> when that property==true and only an arrow on one side if
> bidirectional==false.
> Is there a way to do that assuming I have a property sheet that allows
> changing the boolean value?
> Thank you!
>
> tamer
|
|
|
|
Re: Changing Link Arrows [message #206868 is a reply to message #206474] |
Wed, 24 September 2008 14:25 |
Eclipse User |
|
|
|
Originally posted by: nuclearpsyche.gmail.com
Alex,
Thank you for you suggestion!
tamer
Alex Shatalin wrote:
> Hello Tamer,
>
> You have to create two different link mappings with appropriate
> costraints (bidirectional/not bidirectional) + listen to this property
> and call diagram updater to replace existing link with new one on
> changing this property from properties view.
>
> -----------------
> Alex Shatalin
>
>
|
|
|
Re: Changing Link Arrows [message #206884 is a reply to message #206506] |
Wed, 24 September 2008 14:27 |
Eclipse User |
|
|
|
Originally posted by: nuclearpsyche.gmail.com
Tobias,
Thank you! I will definitely try this out.
Regards,
tamer
Tobias wrote:
> In addition to Alex' sugestion -- which surely is more in the sense of
> model driven engineering -- it is also possible to do some changes in
> the code, which might have advantages depending on the number of
> settings for a link or a node (and the possible combinations thereof).
>
> Add a method setBidirectional(boolean) to your link's figure (normally
> found in the link's edit part), adding/removing the link's second
> decoration (see the code for the first decoration, to find out how to do
> this). Now you have to implement the link edit part's notifyChanged
> method, testing notification.getFeatureID(YourPackage.class) and calling
> the setBidirectional method followed by calling refreshVisuals() on the
> right feature ID.
>
> Finally, don't forget to mark both methods "@generated NOT", so they
> will not be overwritten on the next code generation.
>
> Regards,
> Tobias
>
>
>
> Tamer schrieb:
>> Hello,
>> Let's suppose I have Link objects with a boolean property called
>> "bidirectional".
>> I want the link on the diagram to show arrows on both sides of the
>> line when that property==true and only an arrow on one side if
>> bidirectional==false.
>> Is there a way to do that assuming I have a property sheet that allows
>> changing the boolean value?
>> Thank you!
>>
>> tamer
|
|
|
Powered by
FUDForum. Page generated in 0.04363 seconds