Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » css rule to hide transition names on state machine diagram
css rule to hide transition names on state machine diagram [message #1638904] Fri, 27 February 2015 10:57 Go to next message
Marijan Zemljic is currently offline Marijan ZemljicFriend
Messages: 4
Registered: February 2015
Junior Member
Hi,

Is there any css rule to hide the name and possibly the stereotype tag of transitions (or more precisely transition labels) on state machine diagrams. I tried following to hide the name but it doesn't work:

StateMachineDiagram Transition[appliedStereotypes~="XtTransition"] > Label:name
{
visible: false;
}


Thanks,
Marijan
Re: css rule to hide transition names on state machine diagram [message #1639314 is a reply to message #1638904] Fri, 27 February 2015 15:21 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 913
Registered: February 2011
Senior Member
Hi Marijan,

It seems the StateMachineDiagram doesn't properly declare the type of its labels, so the ":name" part doesn't work

You can use simply "... > Label" instead of "... > Label:name". It will hide all Labels from the transition, but it may be an acceptable workaround.

I've reported it on Bugzilla:

461055: [StateMachineDiagram] The notationTypesMapping extension point is not properly populated
https://bugs.eclipse.org/bugs/show_bug.cgi?id=461055

Camille


Camille Letavernier
Re: css rule to hide transition names on state machine diagram [message #1639366 is a reply to message #1639314] Fri, 27 February 2015 15:55 Go to previous messageGo to next message
Marijan Zemljic is currently offline Marijan ZemljicFriend
Messages: 4
Registered: February 2015
Junior Member
Hi Camille,

Hiding the transition labels completely is not really acceptable as I would like for transition triggers to still be visible on the diagram.
Anyway, thanks for the answer. At least I know now what is the issue.

BR,
Marijan
Re: css rule to hide transition names on state machine diagram [message #1639374 is a reply to message #1639366] Fri, 27 February 2015 16:03 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 913
Registered: February 2011
Senior Member
Hi Marijan,

In that case you may want to use the low-level ID of the Name label for Transitions. I usually don't recommend this, because IDs may change without notice (Although this doesn't really happen in practice):

StateMachineDiagram Transition > Label[type="7001"] /* Name Label */{
	visible: false;
}


HTH,
Camille


Camille Letavernier
Re: css rule to hide transition names on state machine diagram [message #1800786 is a reply to message #1639374] Tue, 08 January 2019 10:48 Go to previous messageGo to next message
Luca Cristoforetti is currently offline Luca CristoforettiFriend
Messages: 8
Registered: April 2018
Junior Member
Hi,
sorry for waking up this old thread, but I have the same problem.
I'm using Neon and Papyrus 2.0.3, I need to hide the stereotype tag on a Transition.

I followed the hint above to hide the transition name, but it doesn't work:
StateMachineDiagram Transition > Label[type="7001"] {
	visible: false;
}


Looking at the source code inside stateMachineDiagram.gmfgen I understand that the correct code for the stereotype tag should be 7003, but it doesn't work either.

I can completely hide the Label as suggested, but it's not what I need.

Is there another way to hide that part of label? I can manually do it via Filters/Manage Connector Labels, but I need to do it in the CSS.


Thanks
Luca




Re: css rule to hide transition names on state machine diagram [message #1800788 is a reply to message #1800786] Tue, 08 January 2019 11:17 Go to previous messageGo to next message
Nicolas FAUVERGUE is currently offline Nicolas FAUVERGUEFriend
Messages: 47
Registered: February 2014
Member
Hi,

If you only want to hide the stereotype name, you will use this following css :
StateMachineDiagram Transition > Label:stereotype {
	visible: false;
}


Otherwise, can you precise your needed ?
Thanks in advance.

HTH,
Nicolas
Re: css rule to hide transition names on state machine diagram [message #1800793 is a reply to message #1800788] Tue, 08 January 2019 12:31 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 913
Registered: February 2011
Senior Member
Hi,

Please note that my warning:

Quote:
I usually don't recommend this, because IDs may change without notice (Although this doesn't really happen in practice):


actually became true not so long after. Papyrus moved away from integer-based IDs to String-based, so any numeric ID used in CSS will now be broken (It happened in Neon, IIRC)

So the low-level type for Transition Stereotype Labels ("7003") became "Transition_StereotypeLabel". This means you should use [type="Transition_StereotypeLabel"] rather than [type="7003"]

Still, Nicolas' option is the recommended way, as it should remain compatible across Papyrus versions. Label[kind=Stereotype] should also work, and should remain supported in the future (Although I didn't test it)

HTH,
Camille


Camille Letavernier
Re: css rule to hide transition names on state machine diagram [message #1800794 is a reply to message #1800793] Tue, 08 January 2019 12:37 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 913
Registered: February 2011
Senior Member
Also, the original bug has been fixed (I'm not sure when exactly, but I can't reproduce it anymore):

461055: [StateMachineDiagram] The notationTypesMapping extension point is not properly populated
https://bugs.eclipse.org/bugs/show_bug.cgi?id=461055

So low-level ID workarounds shouldn't be required anymore


Camille Letavernier
Re: css rule to hide transition names on state machine diagram [message #1800795 is a reply to message #1800794] Tue, 08 January 2019 12:50 Go to previous messageGo to next message
Luca Cristoforetti is currently offline Luca CristoforettiFriend
Messages: 8
Registered: April 2018
Junior Member
Thanks Camille,
your suggestion works good. Using the String-based ID solved the issue.

Probably the bug has been solved in a more recent version than my one: I tried also the other solutions, but they don't work for Transitions (although they are good for Associations):

/* NOT WORKING */
StateMachineDiagram Transition > Label[kind=stereotype] {
	visible: false;
}

/* NOT WORKING */
StateMachineDiagram Transition > Label:stereotype {
	visible: false;
}

/* WORKING */
StateMachineDiagram Transition > [type="Transition_StereotypeLabel"] {
	visible: false;
}




Thank you very much
Luca


Re: css rule to hide transition names on state machine diagram [message #1800799 is a reply to message #1800795] Tue, 08 January 2019 13:48 Go to previous message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 913
Registered: February 2011
Senior Member
Hi Luca,

The attributes are case sensitive, so [kind=stereotype] would never work; it should be [kind=Stereotype] (Capital S).

It seems that the bug was fixed in August 2017 (slightly before Oxygen.1), so that fix wouldn't exist in Neon regardless.

Cheers,
Camille


Camille Letavernier

[Updated on: Tue, 08 January 2019 13:49]

Report message to a moderator

Previous Topic:Label on component elements in Component Diagram
Next Topic:SysML Substitution relation - not visible in diagrams and palette
Goto Forum:
  


Current Time: Mon Dec 16 02:42:43 GMT 2019

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

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

Back to the top