Some questions on styles and css [message #1776787] |
Tue, 21 November 2017 10:55  |
Eclipse User |
|
|
|
Hi!
I'm trying to style my stereotyped elements and have some questions.
1. How can I make the border of a shape dashed?
2. Show the packagedElements compartment using css?
I can show the symbol compartment using:
Component > Compartment[type="compartment_shape_display"] but what is the type (string) for the packagedElements compartment? I've tried 'compartment_packagedElements' but couldn't make it work.
3. Is is possible to set the initial size of elements using CSS?
|
|
|
Re: Some questions on styles and css [message #1776794 is a reply to message #1776787] |
Tue, 21 November 2017 11:38   |
Eclipse User |
|
|
|
Hi Patrik,
1. borderStyle: dashed;
You may also use 'custom' instead of 'dashed', then specify a customDash: int[] property:
* {
borderStyle: custom;
customDash: 5 3 1 2 8 6;
}
(Where each odd number is a dash length, and each even number is the space between two dashes)
2. Compartment[kind=packagedElements]
type corresponds to the (internal) serialization type (That you can find in the *.notation file when reading it with a text editor). kind is a human-readable alternative that is mapped to (most) types, to present them in a more consistent way. For compartments, the kind should correspond to the title of the compartment, in camelCase. So you should use [kind=symbol] as well (Instead of type="compartment_shape_display")
3. It has been done in some projects, but I think the layout constraints were hard-coded (Rather than CSS-based). In Papyrus, the default sizes are defined in the Diagram model then generated in Java, so I don't think it's possible to customize them with CSS.
HTH,
Camille
|
|
|
|
|
Re: Some questions on styles and css [message #1776835 is a reply to message #1776830] |
Wed, 22 November 2017 02:59   |
Eclipse User |
|
|
|
Hi Patrik,
You should use "kind", not "type", i.e. either:
Compartment[kind=symbol]
or
Compartment[type=compartment_shape_display]
I believe custom compartments (Like Shape or Stereotype) are not serialized by default, as they are provided by an extension of the diagram, and not explicitly part of the diagram. For other compartments (Like Package Structure, Class attributes, etc.), you can either use the kind + title (e.g. Compartment[kind=attributes]) or the type + notation type (e.g. Compartment[type=Component_PackagedElementShape]). I simply recommend using the kind + title approach, which IMO is more consistent and easier to remember, but both should work.
Camille
|
|
|
|
Powered by
FUDForum. Page generated in 0.08055 seconds