Book a Demo

Author Topic: How do I remove decorations from extended types being rendered in new stereotype  (Read 27116 times)

MaXyM

  • EA User
  • **
  • Posts: 120
  • Karma: +8/-0
    • View Profile
No, I don't get your point. The right Component is an Archimate stereotype. It uses it's own shape script and therefore does only resemble the native Component. What would you expect?

q.

I was expecting the look equal to component, since I used component shape script with it. Maybe I made bad presumptions. Just followed what has been written earlier in this thread.

Guys, I just want to replace icon of component to my custom one by setting stereotype. Isn't it possible?
« Last Edit: September 13, 2017, 04:53:55 pm by MaXyM »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Both items are just components dragged from tool to deployment diagram. right one has set my custom 'test' stereotype, which uses shape script borrowed from component element found in Archimate package.
If I remove my stereotype from right one, it turns back to look the same as left one.
I'm afraid some clarity is required here:
  • Which Toolbox were you using?
  • What type & stereotype was assigned to the element once created?
  • What type & stereotype of both the elements on that sample diagram when they are different?
  • Are there any instances of your test stereotype in the repository specific stereotype list?
  • When you "remove my stereotype" is the element left without a stereotype or else what is the stereotype you have assigned?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

MaXyM

  • EA User
  • **
  • Posts: 120
  • Karma: +8/-0
    • View Profile
Thanks for your involvement.

ad1. Deployment toolbox (main one for deployment diagram)
ad2. none stereotype is set once element is created. Element is of type "Component"
ad3. Type/stereotype for left one: Component/none, right one: Component/test
ad4. no. It's clean project with only those two elements
ad5. left element is untouched since creating. So it has no stereotype. Just pure "Component".

What I also noticed, shape of icon might be slightly affected by Visual Style (ribbon/Start/Visual Style). For example Enterprise Architect 10 Visual appearance makes all corners of rectangle-like shapes sharp while EA12 makes corner rounded. And what is surprising (or not), those change is not applied to icon created by shape script. Please note we still talking about shape script borrowed from Archimate package, applied to my 'test' stereotype

Today evening I'll attach some more images or even EA project

Thanx

PS. I'm using recent EA (13.5.1351)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
I think you are comparing a UML component with your shapescript, not an Archimate component.

Geert

MaXyM

  • EA User
  • **
  • Posts: 120
  • Karma: +8/-0
    • View Profile
Seems possible and makes sense.
Is there shape script for UML Component available then?
Or back to origin question: how can I replace icon (decoration) in UML Component with custom one by setting stereotype? I can add my custom icon, but default one remains being drawn beneath my one.

thank you
« Last Edit: September 13, 2017, 07:01:10 pm by MaXyM »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Seems possible and makes sense.
Is there shape script for UML Component available then?
Or back to origin question: how can I replace icon (decoration) in UML Component with custom one by setting stereotype? I can add my custom icon, but default one remains being drawn beneath my one.

thank you
No shapescripts for UML elements are not available.
I think the only thing you can do is to use your own schapescript to mimic the original shape without the decoration.

Geert

MaXyM

  • EA User
  • **
  • Posts: 120
  • Karma: +8/-0
    • View Profile
...or use icon which covers original one.
I hope Sparx will take a look on this issue

Thank you.


Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
...or use icon which covers original one.
I hope Sparx will take a look on this issue

Thank you.
Geert's reply echo's my thinking which you would seem to have confirmed.

In shapescripting, you need to carefully "compare Apples with Apples", if the underlying type is different, most "bets are off".

We've used your solution of using a "blank" decoration which covers the original and THEN drawing our decoration.

You also need to be aware that (in a "nod" to Boss in a famous Australian commercial for Castrol Oils) "Icons ain't Icons" - what we consider "icons" and what EA considers icons are NOT the same.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

MaXyM

  • EA User
  • **
  • Posts: 120
  • Karma: +8/-0
    • View Profile
How can you draw "blank" decoration covering original one?
I would expect to draw decoration, containing rectangle, without border, filled with default element colour, including color gradient matching with underlying element.
Unfortunately I've not succeed in any of those achievement:
- every shape has border, which cannot be set to either 0 (zero) or transparent
- default gradient background doesn't match underlying background.
If you can do it, please share your code. I would appreciate it.

Speaking of background colour, I've found some undocumented behaviour.
When I create rectangle directly inside the decoration, background is filled with solid color.

Code: [Select]
decoration decblank2 {
    orientation = "NE";
    rectangle(-70,560,200,330);
}

But if I create rectangle inside a subshape, it is filled with gradient (applied regarding to visual style)

Code: [Select]
decoration decblank {
orientation = "NE";
addsubshape("red",   100,  100);

shape red
       {
               rectangle(-70,60,200,330);
       }

}

See the image:


« Last Edit: September 15, 2017, 11:46:17 pm by MaXyM »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
What would you expect from a
Code: [Select]
    rectangle(-70,560,200,330);
statement if the area can be 100 in square at max?

Try something like this:
Code: [Select]
shape main {
DrawNativeShape();
StartPath();
MoveTo(80,1);
LineTo(99,1);
LineTo(99,30);
LineTo(80,30);
EndPath();
FillPath();
}

You will note that the gradient spoils it, but the icon below is hidden this way.

q.
« Last Edit: September 16, 2017, 01:07:16 am by qwerty »

MaXyM

  • EA User
  • **
  • Posts: 120
  • Karma: +8/-0
    • View Profile
Unfortunately, your covering shape changes it's size while resizing element.
I'm trying to avoid this behaviour but with no success so far.

However thanx for the tip. I got rid of border using your approach of drawing borderless lines (but in decoration section)
« Last Edit: September 16, 2017, 02:01:44 am by MaXyM »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Blood, Sweat and Tears.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Blood, Sweat and Tears.

q.
And (eventually) realizing that you don't do this sort of stuff in shape main.  You need to do it in a decoration shape.   Decorations don't change their size with the main shape.  So you can do with a simple rectangle() (with the fill and pen colour set to the background colour you want) where the endpoint values can be <0 and >100 if required (sorry q - a little more is OK, a lot more is bad).  If you need to, I can post an example. But I "leave it as an exercise for the reader".

Paolo
« Last Edit: September 18, 2017, 09:56:59 am by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
To avoid having to hide the component icon, have you considered extending UML::Class instead of UML::Component? A UML Component is basically a Class with required and provided interfaces, and EA allows you to add required and provided interfaces to Classes anyway, so you wouldn't lose any functionality.
The Sparx Team
[email protected]