Skip to main content



      Home
Home » Eclipse Projects » Sirius » Change appearance of model elements
Change appearance of model elements [message #1630715] Mon, 23 February 2015 05:51 Go to next message
Eclipse UserFriend
Hi,

I have created a 'class diagram' like editor. Classes can be put into containers. The diagram typically represents the content of such container. However a diagram is capable of showing classes from different containers (by some kind of an import mechanism).

Now I would like to have the ability to 'highlight' the imported classes. So: default classes are yellow but imported ones are white. This I managed with a conditional style.

The point is that I don't always want to highlight the fact that classes are imported. Sometimes I just want to see all classes being yellow. The imported ones should become white after I apply a filter or a layer (or something else).

What is the preferred way to tackle this?

Is there a way to modify the appearance of an object via a tool?

Greetings,
Wilbert.
Re: Change appearance of model elements [message #1632499 is a reply to message #1630715] Tue, 24 February 2015 05:05 Go to previous message
Eclipse UserFriend
Le 23/02/2015 11:51, Wilbert Alberts a écrit :
> Hi,

Hi.

> I have created a 'class diagram' like editor. Classes can be put into
> containers. The diagram typically represents the content of such
> container. However a diagram is capable of showing classes from
> different containers (by some kind of an import mechanism).
> Now I would like to have the ability to 'highlight' the imported
> classes. So: default classes are yellow but imported ones are white.
> This I managed with a conditional style.
> The point is that I don't always want to highlight the fact that classes
> are imported. Sometimes I just want to see all classes being yellow. The
> imported ones should become white after I apply a filter or a layer (or
> something else).
>
> What is the preferred way to tackle this?

You could use a Style Customization [1] instead of a conditional style,
ahnd put that customization into a separate, optional layer. Then the
customization would only apply when the layer is enabled.

> Is there a way to modify the appearance of an object via a tool?

You can if you directly modify the style associated to the view, but
this requires knowledge of the Sirius metamodel. Note that if you do
this, for any feature you customize in a view's style you must add the
feature's name to the style's customFeatures attribute, or the
customization will be lost on the next refresh.


[1]
https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#customization

--
Pierre-Charles David - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Sirius and Xtext synchronization
Next Topic:Automatic diagram validation
Goto Forum:
  


Current Time: Sat May 24 23:16:27 EDT 2025

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

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

Back to the top