Book a Demo

Author Topic: Shape script color status  (Read 7009 times)

Robert Lelieveld

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Shape script color status
« on: October 26, 2015, 10:18:03 pm »
Hi,

I've extended the class to be able to draw a custom shape.
Now I'd like to add the Color Status feature. Looking in the documentation is says that the shadow should be colored according to the status the element has.

Trying this for Class in a UML Class diagram works flawlessly. However my from Class derived type is not drawing colored shadows.

How can this be enabled?


Thanks,
- Robert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Shape script color status
« Reply #1 on: October 27, 2015, 01:01:05 am »
This has nothing to do with shape script. It's an option: Tools/Options/Objects/Show status colors

q.

Robert Lelieveld

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: Shape script color status
« Reply #2 on: October 27, 2015, 02:52:58 am »
Hi qwerty,

Thank you for your reaction.
That option is enabled.

If I add an element of type 'Class' it is drawn with a colored shadow.
However, if I add my extended 'Class' that is using ShapeScript for drawing the element, the shadow is not colored.

Shape script used looks like this:
Code: [Select]
shape main{
      setfillcolor(0, 112, 192);
      roundrect(0,0,100,100, 4, 4);
      addsubshape("name", 100, 100);
      
      shape name
      {
            v_align="center";
            h_align="center";
            printwrapped("#name#");
      }
}

Should a Status Color compartment be added? Or Status Color shadow?

P.s.: I'm using version 12.0.1211
« Last Edit: October 27, 2015, 02:54:34 am by robertl »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Shape script color status
« Reply #3 on: October 27, 2015, 03:58:06 am »
I'll check that tomorrow. But it sounds like being a bug. Try adding DrawNativeShape() in the beginning as a test.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Shape script color status
« Reply #4 on: October 27, 2015, 08:12:31 am »
Project | Settings | Project Types | General Types | Status | Applies To

Robert Lelieveld

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: Shape script color status
« Reply #5 on: October 27, 2015, 06:48:52 pm »
Hi Simon,

Indeed the same window that opens via
Diagram | Appearance | Configure Status Colors...

I've checked that list and the derived type is not available to mark.
How to add it there?

As it is derived from Class, I was hoping it would get the colored shadow.

---
Hi qwerty,

Adding the DrawNativeShape(), draws the native shape :-)
Including colored shadow.
Should a ShapeScript statement be added to draw colored shadows?
Or maybe a colored status compartment? How to do that?

« Last Edit: October 27, 2015, 06:57:55 pm by robertl »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Shape script color status
« Reply #6 on: October 27, 2015, 11:37:53 pm »
I guess you need to report a bug for that (link bottom right of this page). I verified the behavior you observed and I'd regard it as bug.

Since the status color in the shadow merely renders unreadable for me (and other aged people) I stopped using it. Instead I use a small colored rectangle or dot (or whatever) to indicate the status more obvious. You need to hard code the colors once again like this:
Code: [Select]
if (hasproperty("Status", "Approved")) {
  setfillcolor(0, 112, 192);
}

q.
« Last Edit: October 27, 2015, 11:42:23 pm by qwerty »

Robert Lelieveld

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: Shape script color status
« Reply #7 on: October 28, 2015, 06:28:40 pm »
Hi qwerty,

Agree, the shadow is indeed a bit difficult to see.
I'll create a small subshape representing the color.

Would there be a way for ShapeScript to fetch the identified colors in the general status color window? That way the status colors won't be hardcoded in the technology and can be changed per model.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Shape script color status
« Reply #8 on: October 28, 2015, 09:51:39 pm »
AFAIK not. This is why I said "You need to hard code the colors once again"  :-/

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Shape script color status
« Reply #9 on: October 28, 2015, 10:40:13 pm »
Quote
AFAIK not. This is why I said "You need to hard code the colors once again"  :-/

q.
Unless maybe if you write an add-in that gets those status colors and call the add-in operation in your shapescript.

But honestly, I would go for hardcoded :)

Geert