Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Insert custom symbol/image in UML diagram
Insert custom symbol/image in UML diagram [message #1445512] Wed, 15 October 2014 14:47 Go to next message
Verses the Persian is currently offline Verses the PersianFriend
Messages: 12
Registered: January 2014
Junior Member
Hello all!

Is it possible to replace the default "actor" symbol by a custom image, e.g. a printer symbol?

Something like this:

https://www.eclipse.org/forums/index.php/fa/19528/0/

Thanks in advance!
  • Attachment: umltest.png
    (Size: 40.96KB, Downloaded 1822 times)
Re: Insert custom symbol/image in UML diagram [message #1445751 is a reply to message #1445512] Wed, 15 October 2014 22:23 Go to previous messageGo to next message
Walid Ban is currently offline Walid BanFriend
Messages: 53
Registered: January 2013
Member
Hi,
Yes you can if you apply a stereotype on the actor, and choose the shape appearance.
You should use Papyrus version 0.10.2 with Eclipse kepler.
regards
Re: Insert custom symbol/image in UML diagram [message #1446108 is a reply to message #1445751] Thu, 16 October 2014 11:18 Go to previous messageGo to next message
Verses the Persian is currently offline Verses the PersianFriend
Messages: 12
Registered: January 2014
Junior Member
Walid Ban wrote on Thu, 16 October 2014 00:23

Yes you can if you apply a stereotype on the actor, and choose the shape appearance.


Many thanks, but it doesn't work. I have defined a test profile with a test stereotype. I assigned an icon and a shape. Then I tried to import the profile and assigned it to my actor. But how do I make Papyrus show my custom image instead of the default symbol?

[Updated on: Thu, 16 October 2014 11:18]

Report message to a moderator

Re: Insert custom symbol/image in UML diagram [message #1447780 is a reply to message #1446108] Sat, 18 October 2014 22:26 Go to previous messageGo to next message
Walid Ban is currently offline Walid BanFriend
Messages: 53
Registered: January 2013
Member
see this tutoriel for more details
Re: Insert custom symbol/image in UML diagram [message #1836948 is a reply to message #1445512] Tue, 19 January 2021 16:37 Go to previous messageGo to next message
Erik Stringwell is currently offline Erik StringwellFriend
Messages: 8
Registered: January 2021
Junior Member
I have the same problem, specific to <<Metaclass>> Actor. I have used the same shape in Properties > Icon > Location applied to extension definitions of both <<Metaclass>> Actor and <<Metaclass>> Class. When using the Class-based Stereotype profile, the shape renders both as a "Shape Decoration" (when the radio button is selected under Properties > Appearance), and in the "Symbol" compartment., (as is shown in this tutorial: https://wiki.eclipse.org/MDT/Papyrus/UserGuide/Symbols). However, when the Actor-based Stereotype is used, the Stick Figure persists. When "Shape Decoration" is chosen, my icon is displayed alongside with the Stick Figure Decorator.

Does anyone know how to suppress the Stick Figure?

Thanks in advance!
Re: Insert custom symbol/image in UML diagram [message #1837050 is a reply to message #1836948] Thu, 21 January 2021 12:27 Go to previous messageGo to next message
Erik Stringwell is currently offline Erik StringwellFriend
Messages: 8
Registered: January 2021
Junior Member
The solution that I found was to learn how to use CSS configuration as detailed at https://wiki.eclipse.org/MDT/Papyrus/UserGuide/CSS and as demonstrated at https://www.youtube.com/watch?v=90Qt9a_0c-k.

To have some insight into how the Actor is configured by default, look into the configuration in the Papyrus source code:
https://git.eclipse.org/r/plugins/gitiles/papyrus/org.eclipse.papyrus/+/refs/heads/master/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/theme/umlBase.css. In this file there are a handful of settings which apply to Actor in context of the UseCaseDiagram, which differ from defaults. Each setting along with defaults are described in the user guide linked above. To counteract the settings in umlBase, or other defaults, a CSS file is created as shown in the video tutorial. The settings that affected whether the stickman appears are related to whether the svgFile stickman.svg for the Actor as specified in umlBase.css is used. They are: shapeStyle and shapeDecorationStyle.
Re: Insert custom symbol/image in UML diagram [message #1837053 is a reply to message #1837050] Thu, 21 January 2021 13:02 Go to previous messageGo to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 341
Registered: July 2009
Location: Paris Saclay, France
Senior Member
Thanks Erik for your response
Papyrus Team,
Re: Insert custom symbol/image in UML diagram [message #1837129 is a reply to message #1837053] Fri, 22 January 2021 14:00 Go to previous message
Erik Stringwell is currently offline Erik StringwellFriend
Messages: 8
Registered: January 2021
Junior Member
I continue to struggle to get the shape and icon associated in the profile of the Actor-based stereotype, to render in the UseCaseDiagram. I will attach two example models which demonstrate the problem. They can be imported. One depends on having sysml installed and the other only requires a default installation (standard UML). The reason for providing the Standard UML model is so that it is possible for someone with a basic installation to see the problem, although Actor is not provided in the Class Diagram of Standard UML so one cannot compare the characteristics of the same type in different diagrams. The reason for providing the Sysml model is because Actor is available on the palettes of both the Use Case Diagram and Block Definition Diagram. The Style CSS in the project is applied to Actor in general, and thus applies to both diagrams. Thus the Sysml project allows one to compare the characteristics of the Actor in the BDD and the UCD.

The problem is that the North star icon is not shown for the <<ActorExtension>> in the UCD, while it is shown in the BDD. I would the version in the UCD to look the same as that in the BDD. I realize that there are probably some default parameters that are associated to each diagram type. However I have tried to understand those defined in umlBase.css (linked above), and tried to invert them and tested many other things using this as a reference: https://wiki.eclipse.org/MDT/Papyrus/UserGuide/CSS#Stereotype_Properties_Display.

I know a workaround is to assign the svg path to the model's (rather than the profile's) css parameter "svgFile". However I would prefer to avoid that as it should be possible to use the profile in many models and have the image associated to the usages by default.

Thanks in advance!
Previous Topic:State machine animation
Next Topic:Can't define a pointer to vector as input parameter.
Goto Forum:
  


Current Time: Thu Apr 18 17:14:28 GMT 2024

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

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

Back to the top