Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » hiding multiplicity for cconnectors using CSS
hiding multiplicity for cconnectors using CSS [message #1784410] Tue, 27 March 2018 17:52 Go to next message
Charles Rivet is currently offline Charles RivetFriend
Messages: 219
Registered: May 2014
Location: Canada
Senior Member

I'm working on a SysML Model using Papyrus .

On an IBD, there are multiple flowports connecting the outside of the block to various parts where the transformations and routing occur.

By design, all ports, and therefore all connectors, have a multiplicity of 1.

I can easily use CSS to remove the multiplicity on ports:

Port {
maskLabel: name;

However, I can't seem to find the right css to get rid of all the connector ends; multiplicity...

I tried:

Connector {
sourceDecoration: none;
targetDecoration: none;
} /* did not really expect this to work...

Port {
maskLabel: name;
}
ConnectorEnd {
maskLabel: none;
}


Would anyone have a suggestion to resolve this?

TIA



/Charles Rivet
Re: hiding multiplicity for cconnectors using CSS [message #1784449 is a reply to message #1784410] Wed, 28 March 2018 07:04 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Charles,

The Mask Label is used to define the text of configurable labels (Such as Port or Property, where a single label displays the Name/Type/Multiplicity/etc)

For Connectors, you're actually manipulating 3 different label elements: one for the name, and two for the multiplicities (This is actually similar to Associations). So what you want to do is actually hide these extra two labels, and only keep the Name one. So maskLabel is not the correct. source/target decoration won't help either, as they are used to remove the arrow-ends of connectors (But CompositeDiagram Connectors already don't have such decorations, so there is nothing to remove)

So what you need to do is to actually 1) Identify the Multiplicity Labels of the Connector, and 2) Set their visible property to false:

Connector > Label[kind=SourceMultiplicity],
Connector > Label[kind=TargetMultiplicity] {
	visible: false;
}


In general, you can find the "kind" of Labels by selecting a Connector (Or any other edge, e.g. Association) in a Diagram, then select Filter > Show/Hide Labels. The "kind" of the label is the value in the "Label Role" column

HTH,
Camille


Camille Letavernier
Re: hiding multiplicity for cconnectors using CSS [message #1784506 is a reply to message #1784449] Wed, 28 March 2018 19:32 Go to previous messageGo to next message
Charles Rivet is currently offline Charles RivetFriend
Messages: 219
Registered: May 2014
Location: Canada
Senior Member

Thank you Camille,

Your suggestion to use "Filter > Show/Hide Labels." is a great tip!

My current css file (an external file that I refer to as a diagrams stylesheet for an IBD) now contains :

 
Port {
	maskLabel: name;
  }
Connector > Label[kind=SourceMultiplicity],
Connector > Label[kind=TargetMultiplicity] {
	visible: false;
	}


The port label now only shows the name, as expected, however, this still does not remove the connectors' multiplicity.

Going through "Show/Hide Labels" and unchecking their respective checkbox does result in the labels not being shown...

What am I doing wrong?


/Charles Rivet
Re: hiding multiplicity for cconnectors using CSS [message #1784535 is a reply to message #1784506] Thu, 29 March 2018 07:22 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Charles,

I've tested that in the CompositeDiagram only; it's quite possible that the IBD doesn't fully support CSS (Although, since SysML1.4, they should now be pure Papyrus/UML Diagrams, and should thus have the same set of supported features)

Also note that user actions take precedence over CSS Customization, so if, for an existing diagram, you have already used the manual Show/Hide Label feature, then CSS will no longer be taken into account. I'll have a deeper look to CSS in SysML Diagrams later today

Cheers,
Camille


Camille Letavernier
Re: hiding multiplicity for cconnectors using CSS [message #1784581 is a reply to message #1784535] Thu, 29 March 2018 14:31 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi,

I've just installed SysML 1.4 to check with an IBD, and it works exactly the same there; except that all Connector labels are hidden by default (So I had to actually add a CSS Rule to display the Connector Name):

Connector > Label[kind=SourceMultiplicity],
Connector > Label[kind=TargetMultiplicity] {
	visible: false; /* Apparently useless in SysML 1.4 IBD; as this is already the default */
}

Connector > Label[kind=Name]{
	visible: true;
}


Camille


Camille Letavernier
Re: hiding multiplicity for cconnectors using CSS [message #1784593 is a reply to message #1784581] Thu, 29 March 2018 20:47 Go to previous messageGo to next message
Charles Rivet is currently offline Charles RivetFriend
Messages: 219
Registered: May 2014
Location: Canada
Senior Member

Thanks again Camille.

This was a model migrated from a previous version of SysML - perhaps there is something strange there. I'l try with a new model to see what happens.

Would you know if there is a way to "reset" user action? IF not, I'll still have a copy of that model from before I stated playing with it...


/Charles Rivet
Re: hiding multiplicity for cconnectors using CSS [message #1784604 is a reply to message #1784593] Fri, 30 March 2018 07:07 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Charles,

Quote:
Would you know if there is a way to "reset" user action?


Yes, absolutely: you can select an element in the Diagram, go to the "Style" tab of the Properties view, and press "Reset style". Note that if you trigger this action while the diagram is selected (i.e. when "nothing" is selected in the Diagram), this will recursively reset all elements.

Cheers,
Camille


Camille Letavernier
Re: hiding multiplicity for cconnectors using CSS [message #1785198 is a reply to message #1784604] Tue, 10 April 2018 16:01 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Hi Camille,

that's very good to know. Actually, I thought it was not possible, as it is not intuitive that you can make changes in the "Appearance" section, but the "reset to default" button is in the "Styles" section.

Best regards

Ansgar
Re: hiding multiplicity for cconnectors using CSS [message #1802798 is a reply to message #1784410] Sat, 16 February 2019 10:19 Go to previous message
William ufghj is currently offline William ufghjFriend
Messages: 1
Registered: February 2019
Junior Member
To hide the scrollbar use -webkit- because it is supported by major browsers (Google Chrome, Safari or newer versions of Opera). There are many other options for the other browsers liteblue which are listed below:

-webkit- (Chrome, Safari, newer versions of Opera):
.element::-webkit-scrollbar { width: 0 !important }

-moz- (Firefox):
.element { overflow: -moz-scrollbars-none; }

-ms- (Internet Explorer +10):
.element { -ms-overflow-style: none; }

[Updated on: Wed, 20 February 2019 04:40]

Report message to a moderator

Previous Topic:Papyrus SysML RCP packaging?
Next Topic:SysMLMigration feature status?
Goto Forum:
  


Current Time: Thu Apr 25 00:51:05 GMT 2024

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

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

Back to the top