Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Some questions on styles and css
Some questions on styles and css [message #1776787] Tue, 21 November 2017 15:55 Go to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
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 16:38 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
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


Camille Letavernier
Re: Some questions on styles and css [message #1776807 is a reply to message #1776794] Tue, 21 November 2017 19:39 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
Thanks Camille
Re: Some questions on styles and css [message #1776830 is a reply to message #1776794] Wed, 22 November 2017 07:35 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
Camille Letavernier wrote on Tue, 21 November 2017 17:38
Hi Patrik,
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")


Actually, I can't get this to work, Compartment[type=symbol] doesn't work for me.

Also, looking at the notation file doesn't make it clearer for me. I guess the serialization type is the type attribute? I've tried that and it doesn't work either. I've attached the notation file.

Thanks
Patrik
Re: Some questions on styles and css [message #1776835 is a reply to message #1776830] Wed, 22 November 2017 07:59 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
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


Camille Letavernier
Re: Some questions on styles and css [message #1776846 is a reply to message #1776835] Wed, 22 November 2017 09:05 Go to previous message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
Ah, missed the kind, thanks again.
Previous Topic:Understanding the Architecture Framework
Next Topic:Stereotypes and CSS: can select StereotypeComment on the basis of related stereotype
Goto Forum:
  


Current Time: Fri Apr 19 17:04:54 GMT 2024

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

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

Back to the top