Book a Demo

Author Topic: MDG Use Case sterotype  (Read 7802 times)

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
MDG Use Case sterotype
« on: March 10, 2014, 10:32:56 pm »
Hi
In my MDG I have defined a use case stereotype.
This includes a shape script so I can colour the use case depending upon other settings.
This all works well until I want to display the use case using the rectangle notation - this option is greyed, presumably because I have a shape script applied.
Is there a way that I can get the specialized use case rendered using the rectangle notation?

Many Thanks
Using V12

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: MDG Use Case sterotype
« Reply #1 on: March 11, 2014, 12:25:16 am »
There was something to enable it. My mind.... If I remember again I'll post. Just to keep you searching :)

q.

P.S. From my shape script book:

Quote
If you want the user to allow switching between rectangular and iconic representation you simply can do that with
Code: [Select]
if(HasProperty('rectanglenotation','0')){
// code for iconic representation
} else{
// code for rectangular representation
// e.g. Rectangle or DrawNativeShape
}
« Last Edit: March 11, 2014, 12:31:27 am by qwerty »

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: MDG Use Case sterotype
« Reply #2 on: March 11, 2014, 12:46:10 am »
Thanks for that qwerty
Is the implication that I must draw the rectangular notation myself or is there an inbuilt routine

Thanks
Using V12

Sorno

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
Re: MDG Use Case sterotype
« Reply #3 on: March 11, 2014, 01:13:44 am »
"DrawNativeShape()" gives you the regular shape of the type in question.
« Last Edit: March 11, 2014, 01:14:25 am by Sorno »

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: MDG Use Case sterotype
« Reply #4 on: March 11, 2014, 01:24:56 am »
Hi
Here is my shapescript
Code: [Select]
shape main
{
      if (HasTag("Phase","Unallocated"))
      {
            setfillcolor(255,192,203);
      }
      if (HasTag("Phase","1.0"))
      {
            setfillcolor(241,249,255);
      }
      if (HasTag("Phase","2.0"))
      {
            setfillcolor(195,226,255);
      }
      if (HasTag("Phase","3.0"))
      {
            setfillcolor(154,208,255);
      }
      if (HasTag("Phase","4.0"))
      {
            setfillcolor(112,188,255);
      }
      if (HasTag("Phase","5.0"))
      {
            setfillcolor(52,161,253);
      }
      if (HasTag("Phase","6.0"))
      {
            setfillcolor(2,138,252);
      }
      if (HasTag("Phase","7.0"))
      {
            setfillcolor(220,255,255);
      }
      if (HasTag("Phase","8.0"))
      {
            setfillcolor(134,241,255);
      }
      if (HasTag("Phase","9.0"))
      {
            setfillcolor(50,227,225);
      }
      if(HasProperty('rectanglenotation','0'))
      {
            // code for iconic representation
            setfillcolor(0,0,0);
      }
      else
      {
            // code for rectangular representation
            // e.g. Rectangle or DrawNativeShape
            drawnativeshape();
      }
}

The 'use rectangle notation' option is greyed out

Any ideas?
Using V12

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: MDG Use Case sterotype
« Reply #5 on: March 11, 2014, 02:12:30 am »
Hu. I'm sure I tested that, but now it does not work? I have to investigate...

q.

[edit] Got it. You need to have Class as base class. Using UseCase does NOT work. No idea why. EAUI, I guess. Will make an amendment in the book.

P.S. Action as base class works as well. So I guess this is a bug in EA.
« Last Edit: March 11, 2014, 03:18:08 am by qwerty »

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: MDG Use Case sterotype
« Reply #6 on: April 24, 2014, 05:43:16 pm »
Hi
I have had an email from Sparx stating that this problem was fixed in version 11

This seems to be working a little better.

My shape script colours elements depending upon a tagged value (phase)

If my element is displayed on a diagram without rectangle notation and I change this tagged value the element changes to rectangle notation.

Is this expected behaviour?

My shape script -

Code: [Select]
shape main
{
      if(HasProperty('rectanglenotation','0'))
      {
            if (HasTag("Phase","Unallocated"))
            {
                  setfillcolor(255,192,203);
            }
            if (HasTag("Phase","1.0"))
            {
                  setfillcolor(241,249,255);
            }
            if (HasTag("Phase","2.0"))
            {
                  setfillcolor(195,226,255);
            }
            if (HasTag("Phase","3.0"))
            {
                  setfillcolor(154,208,255);
            }
            if (HasTag("Phase","4.0"))
            {
                  setfillcolor(112,188,255);
            }
            if (HasTag("Phase","5.0"))
            {
                  setfillcolor(52,161,253);
            }
            if (HasTag("Phase","6.0"))
            {
                  setfillcolor(2,138,252);
            }
            if (HasTag("Phase","7.0"))
            {
                  setfillcolor(220,255,255);
            }
            if (HasTag("Phase","8.0"))
            {
                  setfillcolor(134,241,255);
            }
            if (HasTag("Phase","9.0"))
            {
                  setfillcolor(50,227,225);
            }
            drawnativeshape();
      }
      else
      {
            if (HasTag("Phase","Unallocated"))
            {
                  setfillcolor(255,192,203);
            }
            if (HasTag("Phase","1.0"))
            {
                  setfillcolor(241,249,255);
            }
            if (HasTag("Phase","2.0"))
            {
                  setfillcolor(195,226,255);
            }
            if (HasTag("Phase","3.0"))
            {
                  setfillcolor(154,208,255);
            }
            if (HasTag("Phase","4.0"))
            {
                  setfillcolor(112,188,255);
            }
            if (HasTag("Phase","5.0"))
            {
                  setfillcolor(52,161,253);
            }
            if (HasTag("Phase","6.0"))
            {
                  setfillcolor(2,138,252);
            }
            if (HasTag("Phase","7.0"))
            {
                  setfillcolor(220,255,255);
            }
            if (HasTag("Phase","8.0"))
            {
                  setfillcolor(134,241,255);
            }
            if (HasTag("Phase","9.0"))
            {
                  setfillcolor(50,227,225);
            }
            drawnativeshape();
      }
}

Using V12

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: MDG Use Case sterotype
« Reply #7 on: April 24, 2014, 08:10:30 pm »
I'd say no. And you should report that behavior as a bug.

q.