Home » Eclipse Projects » Sirius » Change node icon programmatically
|
Re: Change node icon programmatically [message #1694055 is a reply to message #1693706] |
Thu, 30 April 2015 09:20 |
|
Hello,
I think you should use a Diagram Styles Customization (see
https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#customization).
You should create a "Property Customization (by expression)". In the
"Applied On" field, you select the style you want to replace the icon.
In the "value expression" you set the path of the new icon.
Regards,
Steve
Le 28/04/2015 18:47, Benedek Horvath a écrit :
> Hello,
>
> Is there any way to change the icon of a node in a Sirius editor
> programmatically?
>
> I mean, I have a Representation of the model in a Sirius editor, and I
> would like to change the icon of a specific node on the canvas.
> Therefore I created and added a new External Java Action in the odesign
> file, that receives all the views, and I iterate over each node, and I
> want to change the style / icon / graphical representation of a
> specified node. Is there any way to do it?
>
> Thank you for help, in advance!
>
> Best regards,
> Ben
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
| |
Re: Change node icon programmatically [message #1694296 is a reply to message #1694209] |
Mon, 04 May 2015 08:39 |
|
Hi Benedek,
Le 02/05/2015 09:25, Benedek Horvath a écrit :
> Dear Steve,
>
> Thank you for the advice, but I would like to enable for the users of my
> editor (created using Sirius) to change the icon only for one node from
> the specified types.
> For example, I have Present Boxes, and I would like to enable that if
> the user double-clicks on a Present Box, then its icon will change for
> something else, while the other Present Boxes remain the same as they
> were before.
>
> Can I do this using Sirius?
When the user double click on a Present Box, does it change something
somewhere in the model ? You could use this change/state in the
expression of the style customization mentionned by Steve to compute the
name of the icon you want to use.
>
> Thank you for help.
>
> Best regards,
> Ben
Regards
--
Maxime - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
| | | |
Goto Forum:
Current Time: Thu Sep 26 18:46:52 GMT 2024
Powered by FUDForum. Page generated in 0.03756 seconds
|